19 constexpr
char ReservedForErrorcode[] =
21 std::error_code SYCL121ProxyErrorcode =
make_error_code(sycl::errc::invalid);
24 exception::exception(std::error_code EC,
const char *Msg)
34 const std::string &WhatArg)
35 :
exception({EV, ECat},
nullptr, WhatArg) {}
39 :
exception({EV, ECat},
nullptr, std::string(WhatArg)) {}
45 const std::string &WhatArg)
56 :
exception(Ctx, {EV, ECat}, std::string(WhatArg)) {}
59 const std::string &WhatArg)
67 const std::string &WhatArg)
69 MContext(SharedPtrCtx) {
72 const int StringTermPoint = MMsg.length() - strlen(ReservedForErrorcode);
73 char *ReservedPtr = &MMsg[StringTermPoint];
74 ReservedPtr[0] =
'\0';
77 std::error_code *ECPtr =
reinterpret_cast<std::error_code *
>(ReservedPtr);
78 memcpy(ECPtr, &EC,
sizeof(std::error_code));
82 const char *WhatStr = MMsg.c_str();
84 int StringTermPoint = MMsg.length() - strlen(ReservedForErrorcode);
85 if (StringTermPoint >= 0) {
86 const char *ReservedPtr = &WhatStr[StringTermPoint];
88 if (ReservedPtr[0] ==
'\0') {
90 const std::error_code *ECPtr =
91 reinterpret_cast<const std::error_code *
>(ReservedPtr);
96 return SYCL121ProxyErrorcode;
100 return code().category();
109 throw invalid_object_error();
118 return SYCLCategoryObj;