Skip to content
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
5 changes: 5 additions & 0 deletions sycl/doc/syclcompat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,10 @@ If a `std::runtime_error` exception is caught,
`syclcompat::error_code::default_error` is returned instead. For both cases, it
prints the error message to the standard error stream.

`get_error_string_dummy` is a dummy function introduced to assist auto
migration. The SYCLomatic user should replace it with a real error-handling
function. SYCL reports errors using exceptions and does not use error codes.

``` c++
namespace syclcompat {

Expand Down Expand Up @@ -1620,6 +1624,7 @@ template <int Arg> class syclcompat_kernel_scalar;

namespace syclcompat {
enum error_code { success = 0, backend_error = 1, default_error = 999 };
inline const char *get_error_string_dummy(int ec);
}

#define SYCLCOMPAT_CHECK_ERROR(expr)
Expand Down
8 changes: 8 additions & 0 deletions sycl/include/syclcompat/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ template <int Arg> class syclcompat_kernel_scalar;

namespace syclcompat {
enum error_code { success = 0, backend_error = 1, default_error = 999 };
/// A dummy function introduced to assist auto migration.
/// The SYCLomatic user should replace it with a real error-handling function.
/// SYCL reports errors using exceptions and does not use error codes.
inline const char *get_error_string_dummy(int ec) {
(void)ec;
return "<FIXME: Placeholder>"; // Return the error string for the error code
// ec.
}
} // namespace syclcompat

#define SYCLCOMPAT_CHECK_ERROR(expr) \
[&]() { \
Expand Down
Loading