99// ===----------------------------------------------------------------------===//
1010
1111#include " command_buffer.hpp"
12+ #include " adapter.hpp"
1213#include " common.hpp"
1314#include " context.hpp"
1415#include " event.hpp"
@@ -25,7 +26,8 @@ ur_exp_command_buffer_handle_t_::~ur_exp_command_buffer_handle_t_() {
2526 cl_ext::clReleaseCommandBufferKHR_fn clReleaseCommandBufferKHR = nullptr ;
2627 cl_int Res =
2728 cl_ext::getExtFuncFromContext<decltype (clReleaseCommandBufferKHR)>(
28- CLContext, cl_ext::ExtFuncPtrCache->clReleaseCommandBufferKHRCache ,
29+ CLContext,
30+ ur::cl::getAdapter ()->fnCache .clReleaseCommandBufferKHRCache ,
2931 cl_ext::ReleaseCommandBufferName, &clReleaseCommandBufferKHR);
3032 assert (Res == CL_SUCCESS);
3133 (void )Res;
@@ -42,7 +44,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
4244 cl_ext::clCreateCommandBufferKHR_fn clCreateCommandBufferKHR = nullptr ;
4345 UR_RETURN_ON_FAILURE (
4446 cl_ext::getExtFuncFromContext<decltype (clCreateCommandBufferKHR)>(
45- CLContext, cl_ext::ExtFuncPtrCache->clCreateCommandBufferKHRCache ,
47+ CLContext,
48+ ur::cl::getAdapter ()->fnCache .clCreateCommandBufferKHRCache ,
4649 cl_ext::CreateCommandBufferName, &clCreateCommandBufferKHR));
4750
4851 const bool IsUpdatable = pCommandBufferDesc->isUpdatable ;
@@ -116,7 +119,8 @@ urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
116119 cl_ext::clFinalizeCommandBufferKHR_fn clFinalizeCommandBufferKHR = nullptr ;
117120 UR_RETURN_ON_FAILURE (
118121 cl_ext::getExtFuncFromContext<decltype (clFinalizeCommandBufferKHR)>(
119- CLContext, cl_ext::ExtFuncPtrCache->clFinalizeCommandBufferKHRCache ,
122+ CLContext,
123+ ur::cl::getAdapter ()->fnCache .clFinalizeCommandBufferKHRCache ,
120124 cl_ext::FinalizeCommandBufferName, &clFinalizeCommandBufferKHR));
121125
122126 CL_RETURN_ON_FAILURE (
@@ -148,7 +152,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
148152 cl_ext::clCommandNDRangeKernelKHR_fn clCommandNDRangeKernelKHR = nullptr ;
149153 UR_RETURN_ON_FAILURE (
150154 cl_ext::getExtFuncFromContext<decltype (clCommandNDRangeKernelKHR)>(
151- CLContext, cl_ext::ExtFuncPtrCache->clCommandNDRangeKernelKHRCache ,
155+ CLContext,
156+ ur::cl::getAdapter ()->fnCache .clCommandNDRangeKernelKHRCache ,
152157 cl_ext::CommandNRRangeKernelName, &clCommandNDRangeKernelKHR));
153158
154159 cl_mutable_command_khr CommandHandle = nullptr ;
@@ -238,7 +243,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp(
238243 cl_ext::clCommandCopyBufferKHR_fn clCommandCopyBufferKHR = nullptr ;
239244 UR_RETURN_ON_FAILURE (
240245 cl_ext::getExtFuncFromContext<decltype (clCommandCopyBufferKHR)>(
241- CLContext, cl_ext::ExtFuncPtrCache-> clCommandCopyBufferKHRCache ,
246+ CLContext, ur::cl::getAdapter ()-> fnCache . clCommandCopyBufferKHRCache ,
242247 cl_ext::CommandCopyBufferName, &clCommandCopyBufferKHR));
243248
244249 const bool IsInOrder = hCommandBuffer->IsInOrder ;
@@ -280,7 +285,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp(
280285 cl_ext::clCommandCopyBufferRectKHR_fn clCommandCopyBufferRectKHR = nullptr ;
281286 UR_RETURN_ON_FAILURE (
282287 cl_ext::getExtFuncFromContext<decltype (clCommandCopyBufferRectKHR)>(
283- CLContext, cl_ext::ExtFuncPtrCache->clCommandCopyBufferRectKHRCache ,
288+ CLContext,
289+ ur::cl::getAdapter ()->fnCache .clCommandCopyBufferRectKHRCache ,
284290 cl_ext::CommandCopyBufferRectName, &clCommandCopyBufferRectKHR));
285291
286292 const bool IsInOrder = hCommandBuffer->IsInOrder ;
@@ -388,7 +394,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp(
388394 cl_ext::clCommandFillBufferKHR_fn clCommandFillBufferKHR = nullptr ;
389395 UR_RETURN_ON_FAILURE (
390396 cl_ext::getExtFuncFromContext<decltype (clCommandFillBufferKHR)>(
391- CLContext, cl_ext::ExtFuncPtrCache-> clCommandFillBufferKHRCache ,
397+ CLContext, ur::cl::getAdapter ()-> fnCache . clCommandFillBufferKHRCache ,
392398 cl_ext::CommandFillBufferName, &clCommandFillBufferKHR));
393399
394400 const bool IsInOrder = hCommandBuffer->IsInOrder ;
@@ -459,7 +465,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCommandBufferExp(
459465 cl_ext::clEnqueueCommandBufferKHR_fn clEnqueueCommandBufferKHR = nullptr ;
460466 UR_RETURN_ON_FAILURE (
461467 cl_ext::getExtFuncFromContext<decltype (clEnqueueCommandBufferKHR)>(
462- CLContext, cl_ext::ExtFuncPtrCache->clEnqueueCommandBufferKHRCache ,
468+ CLContext,
469+ ur::cl::getAdapter ()->fnCache .clEnqueueCommandBufferKHRCache ,
463470 cl_ext::EnqueueCommandBufferName, &clEnqueueCommandBufferKHR));
464471
465472 const uint32_t NumberOfQueues = 1 ;
@@ -618,7 +625,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
618625 cl_ext::clUpdateMutableCommandsKHR_fn clUpdateMutableCommandsKHR = nullptr ;
619626 UR_RETURN_ON_FAILURE (
620627 cl_ext::getExtFuncFromContext<decltype (clUpdateMutableCommandsKHR)>(
621- CLContext, cl_ext::ExtFuncPtrCache->clUpdateMutableCommandsKHRCache ,
628+ CLContext,
629+ ur::cl::getAdapter ()->fnCache .clUpdateMutableCommandsKHRCache ,
622630 cl_ext::UpdateMutableCommandsName, &clUpdateMutableCommandsKHR));
623631
624632 std::vector<cl_mutable_dispatch_config_khr> ConfigList (numKernelUpdates);
@@ -754,7 +762,7 @@ ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp(
754762 UR_RETURN_ON_FAILURE (
755763 cl_ext::getExtFuncFromContext<decltype (clCommandBarrierWithWaitListKHR)>(
756764 CLContext,
757- cl_ext::ExtFuncPtrCache-> clCommandBarrierWithWaitListKHRCache ,
765+ ur::cl::getAdapter ()-> fnCache . clCommandBarrierWithWaitListKHRCache ,
758766 cl_ext::CommandBarrierWithWaitListName,
759767 &clCommandBarrierWithWaitListKHR));
760768
0 commit comments