xref: /aosp_15_r20/external/executorch/runtime/platform/abort.h (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 /**
10  * @file
11  * ExecuTorch global abort wrapper function.
12  */
13 
14 #pragma once
15 
16 #include <executorch/runtime/platform/compiler.h>
17 
18 namespace executorch {
19 namespace runtime {
20 
21 /**
22  * Trigger the ExecuTorch global runtime to immediately exit without cleaning
23  * up, and set an abnormal exit status (platform-defined).
24  */
25 ET_NORETURN void runtime_abort();
26 
27 } // namespace runtime
28 } // namespace executorch
29 
30 namespace torch {
31 namespace executor {
32 // TODO(T197294990): Remove these deprecated aliases once all users have moved
33 // to the new `::executorch` namespaces.
34 using ::executorch::runtime::runtime_abort;
35 } // namespace executor
36 } // namespace torch
37