|
17 | 17 | extern "C" { |
18 | 18 | #endif |
19 | 19 |
|
| 20 | +/////////////////////////////////////////////////////////////////////////////// |
| 21 | +/// @brief Defines Return/Error codes |
| 22 | +typedef enum ol_errc_t { |
| 23 | + /// Success |
| 24 | + OL_ERRC_SUCCESS = 0, |
| 25 | + /// Unknown or internal error |
| 26 | + OL_ERRC_UNKNOWN = 1, |
| 27 | + /// A pointer argument is null when it should not be |
| 28 | + OL_ERRC_INVALID_NULL_POINTER = 2, |
| 29 | + /// An argument is invalid |
| 30 | + OL_ERRC_INVALID_ARGUMENT = 3, |
| 31 | + /// Out of resources |
| 32 | + OL_ERRC_OUT_OF_RESOURCES = 4, |
| 33 | + /// generic error code for unsupported features and enums |
| 34 | + OL_ERRC_UNSUPPORTED = 5, |
| 35 | + /// invalid size or dimensions (e.g., must not be zero, or is out of bounds) |
| 36 | + OL_ERRC_INVALID_SIZE = 6, |
| 37 | + /// enumerator argument is not valid |
| 38 | + OL_ERRC_INVALID_ENUMERATION = 7, |
| 39 | + /// Named kernel not found in the program binary |
| 40 | + OL_ERRC_INVALID_KERNEL_NAME = 8, |
| 41 | + /// Invalid Value |
| 42 | + OL_ERRC_INVALID_VALUE = 9, |
| 43 | + /// Invalid platform |
| 44 | + OL_ERRC_INVALID_PLATFORM = 10, |
| 45 | + /// Invalid device |
| 46 | + OL_ERRC_INVALID_DEVICE = 11, |
| 47 | + /// Invalid queue |
| 48 | + OL_ERRC_INVALID_QUEUE = 12, |
| 49 | + /// Invalid event |
| 50 | + OL_ERRC_INVALID_EVENT = 13, |
| 51 | + /// handle argument is not valid |
| 52 | + OL_ERRC_INVALID_NULL_HANDLE = 14, |
| 53 | + /// @cond |
| 54 | + OL_ERRC_FORCE_UINT32 = 0x7fffffff |
| 55 | + /// @endcond |
| 56 | + |
| 57 | +} ol_errc_t; |
| 58 | + |
20 | 59 | /////////////////////////////////////////////////////////////////////////////// |
21 | 60 | #ifndef OL_VERSION_MAJOR |
22 | 61 | /// @brief Major version of the Offload API |
@@ -101,47 +140,6 @@ typedef struct ol_program_impl_t *ol_program_handle_t; |
101 | 140 | /// @brief Handle of kernel object |
102 | 141 | typedef void *ol_kernel_handle_t; |
103 | 142 |
|
104 | | -/////////////////////////////////////////////////////////////////////////////// |
105 | | -/// @brief Defines Return/Error codes |
106 | | -typedef enum ol_errc_t { |
107 | | - /// Success |
108 | | - OL_ERRC_SUCCESS = 0, |
109 | | - /// Invalid Value |
110 | | - OL_ERRC_INVALID_VALUE = 1, |
111 | | - /// Invalid platform |
112 | | - OL_ERRC_INVALID_PLATFORM = 2, |
113 | | - /// Invalid device |
114 | | - OL_ERRC_INVALID_DEVICE = 3, |
115 | | - /// Invalid queue |
116 | | - OL_ERRC_INVALID_QUEUE = 4, |
117 | | - /// Invalid event |
118 | | - OL_ERRC_INVALID_EVENT = 5, |
119 | | - /// Named kernel not found in the program binary |
120 | | - OL_ERRC_INVALID_KERNEL_NAME = 6, |
121 | | - /// Out of resources |
122 | | - OL_ERRC_OUT_OF_RESOURCES = 7, |
123 | | - /// generic error code for unsupported features |
124 | | - OL_ERRC_UNSUPPORTED_FEATURE = 8, |
125 | | - /// generic error code for invalid arguments |
126 | | - OL_ERRC_INVALID_ARGUMENT = 9, |
127 | | - /// handle argument is not valid |
128 | | - OL_ERRC_INVALID_NULL_HANDLE = 10, |
129 | | - /// pointer argument may not be nullptr |
130 | | - OL_ERRC_INVALID_NULL_POINTER = 11, |
131 | | - /// invalid size or dimensions (e.g., must not be zero, or is out of bounds) |
132 | | - OL_ERRC_INVALID_SIZE = 12, |
133 | | - /// enumerator argument is not valid |
134 | | - OL_ERRC_INVALID_ENUMERATION = 13, |
135 | | - /// enumerator argument is not supported by the device |
136 | | - OL_ERRC_UNSUPPORTED_ENUMERATION = 14, |
137 | | - /// Unknown or internal error |
138 | | - OL_ERRC_UNKNOWN = 15, |
139 | | - /// @cond |
140 | | - OL_ERRC_FORCE_UINT32 = 0x7fffffff |
141 | | - /// @endcond |
142 | | - |
143 | | -} ol_errc_t; |
144 | | - |
145 | 143 | /////////////////////////////////////////////////////////////////////////////// |
146 | 144 | /// @brief Details of the error condition returned by an API call |
147 | 145 | typedef struct ol_error_struct_t { |
@@ -477,7 +475,8 @@ OL_APIEXPORT ol_result_t OL_APICALL olMemFree( |
477 | 475 | /// @brief Enqueue a memcpy operation. |
478 | 476 | /// |
479 | 477 | /// @details |
480 | | -/// - For host pointers, use the device returned by olGetHostDevice |
| 478 | +/// - For host pointers, use the host device belonging to the |
| 479 | +/// OL_PLATFORM_BACKEND_HOST platform. |
481 | 480 | /// - If a queue is specified, at least one device must be a non-host device |
482 | 481 | /// - If a queue is not specified, the memcpy happens synchronously |
483 | 482 | /// |
|
0 commit comments