Skip to content

Commit c73d006

Browse files
committed
[OpenCL] Add Command Buffer extension to OpenCL adapter.
1 parent 192e940 commit c73d006

File tree

5 files changed

+310
-73
lines changed

5 files changed

+310
-73
lines changed

source/adapters/opencl/command_buffer.cpp

Lines changed: 208 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -11,58 +11,118 @@
1111
#include "command_buffer.hpp"
1212
#include "common.hpp"
1313

14-
/// Stub implementations of UR experimental feature command-buffers
15-
1614
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
17-
[[maybe_unused]] ur_context_handle_t hContext,
18-
[[maybe_unused]] ur_device_handle_t hDevice,
15+
ur_context_handle_t hContext, ur_device_handle_t hDevice,
1916
[[maybe_unused]] const ur_exp_command_buffer_desc_t *pCommandBufferDesc,
20-
[[maybe_unused]] ur_exp_command_buffer_handle_t *phCommandBuffer) {
17+
ur_exp_command_buffer_handle_t *phCommandBuffer) {
2118

22-
cl_adapter::die("Experimental Command-buffer feature is not "
23-
"implemented for OpenCL adapter.");
24-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
19+
ur_queue_handle_t Queue = nullptr;
20+
UR_RETURN_ON_FAILURE(urQueueCreate(hContext, hDevice, nullptr, &Queue));
21+
22+
cl_context CLContext = cl_adapter::cast<cl_context>(hContext);
23+
cl_ext::clCreateCommandBufferKHR_fn clCreateCommandBufferKHR = nullptr;
24+
cl_int Res =
25+
cl_ext::getExtFuncFromContext<decltype(clCreateCommandBufferKHR)>(
26+
CLContext, cl_ext::ExtFuncPtrCache->clCreateCommandBufferKHRCache,
27+
cl_ext::CreateCommandBufferName, &clCreateCommandBufferKHR);
28+
29+
if (!clCreateCommandBufferKHR || Res != CL_SUCCESS)
30+
return UR_RESULT_ERROR_INVALID_OPERATION;
31+
32+
auto CLCommandBuffer = clCreateCommandBufferKHR(
33+
1, cl_adapter::cast<cl_command_queue *>(&Queue), nullptr, &Res);
34+
CL_RETURN_ON_FAILURE_AND_SET_NULL(Res, phCommandBuffer);
35+
36+
try {
37+
auto URCommandBuffer = std::make_unique<ur_exp_command_buffer_handle_t_>(
38+
Queue, hContext, CLCommandBuffer);
39+
*phCommandBuffer = URCommandBuffer.release();
40+
} catch (...) {
41+
return UR_RESULT_ERROR_OUT_OF_RESOURCES;
42+
}
43+
44+
CL_RETURN_ON_FAILURE(Res);
45+
return UR_RESULT_SUCCESS;
2546
}
2647

27-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferRetainExp(
28-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) {
48+
UR_APIEXPORT ur_result_t UR_APICALL
49+
urCommandBufferRetainExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
50+
UR_RETURN_ON_FAILURE(urQueueRetain(hCommandBuffer->hInternalQueue));
2951

30-
cl_adapter::die("Experimental Command-buffer feature is not "
31-
"implemented for OpenCL adapter.");
32-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
52+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
53+
cl_ext::clRetainCommandBufferKHR_fn clRetainCommandBuffer = nullptr;
54+
cl_int Res = cl_ext::getExtFuncFromContext<decltype(clRetainCommandBuffer)>(
55+
CLContext, cl_ext::ExtFuncPtrCache->clRetainCommandBufferKHRCache,
56+
cl_ext::RetainCommandBufferName, &clRetainCommandBuffer);
57+
58+
if (!clRetainCommandBuffer || Res != CL_SUCCESS)
59+
return UR_RESULT_ERROR_INVALID_OPERATION;
60+
61+
CL_RETURN_ON_FAILURE(clRetainCommandBuffer(hCommandBuffer->CLCommandBuffer));
62+
return UR_RESULT_SUCCESS;
3363
}
3464

