@@ -83,7 +83,7 @@ inline ur_result_t mock_urDeviceGet(void *pParams) {
8383inline ur_result_t mock_urDeviceRetain (void *) { return UR_RESULT_SUCCESS; }
8484inline ur_result_t mock_urDeviceRelease (void *) { return UR_RESULT_SUCCESS; }
8585
86- template <ur_adapter_backend_t Backend>
86+ template <ur_backend_t Backend>
8787inline ur_result_t mock_urAdapterGetInfo (void *pParams) {
8888 auto params = reinterpret_cast <ur_adapter_get_info_params_t *>(pParams);
8989
@@ -100,7 +100,7 @@ inline ur_result_t mock_urAdapterGetInfo(void *pParams) {
100100 return UR_RESULT_SUCCESS;
101101}
102102
103- template <ur_platform_backend_t Backend>
103+ template <ur_backend_t Backend>
104104inline ur_result_t mock_urPlatformGetInfo (void *pParams) {
105105 auto params = reinterpret_cast <ur_platform_get_info_params_t *>(pParams);
106106 constexpr char MockPlatformName[] = " Mock platform" ;
@@ -518,16 +518,14 @@ template <sycl::backend Backend = backend::opencl> class UrMock {
518518#define ADD_DEFAULT_OVERRIDE (func_name, func_override ) \
519519 mock::getCallbacks ().set_replace_callback (#func_name, \
520520 &MockAdapter::func_override);
521- ADD_DEFAULT_OVERRIDE (
522- urAdapterGetInfo,
523- mock_urAdapterGetInfo<convertToUrAdapterBackend (Backend)>)
521+ ADD_DEFAULT_OVERRIDE (urAdapterGetInfo,
522+ mock_urAdapterGetInfo<convertToUrBackend (Backend)>)
524523 ADD_DEFAULT_OVERRIDE (urPlatformGet, mock_urPlatformGet)
525524 ADD_DEFAULT_OVERRIDE (urDeviceGet, mock_urDeviceGet)
526525 ADD_DEFAULT_OVERRIDE (urDeviceRetain, mock_urDeviceRetain)
527526 ADD_DEFAULT_OVERRIDE (urDeviceRelease, mock_urDeviceRelease)
528- ADD_DEFAULT_OVERRIDE (
529- urPlatformGetInfo,
530- mock_urPlatformGetInfo<convertToUrPlatformBackend (Backend)>)
527+ ADD_DEFAULT_OVERRIDE (urPlatformGetInfo,
528+ mock_urPlatformGetInfo<convertToUrBackend (Backend)>)
531529 ADD_DEFAULT_OVERRIDE (urDeviceGetInfo, mock_urDeviceGetInfo)
532530 ADD_DEFAULT_OVERRIDE (urProgramGetInfo, mock_urProgramGetInfo)
533531 ADD_DEFAULT_OVERRIDE (urContextGetInfo, mock_urContextGetInfo)
@@ -580,39 +578,21 @@ template <sycl::backend Backend = backend::opencl> class UrMock {
580578private:
581579 // These two helpers are needed to enable arbitrary backend selection
582580 // at compile time.
583- static constexpr ur_platform_backend_t
584- convertToUrPlatformBackend (const sycl::backend SyclBackend) {
581+ static constexpr ur_backend_t
582+ convertToUrBackend (const sycl::backend SyclBackend) {
585583 switch (SyclBackend) {
586584 case sycl::backend::opencl:
587- return UR_PLATFORM_BACKEND_OPENCL ;
585+ return UR_BACKEND_OPENCL ;
588586 case sycl::backend::ext_oneapi_level_zero:
589- return UR_PLATFORM_BACKEND_LEVEL_ZERO ;
587+ return UR_BACKEND_LEVEL_ZERO ;
590588 case sycl::backend::ext_oneapi_cuda:
591- return UR_PLATFORM_BACKEND_CUDA ;
589+ return UR_BACKEND_CUDA ;
592590 case sycl::backend::ext_oneapi_hip:
593- return UR_PLATFORM_BACKEND_HIP ;
591+ return UR_BACKEND_HIP ;
594592 case sycl::backend::ext_oneapi_native_cpu:
595- return UR_PLATFORM_BACKEND_NATIVE_CPU ;
593+ return UR_BACKEND_NATIVE_CPU ;
596594 default :
597- return UR_PLATFORM_BACKEND_UNKNOWN;
598- }
599- }
600-
601- static constexpr ur_adapter_backend_t
602- convertToUrAdapterBackend (sycl::backend SyclBackend) {
603- switch (SyclBackend) {
604- case sycl::backend::opencl:
605- return UR_ADAPTER_BACKEND_OPENCL;
606- case sycl::backend::ext_oneapi_level_zero:
607- return UR_ADAPTER_BACKEND_LEVEL_ZERO;
608- case sycl::backend::ext_oneapi_cuda:
609- return UR_ADAPTER_BACKEND_CUDA;
610- case sycl::backend::ext_oneapi_hip:
611- return UR_ADAPTER_BACKEND_HIP;
612- case sycl::backend::ext_oneapi_native_cpu:
613- return UR_ADAPTER_BACKEND_NATIVE_CPU;
614- default :
615- return UR_ADAPTER_BACKEND_UNKNOWN;
595+ return UR_BACKEND_UNKNOWN;
616596 }
617597 }
618598};
0 commit comments