From c9c70e23f0aaf4c51d62f91a83df4cc52bc5da59 Mon Sep 17 00:00:00 2001 From: Martin Morrison-Grant Date: Fri, 12 Jan 2024 15:10:33 +0000 Subject: [PATCH] Remove checking result of plugin calls for get info commands so exception isn't thrown. --- sycl/source/backend.cpp | 6 ------ sycl/source/backend/opencl.cpp | 4 ---- sycl/source/detail/buffer_impl.cpp | 4 ++-- .../detail/error_handling/error_handling.cpp | 6 ------ sycl/source/detail/event_impl.cpp | 2 +- sycl/source/detail/image_impl.cpp | 4 ---- sycl/source/detail/kernel_bundle_impl.hpp | 6 ------ sycl/source/detail/kernel_impl.cpp | 2 -- sycl/source/detail/kernel_info.hpp | 10 ---------- .../detail/persistent_device_code_cache.cpp | 8 +------- sycl/source/detail/platform_impl.cpp | 2 -- sycl/source/detail/platform_impl.hpp | 2 -- sycl/source/detail/platform_info.hpp | 4 ---- sycl/source/detail/program_impl.cpp | 20 +++---------------- .../program_manager/program_manager.cpp | 10 ---------- sycl/source/detail/queue_impl.cpp | 4 ---- sycl/source/detail/queue_impl.hpp | 2 -- sycl/source/detail/sampler_impl.cpp | 6 ------ sycl/source/detail/scheduler/commands.cpp | 4 ++-- sycl/source/detail/sycl_mem_obj_t.cpp | 8 -------- sycl/source/detail/usm/usm_impl.cpp | 2 -- sycl/source/device.cpp | 2 -- sycl/source/handler.cpp | 17 +++++++++------- sycl/source/interop_handle.cpp | 2 +- 24 files changed, 20 insertions(+), 117 deletions(-) diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index d6190f9a08a34..b202a4e793a4d 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -234,8 +234,6 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } ProgramDevices.resize(NumDevices); @@ -246,8 +244,6 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } for (const auto &Dev : ProgramDevices) { @@ -259,8 +255,6 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } switch (BinaryType) { diff --git a/sycl/source/backend/opencl.cpp b/sycl/source/backend/opencl.cpp index 009144930d357..e6ae502f4ab74 100644 --- a/sycl/source/backend/opencl.cpp +++ b/sycl/source/backend/opencl.cpp @@ -75,8 +75,6 @@ __SYCL_EXPORT bool has_extension(const sycl::platform &SyclPlatform, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } if (ResultSize == 0) return false; @@ -89,8 +87,6 @@ __SYCL_EXPORT bool has_extension(const sycl::platform &SyclPlatform, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } std::string_view ExtensionsString(Result.get()); diff --git a/sycl/source/detail/buffer_impl.cpp b/sycl/source/detail/buffer_impl.cpp index 4e48fffaa7d64..bb42773c027a4 100644 --- a/sycl/source/detail/buffer_impl.cpp +++ b/sycl/source/detail/buffer_impl.cpp @@ -88,8 +88,8 @@ buffer_impl::getNativeVector(backend BackendName) const { // resident on, so pass nullptr for Device param. Buffer interop may not be // supported by all backends. sycl::detail::pi::PiResult Result = - Plugin->call_nocheck(NativeMem, - &Handle); + Plugin->call_nocheck( + NativeMem, /*Dev*/ nullptr, &Handle); if (Result == PI_ERROR_INVALID_OPERATION) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), diff --git a/sycl/source/detail/error_handling/error_handling.cpp b/sycl/source/detail/error_handling/error_handling.cpp index 11cdfe6ab0aa3..d6702c96f28d2 100644 --- a/sycl/source/detail/error_handling/error_handling.cpp +++ b/sycl/source/detail/error_handling/error_handling.cpp @@ -210,8 +210,6 @@ void handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } size_t OptsSize = 0; @@ -222,8 +220,6 @@ void handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::string Opts(OptsSize, '\0'); @@ -234,8 +230,6 @@ void handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } const bool HasStd20 = Opts.find("-cl-std=CL2.0") != std::string::npos; diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index 2aa797ea87a05..9e8c2a31aca70 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -77,7 +77,7 @@ void event_impl::waitInternal(bool *Success) { (Error == PI_ERROR_UNKNOWN || Error == PI_ERROR_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)) { *Success = false; - } else if (Success == PI_ERROR_INVALID_OPERATION) { + } else if (Error == PI_ERROR_INVALID_OPERATION) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Event wait command not supported by backend."); diff --git a/sycl/source/detail/image_impl.cpp b/sycl/source/detail/image_impl.cpp index 0dc6d15d9ac1e..b7f3b23171b37 100644 --- a/sycl/source/detail/image_impl.cpp +++ b/sycl/source/detail/image_impl.cpp @@ -273,8 +273,6 @@ static void getImageInfo(const ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem image get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } } @@ -296,8 +294,6 @@ image_impl::image_impl(cl_mem MemObject, const context &SyclContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } sycl::detail::pi::PiMemImageFormat Format; diff --git a/sycl/source/detail/kernel_bundle_impl.hpp b/sycl/source/detail/kernel_bundle_impl.hpp index 86c3432be752c..d99c74e5fe7a2 100644 --- a/sycl/source/detail/kernel_bundle_impl.hpp +++ b/sycl/source/detail/kernel_bundle_impl.hpp @@ -421,8 +421,6 @@ class kernel_bundle_impl { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } // Get the kernel names. @@ -433,8 +431,6 @@ class kernel_bundle_impl { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } // semi-colon delimited list of kernel names. @@ -446,8 +442,6 @@ class kernel_bundle_impl { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::vector KernelNames = detail::split_string(KernelNamesStr, ';'); diff --git a/sycl/source/detail/kernel_impl.cpp b/sycl/source/detail/kernel_impl.cpp index f659519c4ebea..c53c551a72472 100644 --- a/sycl/source/detail/kernel_impl.cpp +++ b/sycl/source/detail/kernel_impl.cpp @@ -55,8 +55,6 @@ kernel_impl::kernel_impl(sycl::detail::pi::PiKernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - getPlugin()->checkPiResult(Result); } if (ContextImpl->getHandleRef() != Context) { diff --git a/sycl/source/detail/kernel_info.hpp b/sycl/source/detail/kernel_info.hpp index f954f3fc2dd03..0f1780795295e 100644 --- a/sycl/source/detail/kernel_info.hpp +++ b/sycl/source/detail/kernel_info.hpp @@ -38,8 +38,6 @@ get_kernel_info(sycl::detail::pi::PiKernel Kernel, const PluginPtr &Plugin) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } if (ResultSize == 0) { return ""; @@ -52,8 +50,6 @@ get_kernel_info(sycl::detail::pi::PiKernel Kernel, const PluginPtr &Plugin) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } return std::string(Result.data()); } @@ -72,8 +68,6 @@ get_kernel_info(sycl::detail::pi::PiKernel Kernel, const PluginPtr &Plugin) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } return Result; } @@ -93,8 +87,6 @@ get_kernel_device_specific_info_helper(sycl::detail::pi::PiKernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get sub group info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } } @@ -169,8 +161,6 @@ uint32_t get_kernel_device_specific_info_with_input( throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get sub group info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } return Result; diff --git a/sycl/source/detail/persistent_device_code_cache.cpp b/sycl/source/detail/persistent_device_code_cache.cpp index 2d843550e5ec6..a59ba3ce327ad 100644 --- a/sycl/source/detail/persistent_device_code_cache.cpp +++ b/sycl/source/detail/persistent_device_code_cache.cpp @@ -114,8 +114,6 @@ void PersistentDeviceCodeCache::putItemToDisc( throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } std::vector BinarySizes(DeviceNum); @@ -126,8 +124,6 @@ void PersistentDeviceCodeCache::putItemToDisc( throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } std::vector> Result; @@ -137,15 +133,13 @@ void PersistentDeviceCodeCache::putItemToDisc( Pointers.push_back(Result[I].data()); } - PiResult = Plugin->call( + PiResult = Plugin->call_nocheck( NativePrg, PI_PROGRAM_INFO_BINARIES, sizeof(char *) * Pointers.size(), Pointers.data(), nullptr); if (PiResult == PI_ERROR_INVALID_OPERATION) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } size_t i = 0; diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index b98ff8660b9f8..256590cb1057d 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -258,8 +258,6 @@ std::vector platform_impl::filterDeviceFilter( throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - MPlugin->checkPiResult(Result); } backend Backend = convertBackend(PiBackend); diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index f9a38e48be065..3d717d58b5b3f 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -54,8 +54,6 @@ class platform_impl { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - APlugin->checkPiResult(Result); } MBackend = convertBackend(PiBackend); } diff --git a/sycl/source/detail/platform_info.hpp b/sycl/source/detail/platform_info.hpp index 13d1ad864c6bf..74ed3770f9ae0 100644 --- a/sycl/source/detail/platform_info.hpp +++ b/sycl/source/detail/platform_info.hpp @@ -32,8 +32,6 @@ get_platform_info_string_impl(sycl::detail::pi::PiPlatform Plt, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } if (ResultSize == 0) { return ""; @@ -47,8 +45,6 @@ get_platform_info_string_impl(sycl::detail::pi::PiPlatform Plt, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Platform get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } return Result.get(); } diff --git a/sycl/source/detail/program_impl.cpp b/sycl/source/detail/program_impl.cpp index 66b755088cd81..e5e25932bc821 100644 --- a/sycl/source/detail/program_impl.cpp +++ b/sycl/source/detail/program_impl.cpp @@ -156,8 +156,6 @@ program_impl::program_impl(ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::vector PiDevices(NumDevices); @@ -169,8 +167,6 @@ program_impl::program_impl(ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::vector PlatformDevices = @@ -199,8 +195,6 @@ program_impl::program_impl(ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } if (BinaryType == PI_PROGRAM_BINARY_TYPE_NONE) { throw invalid_object_error( @@ -216,8 +210,6 @@ program_impl::program_impl(ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::vector OptionsVector(Size); @@ -228,8 +220,6 @@ program_impl::program_impl(ContextImplPtr Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::string Options(OptionsVector.begin(), OptionsVector.end()); @@ -389,8 +379,6 @@ std::vector> program_impl::get_binaries() const { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } std::vector Pointers; @@ -406,8 +394,6 @@ std::vector> program_impl::get_binaries() const { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(PiResult); } return Result; @@ -480,10 +466,10 @@ program_impl::get_pi_kernel_arg_mask_pair(const std::string &KernelName) const { // Some PI Plugins (like OpenCL) require this call to enable USM // For others, PI will turn this into a NOP. if (getContextImplPtr()->getPlatformImpl()->supports_usm()) { - Plugin->call( - Result.first, PI_USM_INDIRECT_ACCESS, sizeof(pi_bool), &PI_TRUE); + Plugin->call( + Result.first, PI_USM_INDIRECT_ACCESS, sizeof(pi_bool), &PI_TRUE); } - + return Result; } diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index 988051d5a7d5e..3178858c47e47 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -768,8 +768,6 @@ ProgramManager::getPiProgramFromPiKernel(sycl::detail::pi::PiKernel Kernel, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Kernel get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } return Program; @@ -787,8 +785,6 @@ ProgramManager::getProgramBuildLog(const sycl::detail::pi::PiProgram &Program, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::vector PIDevices( @@ -800,8 +796,6 @@ ProgramManager::getProgramBuildLog(const sycl::detail::pi::PiProgram &Program, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } std::string Log = "The program was built for " + @@ -818,8 +812,6 @@ ProgramManager::getProgramBuildLog(const sycl::detail::pi::PiProgram &Program, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } if (DeviceBuildInfoStrSize > 0) { @@ -833,8 +825,6 @@ ProgramManager::getProgramBuildLog(const sycl::detail::pi::PiProgram &Program, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Program get build info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } DeviceBuildInfoString = std::string(DeviceBuildInfo.data()); } diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index d2fe543eae12a..89165b402edcc 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -51,8 +51,6 @@ uint32_t queue_impl::get_info() const { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Queue get info command not supported by backend."); - } else { - getPlugin()->checkPiResult(Result); } } return result; @@ -622,8 +620,6 @@ bool queue_impl::ext_oneapi_empty() const { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Queue get info command not supported by backend."); - } else { - getPlugin()->checkPiResult(Result); } if (!IsReady) { return false; diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 64b48ce46533d..ed3be95480817 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -238,8 +238,6 @@ class queue_impl { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Queue get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } MDevice = MContext->findMatchingDeviceImpl(DevicePI); diff --git a/sycl/source/detail/sampler_impl.cpp b/sycl/source/detail/sampler_impl.cpp index 4f52c2e33baad..a2db61b243831 100644 --- a/sycl/source/detail/sampler_impl.cpp +++ b/sycl/source/detail/sampler_impl.cpp @@ -44,8 +44,6 @@ sampler_impl::sampler_impl(cl_sampler clSampler, const context &syclContext) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Sampler get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } Result = Plugin->call_nocheck( @@ -55,8 +53,6 @@ sampler_impl::sampler_impl(cl_sampler clSampler, const context &syclContext) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Sampler get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } Result = Plugin->call_nocheck( @@ -66,8 +62,6 @@ sampler_impl::sampler_impl(cl_sampler clSampler, const context &syclContext) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Sampler get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } } diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index c3eb0f4703c49..70c448e9676ec 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -2445,7 +2445,7 @@ static pi_result SetKernelParamsAndLaunch( } if (OutEventImpl != nullptr) OutEventImpl->setHostEnqueueTime(); - pi_result Error = + pi_result Result = [&](auto... Args) { if (IsCooperative) { return Plugin @@ -2466,7 +2466,7 @@ static pi_result SetKernelParamsAndLaunch( Plugin->checkPiResult(Result); } - return Error; + return Result; } // The function initialize accessors and calls lambda. diff --git a/sycl/source/detail/sycl_mem_obj_t.cpp b/sycl/source/detail/sycl_mem_obj_t.cpp index e76e078479a5f..19908ae8ca709 100644 --- a/sycl/source/detail/sycl_mem_obj_t.cpp +++ b/sycl/source/detail/sycl_mem_obj_t.cpp @@ -61,8 +61,6 @@ SYCLMemObjT::SYCLMemObjT(pi_native_handle MemObject, const context &SyclContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } Result = Plugin->call_nocheck( @@ -71,8 +69,6 @@ SYCLMemObjT::SYCLMemObjT(pi_native_handle MemObject, const context &SyclContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } if (MInteropContext->getHandleRef() != Context) @@ -147,8 +143,6 @@ SYCLMemObjT::SYCLMemObjT(pi_native_handle MemObject, const context &SyclContext, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } if (MInteropContext->getHandleRef() != Context) @@ -223,8 +217,6 @@ size_t SYCLMemObjT::getBufSizeForContext(const ContextImplPtr &Context, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Mem get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } return BufSize; } diff --git a/sycl/source/detail/usm/usm_impl.cpp b/sycl/source/detail/usm/usm_impl.cpp index 990bc2832145e..aed01d8248835 100755 --- a/sycl/source/detail/usm/usm_impl.cpp +++ b/sycl/source/detail/usm/usm_impl.cpp @@ -661,8 +661,6 @@ device get_pointer_device(const void *Ptr, const context &Ctxt) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "USM get mem alloc info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } // The device is not necessarily a member of the context, it could be a diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index 4454c13f50d15..fbed46de3dd36 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -295,8 +295,6 @@ bool device::ext_oneapi_can_access_peer(const device &peer, throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported), "Peer access get info command not supported by backend."); - } else { - Plugin->checkPiResult(Result); } return value == 1; diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index b8baa350142df..02d68e19a0606 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -279,17 +279,20 @@ event handler::finalize() { if (MQueue->getDeviceImplPtr()->getBackend() == backend::ext_intel_esimd_emulator) { // Capture the host timestamp for profiling (queue time) - if (NewEvent != nullptr) { + if (NewEvent != nullptr) NewEvent->setHostEnqueueTime(); [&](auto... Args) { if (MImpl->MKernelIsCooperative) { - Result = MQueue->getPlugin() - ->call_nocheck< - detail::PiApiKind::piextEnqueueCooperativeKernelLaunch>( - Args...); + Result = + MQueue->getPlugin() + ->call_nocheck( + Args...); } else { - Result = MQueue->getPlugin() - ->call_nocheck(Args...); + Result = + MQueue->getPlugin() + ->call_nocheck< + detail::PiApiKind::piEnqueueKernelLaunch>(Args...); } }(/* queue */ nullptr, diff --git a/sycl/source/interop_handle.cpp b/sycl/source/interop_handle.cpp index df11207c4b55e..5253305f7abb8 100644 --- a/sycl/source/interop_handle.cpp +++ b/sycl/source/interop_handle.cpp @@ -36,7 +36,7 @@ pi_native_handle interop_handle::getNativeMem(detail::Requirement *Req) const { pi_native_handle Handle; sycl::detail::pi::PiResult Result = Plugin->call_nocheck( - Iter->second, &Handle); + Iter->second, MDevice->getHandleRef(), &Handle); if (Result == PI_ERROR_INVALID_OPERATION) { throw sycl::exception( sycl::make_error_code(sycl::errc::feature_not_supported),