Skip to content

Commit 60762d0

Browse files
[SYCL] Remove sycl::errc_for
It had been removed from the specification in KhronosGroup/SYCL-Docs#431. Originally introduced in #4298 the implementation has never been completed, so, while technically a breaking change, no customer code can be really using it.
1 parent f739a6d commit 60762d0

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

sycl/include/sycl/backend.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ namespace sycl {
5959
inline namespace _V1 {
6060

6161
namespace detail {
62-
// TODO each backend can have its own custom errc enumeration
63-
// but the details for this are not fully specified yet
64-
enum class backend_errc : unsigned int {};
65-
6662
// Convert from PI backend to SYCL backend enum
6763
backend convertBackend(pi_platform_backend PiBackend);
6864
} // namespace detail
@@ -74,8 +70,6 @@ template <backend Backend> class backend_traits {
7470

7571
template <class T>
7672
using return_type = typename detail::BackendReturn<Backend, T>::type;
77-
78-
using errc = detail::backend_errc;
7973
};
8074

8175
template <backend Backend, typename SyclType>

sycl/include/sycl/exception.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// 4.9.2 Exception Class Interface
1212

13-
#include <sycl/backend_types.hpp> // for backend
1413
#include <sycl/detail/cl.h> // for cl_int
1514
#include <sycl/detail/common.hpp> // for codeToString
1615
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
@@ -50,8 +49,6 @@ enum class errc : unsigned int {
5049
backend_mismatch = 14,
5150
};
5251

53-
template <backend B> using errc_for = typename backend_traits<B>::errc;
54-
5552
/// Constructs an error code using e and sycl_category()
5653
__SYCL_EXPORT std::error_code make_error_code(sycl::errc E) noexcept;
5754

sycl/test-e2e/Basic/exceptions-SYCL-2020.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,6 @@ int main() {
8080
static_assert(!std::is_error_condition_enum<sycl::errc>::value,
8181
"errc enum should not identify as error condition");
8282

83-
// Test errc_for and backends. Should compile without complaint.
84-
constexpr int EC = 1;
85-
sycl::backend_traits<sycl::backend::opencl>::errc someOpenCLErrCode{EC};
86-
sycl::errc_for<sycl::backend::opencl> anotherOpenCLErrCode{EC};
87-
assert(someOpenCLErrCode == anotherOpenCLErrCode);
88-
sycl::backend_traits<sycl::backend::ext_oneapi_level_zero>::errc
89-
someL0ErrCode{EC};
90-
sycl::errc_for<sycl::backend::ext_oneapi_level_zero> anotherL0ErrCode{EC};
91-
assert(someL0ErrCode == anotherL0ErrCode);
92-
sycl::backend_traits<sycl::backend::ext_oneapi_cuda>::errc someCUDAErrCode{
93-
EC};
94-
sycl::errc_for<sycl::backend::ext_oneapi_cuda> anotherCUDAErrCode{EC};
95-
assert(someCUDAErrCode == anotherCUDAErrCode);
96-
sycl::backend_traits<sycl::backend::ext_oneapi_hip>::errc someHIPErrCode{EC};
97-
sycl::errc_for<sycl::backend::ext_oneapi_hip> anotherHIPErrCode{EC};
98-
assert(someHIPErrCode == anotherHIPErrCode);
99-
10083
std::cout << "OK" << std::endl;
10184
return 0;
10285
}

0 commit comments

Comments
 (0)