diff --git a/sycl/include/sycl/detail/pi.h b/sycl/include/sycl/detail/pi.h index f6ee364c17a23..3c9076e09f66b 100644 --- a/sycl/include/sycl/detail/pi.h +++ b/sycl/include/sycl/detail/pi.h @@ -155,9 +155,10 @@ // 15.45 Added piextKernelSuggestMaxCooperativeGroupCount and // piextEnqueueCooperativeKernelLaunch. // 15.46 Add piextGetGlobalVariablePointer +// 15.47 Added PI_ERROR_FEATURE_UNSUPPORTED. #define _PI_H_VERSION_MAJOR 15 -#define _PI_H_VERSION_MINOR 46 +#define _PI_H_VERSION_MINOR 47 #define _PI_STRING_HELPER(a) #a #define _PI_CONCAT(a, b) _PI_STRING_HELPER(a.b) diff --git a/sycl/include/sycl/detail/pi_error.def b/sycl/include/sycl/detail/pi_error.def index d6651b53fccf1..e58cd52032b60 100644 --- a/sycl/include/sycl/detail/pi_error.def +++ b/sycl/include/sycl/detail/pi_error.def @@ -101,6 +101,9 @@ _PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL, -1101) _PI_ERRC(PI_ERROR_UNINITIALIZED, -1102) // PI specific error codes +// PI_ERROR_UNSUPPORTED_FEATURE indicates that the backend or the corresponding +// device does not support the feature. +_PI_ERRC_WITH_MSG(PI_ERROR_UNSUPPORTED_FEATURE, -995, "The plugin or device does not support the called function") // PI_ERROR_PLUGIN_SPECIFIC_ERROR indicates that an backend spcific error or // warning has been emitted by the plugin. _PI_ERRC_WITH_MSG(PI_ERROR_PLUGIN_SPECIFIC_ERROR, -996, "The plugin has emitted a backend specific error") diff --git a/sycl/plugins/native_cpu/pi_native_cpu.cpp b/sycl/plugins/native_cpu/pi_native_cpu.cpp index 01b6dee1bb0f2..5174456e95a77 100644 --- a/sycl/plugins/native_cpu/pi_native_cpu.cpp +++ b/sycl/plugins/native_cpu/pi_native_cpu.cpp @@ -1266,13 +1266,13 @@ pi_result piextEnqueueCooperativeKernelLaunch( const size_t *, const size_t *, const size_t *, pi_uint32 , const pi_event *, pi_event *) { - return PI_ERROR_INVALID_OPERATION; + return PI_ERROR_UNSUPPORTED_FEATURE; } pi_result piextKernelSuggestMaxCooperativeGroupCount( pi_kernel , size_t , size_t , pi_uint32 *) { - return PI_ERROR_INVALID_OPERATION; + return PI_ERROR_UNSUPPORTED_FEATURE; } // Initialize function table with stubs. diff --git a/sycl/plugins/unified_runtime/pi2ur.hpp b/sycl/plugins/unified_runtime/pi2ur.hpp index f1eb777046a90..14b7b4723c0dc 100644 --- a/sycl/plugins/unified_runtime/pi2ur.hpp +++ b/sycl/plugins/unified_runtime/pi2ur.hpp @@ -100,8 +100,9 @@ static pi_result ur2piResult(ur_result_t urResult) { case UR_RESULT_ERROR_PROGRAM_LINK_FAILURE: return PI_ERROR_LINK_PROGRAM_FAILURE; case UR_RESULT_ERROR_UNSUPPORTED_VERSION: - case UR_RESULT_ERROR_UNSUPPORTED_FEATURE: return PI_ERROR_INVALID_OPERATION; + case UR_RESULT_ERROR_UNSUPPORTED_FEATURE: + return PI_ERROR_UNSUPPORTED_FEATURE; case UR_RESULT_ERROR_INVALID_ARGUMENT: case UR_RESULT_ERROR_INVALID_NULL_HANDLE: case UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE: diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index 527297aa32371..c0af141935bd5 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -1533,7 +1533,7 @@ void MemoryManager::ext_oneapi_copyD2H_cmd_buffer( SrcXOffBytes, SrcAccessRangeWidthBytes, DstMem + DstXOffBytes, Deps.size(), Deps.data(), OutSyncPoint); - if (Result == PI_ERROR_INVALID_OPERATION) { + if (Result == PI_ERROR_UNSUPPORTED_FEATURE) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Device-to-host buffer copy command not supported by graph backend"); @@ -1563,7 +1563,7 @@ void MemoryManager::ext_oneapi_copyD2H_cmd_buffer( &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, DstMem, Deps.size(), Deps.data(), OutSyncPoint); - if (Result == PI_ERROR_INVALID_OPERATION) { + if (Result == PI_ERROR_UNSUPPORTED_FEATURE) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Device-to-host buffer copy command not supported by graph backend"); @@ -1610,7 +1610,7 @@ void MemoryManager::ext_oneapi_copyH2D_cmd_buffer( DstXOffBytes, DstAccessRangeWidthBytes, SrcMem + SrcXOffBytes, Deps.size(), Deps.data(), OutSyncPoint); - if (Result == PI_ERROR_INVALID_OPERATION) { + if (Result == PI_ERROR_UNSUPPORTED_FEATURE) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Host-to-device buffer copy command not supported by graph backend"); @@ -1641,7 +1641,7 @@ void MemoryManager::ext_oneapi_copyH2D_cmd_buffer( BufferSlicePitch, HostRowPitch, HostSlicePitch, SrcMem, Deps.size(), Deps.data(), OutSyncPoint); - if (Result == PI_ERROR_INVALID_OPERATION) { + if (Result == PI_ERROR_UNSUPPORTED_FEATURE) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Host-to-device buffer copy command not supported by graph backend"); @@ -1665,7 +1665,7 @@ void MemoryManager::ext_oneapi_copy_usm_cmd_buffer( Plugin->call_nocheck( CommandBuffer, DstMem, SrcMem, Len, Deps.size(), Deps.data(), OutSyncPoint); - if (Result == PI_ERROR_INVALID_OPERATION) { + if (Result == PI_ERROR_UNSUPPORTED_FEATURE) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "USM copy command not supported by graph backend"); diff --git a/sycl/source/detail/sampler_impl.cpp b/sycl/source/detail/sampler_impl.cpp index 78473d87b3689..c2af7884a164c 100644 --- a/sycl/source/detail/sampler_impl.cpp +++ b/sycl/source/detail/sampler_impl.cpp @@ -73,7 +73,7 @@ sampler_impl::getOrCreateSampler(const context &Context) { errcode_ret = Plugin->call_nocheck( getSyclObjImpl(Context)->getHandleRef(), sprops, &resultSampler); - if (errcode_ret == PI_ERROR_INVALID_OPERATION) + if (errcode_ret == PI_ERROR_UNSUPPORTED_FEATURE) throw sycl::exception(sycl::errc::feature_not_supported, "Images are not supported by this device.");