Skip to content

[SYCL] Remove sycl::errc_for #13903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
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
6 changes: 0 additions & 6 deletions sycl/include/sycl/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ namespace sycl {
inline namespace _V1 {

namespace detail {
// TODO each backend can have its own custom errc enumeration
// but the details for this are not fully specified yet
enum class backend_errc : unsigned int {};

// Convert from PI backend to SYCL backend enum
backend convertBackend(pi_platform_backend PiBackend);
} // namespace detail
Expand All @@ -74,8 +70,6 @@ template <backend Backend> class backend_traits {

template <class T>
using return_type = typename detail::BackendReturn<Backend, T>::type;

using errc = detail::backend_errc;
};

template <backend Backend, typename SyclType>
Expand Down
3 changes: 0 additions & 3 deletions sycl/include/sycl/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// 4.9.2 Exception Class Interface

#include <sycl/backend_types.hpp> // for backend
#include <sycl/detail/cl.h> // for cl_int
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
Expand Down Expand Up @@ -49,8 +48,6 @@ enum class errc : unsigned int {
backend_mismatch = 14,
};

template <backend B> using errc_for = typename backend_traits<B>::errc;

/// Constructs an error code using e and sycl_category()
__SYCL_EXPORT std::error_code make_error_code(sycl::errc E) noexcept;

Expand Down
17 changes: 0 additions & 17 deletions sycl/test-e2e/Basic/exceptions-SYCL-2020.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ int main() {
static_assert(!std::is_error_condition_enum<sycl::errc>::value,
"errc enum should not identify as error condition");

// Test errc_for and backends. Should compile without complaint.
constexpr int EC = 1;
sycl::backend_traits<sycl::backend::opencl>::errc someOpenCLErrCode{EC};
sycl::errc_for<sycl::backend::opencl> anotherOpenCLErrCode{EC};
assert(someOpenCLErrCode == anotherOpenCLErrCode);
sycl::backend_traits<sycl::backend::ext_oneapi_level_zero>::errc
someL0ErrCode{EC};
sycl::errc_for<sycl::backend::ext_oneapi_level_zero> anotherL0ErrCode{EC};
assert(someL0ErrCode == anotherL0ErrCode);
sycl::backend_traits<sycl::backend::ext_oneapi_cuda>::errc someCUDAErrCode{
EC};
sycl::errc_for<sycl::backend::ext_oneapi_cuda> anotherCUDAErrCode{EC};
assert(someCUDAErrCode == anotherCUDAErrCode);
sycl::backend_traits<sycl::backend::ext_oneapi_hip>::errc someHIPErrCode{EC};
sycl::errc_for<sycl::backend::ext_oneapi_hip> anotherHIPErrCode{EC};
assert(someHIPErrCode == anotherHIPErrCode);

std::cout << "OK" << std::endl;
return 0;
}
Loading