|
| 1 | +#define AF_API_VERSION 1.0 |
| 2 | + |
| 3 | +typedef enum { |
| 4 | + f32, ///< 32-bit floating point values |
| 5 | + c32, ///< 32-bit complex floating point values |
| 6 | + f64, ///< 64-bit complex floating point values |
| 7 | + c64, ///< 64-bit complex floating point values |
| 8 | + b8 , ///< 8-bit boolean values |
| 9 | + s32, ///< 32-bit signed integral values |
| 10 | + u32, ///< 32-bit unsigned integral values |
| 11 | + u8 , ///< 8-bit unsigned integral values |
| 12 | + s64, ///< 64-bit signed integral values |
| 13 | + u64, ///< 64-bit unsigned integral values |
| 14 | + s16, ///< 16-bit signed integral values |
| 15 | + u16, ///< 16-bit unsigned integral values |
| 16 | +} af_dtype; |
| 17 | + |
| 18 | +typedef enum { |
| 19 | + /// |
| 20 | + /// The function returned successfully |
| 21 | + /// |
| 22 | + AF_SUCCESS = 0, |
| 23 | + |
| 24 | + // 100-199 Errors in environment |
| 25 | + |
| 26 | + /// |
| 27 | + /// The system or device ran out of memory |
| 28 | + /// |
| 29 | + AF_ERR_NO_MEM = 101, |
| 30 | + |
| 31 | + /// |
| 32 | + /// There was an error in the device driver |
| 33 | + /// |
| 34 | + AF_ERR_DRIVER = 102, |
| 35 | + |
| 36 | + /// |
| 37 | + /// There was an error with the runtime environment |
| 38 | + /// |
| 39 | + AF_ERR_RUNTIME = 103, |
| 40 | + |
| 41 | + // 200-299 Errors in input parameters |
| 42 | + |
| 43 | + /// |
| 44 | + /// The input array is not a valid af_array object |
| 45 | + /// |
| 46 | + AF_ERR_INVALID_ARRAY = 201, |
| 47 | + |
| 48 | + /// |
| 49 | + /// One of the function arguments is incorrect |
| 50 | + /// |
| 51 | + AF_ERR_ARG = 202, |
| 52 | + |
| 53 | + /// |
| 54 | + /// The size is incorrect |
| 55 | + /// |
| 56 | + AF_ERR_SIZE = 203, |
| 57 | + |
| 58 | + /// |
| 59 | + /// The type is not suppported by this function |
| 60 | + /// |
| 61 | + AF_ERR_TYPE = 204, |
| 62 | + |
| 63 | + /// |
| 64 | + /// The type of the input arrays are not compatible |
| 65 | + /// |
| 66 | + AF_ERR_DIFF_TYPE = 205, |
| 67 | + |
| 68 | + /// |
| 69 | + /// Function does not support GFOR / batch mode |
| 70 | + /// |
| 71 | + AF_ERR_BATCH = 207, |
| 72 | + |
| 73 | + /// |
| 74 | + /// Input does not belong to the current device. |
| 75 | + /// |
| 76 | + AF_ERR_DEVICE = 208, |
| 77 | + |
| 78 | + // 300-399 Errors for missing software features |
| 79 | + |
| 80 | + /// |
| 81 | + /// The option is not supported |
| 82 | + /// |
| 83 | + AF_ERR_NOT_SUPPORTED = 301, |
| 84 | + |
| 85 | + /// |
| 86 | + /// This build of ArrayFire does not support this feature |
| 87 | + /// |
| 88 | + AF_ERR_NOT_CONFIGURED = 302, |
| 89 | + |
| 90 | + /// |
| 91 | + /// This build of ArrayFire is not compiled with "nonfree" algorithms |
| 92 | + /// |
| 93 | + AF_ERR_NONFREE = 303, |
| 94 | + |
| 95 | + // 400-499 Errors for missing hardware features |
| 96 | + |
| 97 | + /// |
| 98 | + /// This device does not support double |
| 99 | + /// |
| 100 | + AF_ERR_NO_DBL = 401, |
| 101 | + |
| 102 | + /// |
| 103 | + /// This build of ArrayFire was not built with graphics or this device does |
| 104 | + /// not support graphics |
| 105 | + /// |
| 106 | + AF_ERR_NO_GFX = 402, |
| 107 | + |
| 108 | + // 500-599 Errors specific to heterogenous API |
| 109 | + |
| 110 | + /// |
| 111 | + /// There was an error when loading the libraries |
| 112 | + /// |
| 113 | + AF_ERR_LOAD_LIB = 501, |
| 114 | + |
| 115 | + /// |
| 116 | + /// There was an error when loading the symbols |
| 117 | + /// |
| 118 | + AF_ERR_LOAD_SYM = 502, |
| 119 | + |
| 120 | + /// |
| 121 | + /// There was a mismatch between the input array and the active backend |
| 122 | + /// |
| 123 | + AF_ERR_ARR_BKND_MISMATCH = 503, |
| 124 | + |
| 125 | + // 900-999 Errors from upstream libraries and runtimes |
| 126 | + |
| 127 | + /// |
| 128 | + /// There was an internal error either in ArrayFire or in a project |
| 129 | + /// upstream |
| 130 | + /// |
| 131 | + AF_ERR_INTERNAL = 998, |
| 132 | + |
| 133 | + /// |
| 134 | + /// Unknown Error |
| 135 | + /// |
| 136 | + AF_ERR_UNKNOWN = 999 |
| 137 | +} af_err; |
0 commit comments