diff --git a/sycl/doc/syclcompat/README.md b/sycl/doc/syclcompat/README.md index 1ba7b75dbcd64..492244aef0063 100644 --- a/sycl/doc/syclcompat/README.md +++ b/sycl/doc/syclcompat/README.md @@ -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 { @@ -1620,6 +1624,7 @@ template 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) diff --git a/sycl/include/syclcompat/defs.hpp b/sycl/include/syclcompat/defs.hpp index 2415d1fe8847c..e1ee5969c0534 100644 --- a/sycl/include/syclcompat/defs.hpp +++ b/sycl/include/syclcompat/defs.hpp @@ -68,7 +68,15 @@ template 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 ""; // Return the error string for the error code + // ec. } +} // namespace syclcompat #define SYCLCOMPAT_CHECK_ERROR(expr) \ [&]() { \