35-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferReleaseExp(
36-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) {
65+
UR_APIEXPORT ur_result_t UR_APICALL
66+
urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
67+
UR_RETURN_ON_FAILURE(urQueueRelease(hCommandBuffer->hInternalQueue));
3768

38-
cl_adapter::die("Experimental Command-buffer feature is not "
39-
"implemented for OpenCL adapter.");
40-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
69+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
70+
cl_ext::clReleaseCommandBufferKHR_fn clReleaseCommandBufferKHR = nullptr;
71+
cl_int Res =
72+
cl_ext::getExtFuncFromContext<decltype(clReleaseCommandBufferKHR)>(
73+
CLContext, cl_ext::ExtFuncPtrCache->clReleaseCommandBufferKHRCache,
74+
cl_ext::ReleaseCommandBufferName, &clReleaseCommandBufferKHR);
75+
76+
if (!clReleaseCommandBufferKHR || Res != CL_SUCCESS)
77+
return UR_RESULT_ERROR_INVALID_OPERATION;
78+
79+
CL_RETURN_ON_FAILURE(
80+
clReleaseCommandBufferKHR(hCommandBuffer->CLCommandBuffer));
81+
return UR_RESULT_SUCCESS;
4182
}
4283

43-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferFinalizeExp(
44-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer) {
84+
UR_APIEXPORT ur_result_t UR_APICALL
85+
urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
86+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
87+
cl_ext::clFinalizeCommandBufferKHR_fn clFinalizeCommandBufferKHR = nullptr;
88+
cl_int Res =
89+
cl_ext::getExtFuncFromContext<decltype(clFinalizeCommandBufferKHR)>(
90+
CLContext, cl_ext::ExtFuncPtrCache->clFinalizeCommandBufferKHRCache,
91+
cl_ext::FinalizeCommandBufferName, &clFinalizeCommandBufferKHR);
4592

46-
cl_adapter::die("Experimental Command-buffer feature is not "
47-
"implemented for OpenCL adapter.");
48-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
93+
if (!clFinalizeCommandBufferKHR || Res != CL_SUCCESS)
94+
return UR_RESULT_ERROR_INVALID_OPERATION;
95+
96+
CL_RETURN_ON_FAILURE(
97+
clFinalizeCommandBufferKHR(hCommandBuffer->CLCommandBuffer));
98+
return UR_RESULT_SUCCESS;
4999
}
50100

51101
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
52-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
53-
[[maybe_unused]] ur_kernel_handle_t hKernel,
54-
[[maybe_unused]] uint32_t workDim,
55-
[[maybe_unused]] const size_t *pGlobalWorkOffset,
56-
[[maybe_unused]] const size_t *pGlobalWorkSize,
57-
[[maybe_unused]] const size_t *pLocalWorkSize,
58-
[[maybe_unused]] uint32_t numSyncPointsInWaitList,
59-
[[maybe_unused]] const ur_exp_command_buffer_sync_point_t
60-
*pSyncPointWaitList,
61-
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
102+
ur_exp_command_buffer_handle_t hCommandBuffer, ur_kernel_handle_t hKernel,
103+
uint32_t workDim, const size_t *pGlobalWorkOffset,
104+
const size_t *pGlobalWorkSize, const size_t *pLocalWorkSize,
105+
uint32_t numSyncPointsInWaitList,
106+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
107+
ur_exp_command_buffer_sync_point_t *pSyncPoint) {
62108

63-
cl_adapter::die("Experimental Command-buffer feature is not "
64-
"implemented for OpenCL adapter.");
65-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
109+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
110+
cl_ext::clCommandNDRangeKernelKHR_fn clCommandNDRangeKernelKHR = nullptr;
111+
cl_int Res =
112+
cl_ext::getExtFuncFromContext<decltype(clCommandNDRangeKernelKHR)>(
113+
CLContext, cl_ext::ExtFuncPtrCache->clCommandNDRangeKernelKHRCache,
114+
cl_ext::CommandNRRangeKernelName, &clCommandNDRangeKernelKHR);
115+
116+
if (!clCommandNDRangeKernelKHR || Res != CL_SUCCESS)
117+
return UR_RESULT_ERROR_INVALID_OPERATION;
118+
119+
CL_RETURN_ON_FAILURE(clCommandNDRangeKernelKHR(
120+
hCommandBuffer->CLCommandBuffer, nullptr, nullptr,
121+
cl_adapter::cast<cl_kernel>(hKernel), workDim, pGlobalWorkOffset,
122+
pGlobalWorkSize, pLocalWorkSize, numSyncPointsInWaitList,
123+
pSyncPointWaitList, pSyncPoint, nullptr));
124+
125+
return UR_RESULT_SUCCESS;
66126
}
67127

