From ead10e406e7aae6d2be7df5d5bb43b5d08685d16 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Tue, 2 Jul 2024 14:11:27 -0700 Subject: [PATCH 1/3] [NFCI] Remove/inline [rarely|never] used `exception` ctor overloads SYCL 1.2 exception classes don't use `context` argument so it can be removed. `online_compile_error` was the single user of an overload, so I've removed it and change the ctor used by it. --- sycl/include/sycl/exception.hpp | 31 ++++++------------- .../intel/experimental/online_compiler.hpp | 3 +- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/sycl/include/sycl/exception.hpp b/sycl/include/sycl/exception.hpp index ef5c3f2d396d2..155dea83f4b5b 100644 --- a/sycl/include/sycl/exception.hpp +++ b/sycl/include/sycl/exception.hpp @@ -127,31 +127,20 @@ class __SYCL_EXPORT exception : public virtual std::exception { protected: // base constructors used by SYCL 1.2.1 exception subclasses - exception(std::error_code Ec, const char *Msg, const pi_int32 PIErr, - std::shared_ptr Context = nullptr) - : exception(Ec, std::string(Msg), PIErr, Context) {} + exception(std::error_code Ec, const char *Msg, const pi_int32 PIErr) + : exception(Ec, std::string(Msg), PIErr) {} - exception(std::error_code Ec, const std::string &Msg, const pi_int32 PIErr, - std::shared_ptr Context = nullptr) - : exception(Ec, Context, Msg + " " + detail::codeToString(PIErr)) { + exception(std::error_code Ec, const std::string &Msg, const pi_int32 PIErr) + : exception(Ec, nullptr, Msg + " " + detail::codeToString(PIErr)) { MPIErr = PIErr; } - exception(const std::string &Msg) -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - : MMsg(std::make_shared(Msg)), MContext(nullptr){} -#else - : MMsg(std::make_shared(Msg)), MContext(nullptr) { - } -#endif - - // base constructor for all SYCL 2020 constructors - // exception(context *ctxPtr, std::error_code Ec, const std::string - // &what_arg); - exception(std::error_code Ec, std::shared_ptr SharedPtrCtx, - const std::string &what_arg) - : exception(Ec, SharedPtrCtx, what_arg.c_str()) { - } + // base constructor for all SYCL 2020 constructors + // exception(context *ctxPtr, std::error_code Ec, const std::string + // &what_arg); + exception(std::error_code Ec, std::shared_ptr SharedPtrCtx, + const std::string &what_arg) + : exception(Ec, SharedPtrCtx, what_arg.c_str()) {} exception(std::error_code Ec, std::shared_ptr SharedPtrCtx, const char *WhatArg); }; diff --git a/sycl/include/sycl/ext/intel/experimental/online_compiler.hpp b/sycl/include/sycl/ext/intel/experimental/online_compiler.hpp index 15536e9300b90..769dbe45050fc 100644 --- a/sycl/include/sycl/ext/intel/experimental/online_compiler.hpp +++ b/sycl/include/sycl/ext/intel/experimental/online_compiler.hpp @@ -67,7 +67,8 @@ class device_arch { class online_compile_error : public sycl::exception { public: online_compile_error() = default; - online_compile_error(const std::string &Msg) : sycl::exception(Msg) {} + online_compile_error(const std::string &Msg) + : sycl::exception(make_error_code(errc::invalid), Msg) {} }; /// Designates a source language for the online compiler. From b3479de37e138d3705d9d751a079addf0baa4d27 Mon Sep 17 00:00:00 2001 From: aelovikov-intel Date: Tue, 2 Jul 2024 16:04:27 -0700 Subject: [PATCH 2/3] Update sycl/include/sycl/exception.hpp Co-authored-by: Alexey Bader --- sycl/include/sycl/exception.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sycl/include/sycl/exception.hpp b/sycl/include/sycl/exception.hpp index 155dea83f4b5b..32bbc39f22c2c 100644 --- a/sycl/include/sycl/exception.hpp +++ b/sycl/include/sycl/exception.hpp @@ -136,8 +136,7 @@ class __SYCL_EXPORT exception : public virtual std::exception { } // base constructor for all SYCL 2020 constructors - // exception(context *ctxPtr, std::error_code Ec, const std::string - // &what_arg); + // exception(context *, std::error_code, const std::string); exception(std::error_code Ec, std::shared_ptr SharedPtrCtx, const std::string &what_arg) : exception(Ec, SharedPtrCtx, what_arg.c_str()) {} From 87cff4fa9fd5d4f293559ae650fe5575aa8e8023 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Wed, 3 Jul 2024 08:43:17 -0700 Subject: [PATCH 3/3] Update symbols on Windows --- sycl/test/abi/sycl_symbols_windows.dump | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index 00d45e8913778..b8375898eb708 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -529,9 +529,8 @@ ??0event@_V1@sycl@@QEAA@AEBV012@@Z ??0event@_V1@sycl@@QEAA@PEAU_cl_event@@AEBVcontext@12@@Z ??0event@_V1@sycl@@QEAA@XZ -??0exception@_V1@sycl@@IEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z -??0exception@_V1@sycl@@IEAA@Verror_code@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@HV?$shared_ptr@Vcontext@_V1@sycl@@@4@@Z -??0exception@_V1@sycl@@IEAA@Verror_code@std@@PEBDHV?$shared_ptr@Vcontext@_V1@sycl@@@4@@Z +??0exception@_V1@sycl@@IEAA@Verror_code@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@H@Z +??0exception@_V1@sycl@@IEAA@Verror_code@std@@PEBDH@Z ??0exception@_V1@sycl@@IEAA@Verror_code@std@@V?$shared_ptr@Vcontext@_V1@sycl@@@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z ??0exception@_V1@sycl@@IEAA@Verror_code@std@@V?$shared_ptr@Vcontext@_V1@sycl@@@4@PEBD@Z ??0exception@_V1@sycl@@QEAA@AEBV012@@Z