Skip to content

Commit

Permalink
Use sycl 2020 exceptions.
Browse files Browse the repository at this point in the history
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
  • Loading branch information
JackAKirk committed Jul 9, 2024
1 parent 054e90e commit 054baf7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sycl/include/syclcompat/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,17 @@ __syclcompat_inline__ uint32_t nvvm_get_smem_pointer(void *ptr) {
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
return (intptr_t)(sycl::decorated_local_ptr<const void>::pointer)ptr;
#else
throw sycl::runtime_error(
"nvvm_get_smem_pointer is only supported on Nvidia devices.",
PI_ERROR_INVALID_DEVICE);
throw sycl::exception(make_error_code(sycl::errc::runtime),
"nvvm_get_smem_pointer is only supported on Nvidia devices.");
#endif
}

__syclcompat_inline__ size_t cvta_generic_to_shared(void *ptr) {
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
return (size_t)(sycl::decorated_local_ptr<const void>::pointer)ptr;
#else
throw sycl::runtime_error(
"cvta_generic_to_shared is only supported on Nvidia devices.",
PI_ERROR_INVALID_DEVICE);
throw sycl::exception(make_error_code(sycl::errc::runtime),
"cvta_generic_to_shared is only supported on Nvidia devices.");
#endif
}

Expand Down

0 comments on commit 054baf7

Please sign in to comment.