@@ -315,6 +315,22 @@ typedef cl_int (CL_API_CALL* clGetCommandBufferInfoKHR_clextfn)(
315315#pragma message("Define for cl_khr_command_buffer was not found! Please update your headers.")
316316#endif // defined(cl_khr_command_buffer)
317317
318+ #if defined(cl_khr_command_buffer_multi_device)
319+
320+ typedef cl_command_buffer_khr (CL_API_CALL* clRemapCommandBufferKHR_clextfn)(
321+ cl_command_buffer_khr command_buffer,
322+ cl_bool automatic,
323+ cl_uint num_queues,
324+ const cl_command_queue* queues,
325+ cl_uint num_handles,
326+ const cl_mutable_command_khr* handles,
327+ cl_mutable_command_khr* handles_ret,
328+ cl_int* errcode_ret);
329+
330+ #else
331+ #pragma message("Define for cl_khr_command_buffer_multi_device was not found! Please update your headers.")
332+ #endif // defined(cl_khr_command_buffer_multi_device)
333+
318334#if defined(cl_khr_command_buffer_mutable_dispatch)
319335
320336typedef cl_int (CL_API_CALL* clUpdateMutableCommandsKHR_clextfn)(
@@ -1255,6 +1271,10 @@ struct openclext_dispatch_table {
12551271 clGetCommandBufferInfoKHR_clextfn clGetCommandBufferInfoKHR;
12561272#endif // defined(cl_khr_command_buffer)
12571273
1274+ #if defined(cl_khr_command_buffer_multi_device)
1275+ clRemapCommandBufferKHR_clextfn clRemapCommandBufferKHR;
1276+ #endif // defined(cl_khr_command_buffer_multi_device)
1277+
12581278#if defined(cl_khr_command_buffer_mutable_dispatch)
12591279 clUpdateMutableCommandsKHR_clextfn clUpdateMutableCommandsKHR;
12601280 clGetMutableCommandInfoKHR_clextfn clGetMutableCommandInfoKHR;
@@ -1517,6 +1537,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
15171537 CLEXT_GET_EXTENSION (clGetCommandBufferInfoKHR);
15181538#endif // defined(cl_khr_command_buffer)
15191539
1540+ #if defined(cl_khr_command_buffer_multi_device)
1541+ CLEXT_GET_EXTENSION (clRemapCommandBufferKHR);
1542+ #endif // defined(cl_khr_command_buffer_multi_device)
1543+
15201544#if defined(cl_khr_command_buffer_mutable_dispatch)
15211545 CLEXT_GET_EXTENSION (clUpdateMutableCommandsKHR);
15221546 CLEXT_GET_EXTENSION (clGetMutableCommandInfoKHR);
@@ -2369,6 +2393,36 @@ cl_int CL_API_CALL clGetCommandBufferInfoKHR(
23692393
23702394#endif // defined(cl_khr_command_buffer)
23712395
2396+ #if defined(cl_khr_command_buffer_multi_device)
2397+
2398+ cl_command_buffer_khr CL_API_CALL clRemapCommandBufferKHR (
2399+ cl_command_buffer_khr command_buffer,
2400+ cl_bool automatic,
2401+ cl_uint num_queues,
2402+ const cl_command_queue* queues,
2403+ cl_uint num_handles,
2404+ const cl_mutable_command_khr* handles,
2405+ cl_mutable_command_khr* handles_ret,
2406+ cl_int* errcode_ret)
2407+ {
2408+ struct openclext_dispatch_table * dispatch_ptr = _get_dispatch (command_buffer);
2409+ if (dispatch_ptr == nullptr || dispatch_ptr->clRemapCommandBufferKHR == nullptr ) {
2410+ if (errcode_ret) *errcode_ret = CL_INVALID_OPERATION;
2411+ return nullptr ;
2412+ }
2413+ return dispatch_ptr->clRemapCommandBufferKHR (
2414+ command_buffer,
2415+ automatic,
2416+ num_queues,
2417+ queues,
2418+ num_handles,
2419+ handles,
2420+ handles_ret,
2421+ errcode_ret);
2422+ }
2423+
2424+ #endif // defined(cl_khr_command_buffer_multi_device)
2425+
23722426#if defined(cl_khr_command_buffer_mutable_dispatch)
23732427
23742428cl_int CL_API_CALL clUpdateMutableCommandsKHR (
0 commit comments