Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions sycl/include/sycl/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,19 @@ 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> 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> 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<detail::string>(Msg)), MContext(nullptr){}
#else
: MMsg(std::make_shared<std::string>(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<context> SharedPtrCtx,
const std::string &what_arg)
: exception(Ec, SharedPtrCtx, what_arg.c_str()) {
}
// base constructor for all SYCL 2020 constructors
// exception(context *, std::error_code, const std::string);
exception(std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
const std::string &what_arg)
: exception(Ec, SharedPtrCtx, what_arg.c_str()) {}
exception(std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
const char *WhatArg);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See line 126 in the previous file on why I used this.

};

/// Designates a source language for the online compiler.
Expand Down
5 changes: 2 additions & 3 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down