|
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 | + /// A pointer argument is null when it should not be |
| 26 | + OL_ERRC_INVALID_NULL_POINTER = 1, |
| 27 | + /// An argument is invalid |
| 28 | + OL_ERRC_INVALID_ARGUMENT = 2, |
| 29 | + /// Out of resources |
| 30 | + OL_ERRC_OUT_OF_RESOURCES = 3, |
| 31 | + /// generic error code for unsupported features and enums |
| 32 | + OL_ERRC_UNSUPPORTED = 4, |
| 33 | + /// Invalid Value |
| 34 | + OL_ERRC_INVALID_VALUE = 4096, |
| 35 | + /// Invalid platform |
| 36 | + OL_ERRC_INVALID_PLATFORM = 4097, |
| 37 | + /// Invalid device |
| 38 | + OL_ERRC_INVALID_DEVICE = 4098, |
| 39 | + /// Invalid queue |
| 40 | + OL_ERRC_INVALID_QUEUE = 4099, |
| 41 | + /// Invalid event |
| 42 | + OL_ERRC_INVALID_EVENT = 4100, |
| 43 | + /// Named kernel not found in the program binary |
| 44 | + OL_ERRC_INVALID_KERNEL_NAME = 4101, |
| 45 | + /// handle argument is not valid |
| 46 | + OL_ERRC_INVALID_NULL_HANDLE = 4102, |
| 47 | + /// invalid size or dimensions (e.g., must not be zero, or is out of bounds) |
| 48 | + OL_ERRC_INVALID_SIZE = 4103, |
| 49 | + /// enumerator argument is not valid |
| 50 | + OL_ERRC_INVALID_ENUMERATION = 4104, |
| 51 | + /// Unknown or internal error |
| 52 | + OL_ERRC_UNKNOWN = 65536, |
| 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