File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ inline namespace _V1 {
29
29
30
30
// Forward declaration
31
31
class context ;
32
+ class exception ;
32
33
33
34
enum class errc : unsigned int {
34
35
success = 0 ,
@@ -66,6 +67,9 @@ class __SYCL_EXPORT SYCLCategory : public std::error_category {
66
67
const char *name () const noexcept override { return " sycl" ; }
67
68
std::string message (int ) const override { return " SYCL Error" ; }
68
69
};
70
+
71
+ // Forward declare to declare as a friend in sycl::excepton.
72
+ __SYCL_EXPORT pi_int32 get_pi_error (const exception &e);
69
73
} // namespace detail
70
74
71
75
// Derive from std::exception so uncaught exceptions are printed in c++ default
@@ -110,9 +114,6 @@ class __SYCL_EXPORT exception : public virtual std::exception {
110
114
111
115
context get_context () const ;
112
116
113
- __SYCL2020_DEPRECATED (" use sycl::exception.code() instead." )
114
- cl_int get_cl_code () const ;
115
-
116
117
private:
117
118
// Exceptions must be noexcept copy constructible, so cannot use std::string
118
119
// directly.
@@ -154,6 +155,8 @@ class __SYCL_EXPORT exception : public virtual std::exception {
154
155
}
155
156
exception (std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
156
157
const char *WhatArg);
158
+
159
+ friend __SYCL_EXPORT pi_int32 detail::get_pi_error (const exception &);
157
160
};
158
161
159
162
class __SYCL2020_DEPRECATED (
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ class KernelProgramCache {
289
289
return BuildResult;
290
290
} catch (const exception &Ex) {
291
291
BuildResult->Error .Msg = Ex.what ();
292
- BuildResult->Error .Code = Ex. get_cl_code ( );
292
+ BuildResult->Error .Code = detail::get_pi_error (Ex );
293
293
if (BuildResult->Error .Code == PI_ERROR_OUT_OF_RESOURCES ||
294
294
BuildResult->Error .Code == PI_ERROR_OUT_OF_HOST_MEMORY) {
295
295
reset ();
Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ context exception::get_context() const {
83
83
return *MContext;
84
84
}
85
85
86
- cl_int exception::get_cl_code () const { return MPIErr; }
87
-
88
86
const std::error_category &sycl_category () noexcept {
89
87
static const detail::SYCLCategory SYCLCategoryObj;
90
88
return SYCLCategoryObj;
@@ -95,7 +93,9 @@ std::error_code make_error_code(sycl::errc Err) noexcept {
95
93
}
96
94
97
95
namespace detail {
98
- const char *stringifyErrorCode (pi_int32 error) {
96
+ pi_int32 get_pi_error (const exception &e) { return e.MPIErr ; }
97
+
98
+ __SYCL_EXPORT const char *stringifyErrorCode (pi_int32 error) {
99
99
switch (error) {
100
100
#define _PI_ERRC (NAME, VAL ) \
101
101
case NAME: \
Original file line number Diff line number Diff line change @@ -3232,6 +3232,7 @@ _ZN4sycl3_V16detail12buffer_plainC2ERKSt8functionIFvPvEEmmRKNS0_13property_listE
3232
3232
_ZN4sycl3_V16detail12buffer_plainC2EmRKNS0_7contextESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteIS7_EEbRKNS0_5eventE
3233
3233
_ZN4sycl3_V16detail12buffer_plainC2EmmRKNS0_13property_listESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteIS7_EE
3234
3234
_ZN4sycl3_V16detail12compile_implERKNS0_13kernel_bundleILNS0_12bundle_stateE0EEERKSt6vectorINS0_6deviceESaIS8_EERKNS0_13property_listE
3235
+ _ZN4sycl3_V16detail12get_pi_errorERKNS0_9exceptionE
3235
3236
_ZN4sycl3_V16detail12isOutOfRangeENS0_3vecIiLi4EEENS0_15addressing_modeENS0_5rangeILi3EEE
3236
3237
_ZN4sycl3_V16detail12make_contextEmRKSt8functionIFvNS0_14exception_listEEENS0_7backendEbRKSt6vectorINS0_6deviceESaISA_EE
3237
3238
_ZN4sycl3_V16detail13host_pipe_map3addEPKvPKc
@@ -4189,7 +4190,6 @@ _ZNK4sycl3_V18platform3getEv
4189
4190
_ZNK4sycl3_V18platform3hasENS0_6aspectE
4190
4191
_ZNK4sycl3_V18platform7is_hostEv
4191
4192
_ZNK4sycl3_V18platform9getNativeEv
4192
- _ZNK4sycl3_V19exception11get_cl_codeEv
4193
4193
_ZNK4sycl3_V19exception11get_contextEv
4194
4194
_ZNK4sycl3_V19exception11has_contextEv
4195
4195
_ZNK4sycl3_V19exception4codeEv
Original file line number Diff line number Diff line change 4195
4195
?get_backend@queue@_V1@sycl@@QEBA?AW4backend@23@XZ
4196
4196
?get_channel_order@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AW4image_channel_order@56@XZ
4197
4197
?get_channel_type@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AW4image_channel_type@56@XZ
4198
- ?get_cl_code@exception@_V1@sycl@@QEBAHXZ
4199
4198
?get_composite_devices@experimental@oneapi@ext@_V1@sycl@@YA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@XZ
4200
4199
?get_context@exception@_V1@sycl@@QEBA?AVcontext@23@XZ
4201
4200
?get_context@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AVcontext@56@XZ
4241
4240
?get_node_from_event@node@experimental@oneapi@ext@_V1@sycl@@SA?AV123456@Vevent@56@@Z
4242
4241
?get_nodes@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$vector@Vnode@experimental@oneapi@ext@_V1@sycl@@V?$allocator@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@@std@@XZ
4243
4242
?get_num_channels@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBAIXZ
4243
+ ?get_pi_error@detail@_V1@sycl@@YAHAEBVexception@23@@Z
4244
4244
?get_pipe_name@pipe_base@experimental@intel@ext@_V1@sycl@@KA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBX@Z
4245
4245
?get_pitch@image_plain@detail@_V1@sycl@@IEBA?AV?$range@$01@34@XZ
4246
4246
?get_platform@context@_V1@sycl@@QEBA?AVplatform@23@XZ
Original file line number Diff line number Diff line change @@ -101,9 +101,6 @@ int main() {
101
101
sycl::feature_not_supported fns;
102
102
// expected-warning@+1{{'exception' is deprecated: The version of an exception constructor which takes no arguments is deprecated.}}
103
103
sycl::exception ex;
104
- // expected-warning@+1{{'get_cl_code' is deprecated: use sycl::exception.code() instead.}}
105
- ex.get_cl_code ();
106
- (void )ex;
107
104
108
105
// expected-warning@+1{{'online_compiler<sycl::ext::intel::experimental::source_language::opencl_c>' is deprecated}}
109
106
sycl::ext::intel::experimental::online_compiler<
You can’t perform that action at this time.
0 commit comments