Skip to content

Commit e606769

Browse files
committed
Apply comments: move implementation to headers
1 parent 970767f commit e606769

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

sycl/include/sycl/exception.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,20 @@ class __SYCL_EXPORT exception : public virtual std::exception {
148148
friend exception detail::set_pi_error(exception &&e, pi_int32 pi_err);
149149
};
150150

151+
namespace detail {
152+
// Even though at the moment those functions are only used in library and not
153+
// in headers, they were put here in case we will need them to implement some
154+
// of OpenCL (and other backends) interop APIs to query native backend error
155+
// from an exception.
156+
// And we don't want them to be part of our library ABI, because of future
157+
// underlying changes (PI -> UR -> Offload).
158+
inline pi_int32 get_pi_error(const exception &e) { return e.MPIErr; }
159+
inline exception set_pi_error(exception &&e, pi_int32 pi_err) {
160+
e.MPIErr = pi_err;
161+
return std::move(e);
162+
}
163+
} // namespace detail
164+
151165
} // namespace _V1
152166
} // namespace sycl
153167

sycl/source/exception.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ std::error_code make_error_code(sycl::errc Err) noexcept {
6666
}
6767

6868
namespace detail {
69-
pi_int32 get_pi_error(const exception &e) { return e.MPIErr; }
70-
exception set_pi_error(exception &&e, pi_int32 pi_err) {
71-
e.MPIErr = pi_err;
72-
return std::move(e);
73-
}
74-
7569
__SYCL_EXPORT const char *stringifyErrorCode(pi_int32 error) {
7670
switch (error) {
7771
#define _PI_ERRC(NAME, VAL) \

0 commit comments

Comments
 (0)