tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
error_codes.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
24 #ifndef TVM_RUNTIME_CRT_ERROR_CODES_H_
25 #define TVM_RUNTIME_CRT_ERROR_CODES_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define TVM_CRT_ERROR_CATEGORY_Pos 8
32 #define TVM_CRT_ERROR_CATEGORY_Msk (0xff << TVM_CRT_ERROR_CATEGORY_Pos)
33 #define TVM_CRT_ERROR_CODE_Pos 0
34 #define TVM_CRT_ERROR_CODE_Msk (0xff << TVM_CRT_ERROR_CODE_Pos)
35 
36 #define DEFINE_TVM_CRT_ERROR(category, code) \
37  (((category) << TVM_CRT_ERROR_CATEGORY_Pos) | ((code) << TVM_CRT_ERROR_CODE_Pos))
38 typedef enum {
49 
50 typedef enum {
52 
53  // Function Registry
59 
60  // Framing
66 
67  // Write stream
70 
71  // Session
75 
76  // Platform
83 
84  // Common error codes returned from generated functions.
86 
87  // Graph or AoT executor
91 
92  // Function Calls - common problems encountered calling functions.
97 
98  // Time Evaluator - times functions for use with debug runtime.
100 
101  // System errors are always negative integers; this mask indicates presence of a system error.
102  // Cast tvm_crt_error_t to a signed integer to interpret the negative error code.
103  kTvmErrorSystemErrorMask = (1 << (sizeof(int) * 8 - 1)),
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif // TVM_RUNTIME_CRT_ERROR_CODES_H_
#define DEFINE_TVM_CRT_ERROR(category, code)
Definition: error_codes.h:36
tvm_crt_error_t
Definition: error_codes.h:50
@ kTvmErrorFunctionNameNotFound
Definition: error_codes.h:54
@ kTvmErrorFramingShortPacket
Definition: error_codes.h:62
@ kTvmErrorPlatformTimerBadState
Definition: error_codes.h:81
@ kTvmErrorSessionInvalidState
Definition: error_codes.h:72
@ kTvmErrorExecutorModuleBadContext
Definition: error_codes.h:89
@ kTvmErrorBufferTooSmall
Definition: error_codes.h:58
@ kTvmErrorSessionReceiveBufferShortWrite
Definition: error_codes.h:74
@ kTvmErrorFramingPayloadIncomplete
Definition: error_codes.h:65
@ kTvmErrorPlatformNoMemory
Definition: error_codes.h:80
@ kTvmErrorExecutorModuleNoSuchInput
Definition: error_codes.h:90
@ kTvmErrorWriteStreamShortWrite
Definition: error_codes.h:68
@ kTvmErrorTimeEvaluatorBadHandle
Definition: error_codes.h:99
@ kTvmErrorFunctionCallNotImplemented
Definition: error_codes.h:95
@ kTvmErrorFunctionAlreadyDefined
Definition: error_codes.h:57
@ kTvmErrorFunctionCallWrongArgType
Definition: error_codes.h:94
@ kTvmErrorPlatformMemoryManagerInitialized
Definition: error_codes.h:78
@ kTvmErrorFramingPayloadOverflow
Definition: error_codes.h:64
@ kTvmErrorFunctionIndexInvalid
Definition: error_codes.h:55
@ kTvmErrorGeneratedInvalidStorageId
Definition: error_codes.h:85
@ kTvmErrorSystemErrorMask
Definition: error_codes.h:103
@ kTvmErrorFunctionRegistryFull
Definition: error_codes.h:56
@ kTvmErrorPlatformStackAllocBadFree
Definition: error_codes.h:82
@ kTvmErrorFunctionCallNumArguments
Definition: error_codes.h:93
@ kTvmErrorFramingInvalidEscape
Definition: error_codes.h:63
@ kTvmErrorPlatformCheckFailure
Definition: error_codes.h:77
@ kTvmErrorPlatformShutdown
Definition: error_codes.h:79
@ kTvmErrorSessionReceiveBufferBusy
Definition: error_codes.h:73
@ kTvmErrorFunctionCallInvalidArg
Definition: error_codes.h:96
@ kTvmErrorNoError
Definition: error_codes.h:51
@ kTvmErrorExecutorModuleAlreadyCreated
Definition: error_codes.h:88
@ kTvmErrorFramingInvalidState
Definition: error_codes.h:61
@ kTvmErrorWriteStreamLongWrite
Definition: error_codes.h:69
tvm_crt_error_category_t
Definition: error_codes.h:38
@ kTvmErrorCategoryPlatform
Definition: error_codes.h:43
@ kTvmErrorCategoryFunctionRegistry
Definition: error_codes.h:39
@ kTvmErrorCategorySession
Definition: error_codes.h:42
@ kTvmErrorCategoryWriteStream
Definition: error_codes.h:41
@ kTvmErrorCategoryTimeEvaluator
Definition: error_codes.h:47
@ kTvmErrorCategoryFunctionCall
Definition: error_codes.h:46
@ kTvmErrorCategoryExecutor
Definition: error_codes.h:45
@ kTvmErrorCategoryGenerated
Definition: error_codes.h:44
@ kTvmErrorCategoryFraming
Definition: error_codes.h:40