From 6f36028d05093ebc8785bea575708fa7be7ff037 Mon Sep 17 00:00:00 2001 From: Byoungro So Date: Fri, 9 Feb 2024 13:38:14 -0800 Subject: [PATCH] more feedback addressed Signed-off-by: Byoungro So --- sycl/include/sycl/device.hpp | 1 + sycl/include/sycl/handler.hpp | 4 ---- sycl/source/detail/queue_impl.hpp | 8 +------- sycl/source/device.cpp | 24 +++++------------------- 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index 1348287113220..28da72ffb7671 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -237,6 +237,7 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase { detail::string_view PropertyName(typeid(Param).name()); std::vector Info = get_device_info_vector(PropertyName); std::vector Res; + Res.reserve(Info.size()); for (detail::string &Str : Info) { Res.push_back(Str.c_str()); } diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index 638ad7043972c..f5a819d443d67 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -905,11 +905,7 @@ class __SYCL_EXPORT handler { extractArgsAndReqsFromLambda(reinterpret_cast(KernelPtr), KI::getNumParams(), &KI::getParamDesc(0), KI::isESIMD()); -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - MKernelName = detail::string(KI::getName()); -#else MKernelName = KI::getName(); -#endif } else { // In case w/o the integration header it is necessary to process // accessors from the list(which are associated with this handler) as diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 07d7f1f92bac0..38ceec98a5635 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -825,16 +825,10 @@ class queue_impl { bool KernelUsesAssert = false; if (IsKernel) - // Kernel only uses assert if it's non interop one -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + // Kernel only uses assert if it's non interop one KernelUsesAssert = !(Handler.MKernel && Handler.MKernel->isInterop()) && ProgramManager::getInstance().kernelUsesAssert( Handler.MKernelName.c_str()); -#else - KernelUsesAssert = - !(Handler.MKernel && Handler.MKernel->isInterop()) && - ProgramManager::getInstance().kernelUsesAssert(Handler.MKernelName); -#endif finalizeHandler(Handler, Event); (*PostProcess)(IsKernel, KernelUsesAssert, Event); diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index 9b90e46fe34f4..963b703b67a28 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -192,24 +192,13 @@ device::get_info() const { #endif // Explicit override. Not fulfilled by #include device_traits.def below. -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES template <> +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_EXPORT device device::get_info_internal() const { - // With ONEAPI_DEVICE_SELECTOR the impl.MRootDevice is preset and may be - // overridden (ie it may be nullptr on a sub-device) The PI of the sub-devices - // have parents, but we don't want to return them. They must pretend to be - // parentless root devices. - if (impl->isRootDevice()) - throw invalid_object_error( - "No parent for device because it is not a subdevice", - PI_ERROR_INVALID_DEVICE); - else - return impl->template get_info(); -} #else -template <> __SYCL_EXPORT device device::get_info() const { +#endif // With ONEAPI_DEVICE_SELECTOR the impl.MRootDevice is preset and may be // overridden (ie it may be nullptr on a sub-device) The PI of the sub-devices // have parents, but we don't want to return them. They must pretend to be @@ -221,15 +210,12 @@ __SYCL_EXPORT device device::get_info() const { else return impl->template get_info(); } -#endif -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES template <> __SYCL_EXPORT std::vector +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES device::get_info_internal() const { #else -template <> -__SYCL_EXPORT std::vector device::get_info() const { #endif std::vector DeviceAspects{ @@ -254,18 +240,18 @@ device::get_info() const { return DeviceAspects; } -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES template <> +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_EXPORT bool device::get_info_internal() const { #else -template <> __SYCL_EXPORT bool device::get_info() const { #endif // Explicit specialization is needed due to the class of info handle. The // implementation is done in get_device_info_impl. return impl->template get_info(); } + #ifdef __INTEL_PREVIEW_BREAKING_CHANGES #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \ template __SYCL_EXPORT ReturnT \