68128
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp(
@@ -74,43 +134,82 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp(
74134
*pSyncPointWaitList,
75135
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
76136

77-
cl_adapter::die("Experimental Command-buffer feature is not "
137+
cl_adapter::die("Experimental Command-buffer entry point is not "
78138
"implemented for OpenCL adapter.");
79139
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
80140
}
81141

82-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp(
142+
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp(
83143
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
84-
[[maybe_unused]] ur_mem_handle_t hSrcMem,
85-
[[maybe_unused]] ur_mem_handle_t hDstMem, [[maybe_unused]] size_t srcOffset,
86-
[[maybe_unused]] size_t dstOffset, [[maybe_unused]] size_t size,
144+
[[maybe_unused]] void *pMemory, [[maybe_unused]] const void *pPattern,
145+
[[maybe_unused]] size_t patternSize, [[maybe_unused]] size_t size,
87146
[[maybe_unused]] uint32_t numSyncPointsInWaitList,
88147
[[maybe_unused]] const ur_exp_command_buffer_sync_point_t
89148
*pSyncPointWaitList,
90149
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
91-
92-
cl_adapter::die("Experimental Command-buffer feature is not "
150+
cl_adapter::die("Experimental Command-buffer entry point is not "
93151
"implemented for OpenCL adapter.");
94152
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
95153
}
96154

155+
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp(
156+
ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hSrcMem,
157+
ur_mem_handle_t hDstMem, size_t srcOffset, size_t dstOffset, size_t size,
158+
uint32_t numSyncPointsInWaitList,
159+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
160+
ur_exp_command_buffer_sync_point_t *pSyncPoint) {
161+
162+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
163+
cl_ext::clCommandCopyBufferKHR_fn clCommandCopyBufferKHR = nullptr;
164+
cl_int Res = cl_ext::getExtFuncFromContext<decltype(clCommandCopyBufferKHR)>(
165+
CLContext, cl_ext::ExtFuncPtrCache->clCommandCopyBufferKHRCache,
166+
cl_ext::CommandCopyBufferName, &clCommandCopyBufferKHR);
167+
168+
if (!clCommandCopyBufferKHR || Res != CL_SUCCESS)
169+
return UR_RESULT_ERROR_INVALID_OPERATION;
170+
171+
CL_RETURN_ON_FAILURE(clCommandCopyBufferKHR(
172+
hCommandBuffer->CLCommandBuffer,
173+
nullptr,
174+
cl_adapter::cast<cl_mem>(hSrcMem), cl_adapter::cast<cl_mem>(hDstMem),
175+
srcOffset, dstOffset, size, numSyncPointsInWaitList, pSyncPointWaitList,
176+
pSyncPoint, nullptr));
177+
178+
return UR_RESULT_SUCCESS;
179+
}
180+
97181
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp(
98-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
99-
[[maybe_unused]] ur_mem_handle_t hSrcMem,
100-
[[maybe_unused]] ur_mem_handle_t hDstMem,
101-
[[maybe_unused]] ur_rect_offset_t srcOrigin,
102-
[[maybe_unused]] ur_rect_offset_t dstOrigin,
103-
[[maybe_unused]] ur_rect_region_t region,
104-
[[maybe_unused]] size_t srcRowPitch, [[maybe_unused]] size_t srcSlicePitch,
105-
[[maybe_unused]] size_t dstRowPitch, [[maybe_unused]] size_t dstSlicePitch,
106-
[[maybe_unused]] uint32_t numSyncPointsInWaitList,
107-
[[maybe_unused]] const ur_exp_command_buffer_sync_point_t
108-
*pSyncPointWaitList,
109-
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
182+
ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hSrcMem,
183+
ur_mem_handle_t hDstMem, ur_rect_offset_t srcOrigin,
184+
ur_rect_offset_t dstOrigin, ur_rect_region_t region, size_t srcRowPitch,
185+
size_t srcSlicePitch, size_t dstRowPitch, size_t dstSlicePitch,
186+
uint32_t numSyncPointsInWaitList,
187+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
188+
ur_exp_command_buffer_sync_point_t *pSyncPoint) {
110189

111-
cl_adapter::die("Experimental Command-buffer feature is not "
112-
"implemented for OpenCL adapter.");
113-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
190+
size_t OpenCLOriginRect[3]{srcOrigin.x, srcOrigin.y, srcOrigin.z};
191+
size_t OpenCLDstRect[3]{dstOrigin.x, dstOrigin.y, dstOrigin.z};
192+
size_t OpenCLRegion[3]{region.width, region.height, region.depth};
193+
194+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
195+
cl_ext::clCommandCopyBufferRectKHR_fn clCommandCopyBufferRectKHR = nullptr;
196+
cl_int Res =
197+
cl_ext::getExtFuncFromContext<decltype(clCommandCopyBufferRectKHR)>(
198+
CLContext, cl_ext::ExtFuncPtrCache->clCommandCopyBufferRectKHRCache,
199+
cl_ext::CommandCopyBufferRectName, &clCommandCopyBufferRectKHR);
200+
201+
if (!clCommandCopyBufferRectKHR || Res != CL_SUCCESS)
202+
return UR_RESULT_ERROR_INVALID_OPERATION;
203+
204+
CL_RETURN_ON_FAILURE(clCommandCopyBufferRectKHR(
205+
hCommandBuffer->CLCommandBuffer,
206+
nullptr,
207+
cl_adapter::cast<cl_mem>(hSrcMem), cl_adapter::cast<cl_mem>(hDstMem),
208+
OpenCLOriginRect, OpenCLDstRect, OpenCLRegion, srcRowPitch, srcSlicePitch,
209+
dstRowPitch, dstSlicePitch, numSyncPointsInWaitList, pSyncPointWaitList,
210+
pSyncPoint, nullptr));
211+
212+
return UR_RESULT_SUCCESS;
114213
}
115214

116215
UR_APIEXPORT
@@ -123,7 +222,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp(
123222
*pSyncPointWaitList,
124223
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
125224

126-
cl_adapter::die("Experimental Command-buffer feature is not "
225+
cl_adapter::die("Experimental Command-buffer entry point is not "
127226
"implemented for OpenCL adapter.");
128227
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
129228
}
@@ -138,7 +237,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp(
138237
*pSyncPointWaitList,
139238
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
140239

141-
cl_adapter::die("Experimental Command-buffer feature is not "
240+
cl_adapter::die("Experimental Command-buffer entry point is not "
142241
"implemented for OpenCL adapter.");
143242
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
144243
}
@@ -159,7 +258,7 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp(
159258
*pSyncPointWaitList,
160259
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
161260

162-
cl_adapter::die("Experimental Command-buffer feature is not "
261+
cl_adapter::die("Experimental Command-buffer entry point is not "
163262
"implemented for OpenCL adapter.");
164263
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
165264
}
@@ -180,19 +279,58 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp(
180279
*pSyncPointWaitList,
181280
[[maybe_unused]] ur_exp_command_buffer_sync_point_t *pSyncPoint) {
182281

183-
cl_adapter::die("Experimental Command-buffer feature is not "
282+
cl_adapter::die("Experimental Command-buffer entry point is not "
184283
"implemented for OpenCL adapter.");
185284
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
186285
}
187286

287+
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferFillExp(
288+
ur_exp_command_buffer_handle_t hCommandBuffer, ur_mem_handle_t hBuffer,
289+
const void *pPattern, size_t patternSize, size_t offset, size_t size,
290+
uint32_t numSyncPointsInWaitList,
291+
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
292+
ur_exp_command_buffer_sync_point_t *pSyncPoint) {
293+
294+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
295+
cl_ext::clCommandFillBufferKHR_fn clCommandFillBufferKHR = nullptr;
296+
cl_int Res = cl_ext::getExtFuncFromContext<decltype(clCommandFillBufferKHR)>(
297+
CLContext, cl_ext::ExtFuncPtrCache->clCommandFillBufferKHRCache,
298+
cl_ext::CommandFillBufferName, &clCommandFillBufferKHR);
299+
300+
if (!clCommandFillBufferKHR || Res != CL_SUCCESS)
301+
return UR_RESULT_ERROR_INVALID_OPERATION;
302+
303+
CL_RETURN_ON_FAILURE(clCommandFillBufferKHR(
304+
hCommandBuffer->CLCommandBuffer,
305+
nullptr,
306+
cl_adapter::cast<cl_mem>(hBuffer), pPattern, patternSize, offset, size,
307+
numSyncPointsInWaitList, pSyncPointWaitList, pSyncPoint, nullptr));
308+
309+
return UR_RESULT_SUCCESS;
310+
}
311+
188312
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
189-
[[maybe_unused]] ur_exp_command_buffer_handle_t hCommandBuffer,
190-
[[maybe_unused]] ur_queue_handle_t hQueue,
191-
[[maybe_unused]] uint32_t numEventsInWaitList,
192-
[[maybe_unused]] const ur_event_handle_t *phEventWaitList,
193-
[[maybe_unused]] ur_event_handle_t *phEvent) {
313+
ur_exp_command_buffer_handle_t hCommandBuffer, ur_queue_handle_t hQueue,
314+
uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
315+
ur_event_handle_t *phEvent) {
194316

195-
cl_adapter::die("Experimental Command-buffer feature is not "
196-
"implemented for OpenCL adapter.");
197-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
317+
cl_context CLContext = cl_adapter::cast<cl_context>(hCommandBuffer->hContext);
318+
cl_ext::clEnqueueCommandBufferKHR_fn clEnqueueCommandBufferKHR = nullptr;
319+
cl_int Res =
320+
cl_ext::getExtFuncFromContext<decltype(clEnqueueCommandBufferKHR)>(
321+
CLContext, cl_ext::ExtFuncPtrCache->clEnqueueCommandBufferKHRCache,
322+
cl_ext::EnqueueCommandBufferName, &clEnqueueCommandBufferKHR);
323+
324+
if (!clEnqueueCommandBufferKHR || Res != CL_SUCCESS)
325+
return UR_RESULT_ERROR_INVALID_OPERATION;
326+
327+
const uint32_t NumberOfQueues = 1;
328+
329+
CL_RETURN_ON_FAILURE(clEnqueueCommandBufferKHR(
330+
NumberOfQueues, cl_adapter::cast<cl_command_queue *>(&hQueue),
331+
hCommandBuffer->CLCommandBuffer, numEventsInWaitList,
332+
cl_adapter::cast<const cl_event *>(phEventWaitList),
333+
cl_adapter::cast<cl_event *>(phEvent)));
334+
335+
return UR_RESULT_SUCCESS;
198336
}

source/adapters/opencl/command_buffer.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88
//
99
//===----------------------------------------------------------------------===//
1010

11+
#include <CL/cl_ext.h>
1112
#include <ur/ur.hpp>
1213

13-
/// Stub implementation of command-buffers for OpenCL
14+
struct ur_exp_command_buffer_handle_t_ {
15+
ur_queue_handle_t hInternalQueue;
16+
ur_context_handle_t hContext;
17+
cl_command_buffer_khr CLCommandBuffer;
1418

15-
struct ur_exp_command_buffer_handle_t_ {};
19+
ur_exp_command_buffer_handle_t_(ur_queue_handle_t hQueue,
20+
ur_context_handle_t hContext,
21+
cl_command_buffer_khr CLCommandBuffer)
22+
: hInternalQueue(hQueue), hContext(hContext),
23+
CLCommandBuffer(CLCommandBuffer) {}
24+
};

source/adapters/opencl/common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
7777
return UR_RESULT_ERROR_PROGRAM_LINK_FAILURE;
7878
case CL_INVALID_ARG_INDEX:
7979
return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX;
80+
case CL_INVALID_COMMAND_BUFFER_KHR:
81+
return UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP;
82+
case CL_INVALID_SYNC_POINT_WAIT_LIST_KHR:
83+
return UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP;
8084
default:
8185
return UR_RESULT_ERROR_UNKNOWN;
8286
}

0 commit comments

Comments
 (0)