Skip to content

Commit 4c75261

Browse files
committed
dummy for non-spirv
1 parent af1aab3 commit 4c75261

File tree

1 file changed

+5
-6
lines changed
  • sycl/include/sycl/ext/oneapi/experimental

1 file changed

+5
-6
lines changed

sycl/include/sycl/ext/oneapi/experimental/clock.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ enum class clock_scope : int {
2929
inline uint64_t
3030
clock([[maybe_unused]] clock_scope scope = clock_scope::sub_group) {
3131
#ifdef __SYCL_DEVICE_ONLY__
32-
#if defined(__SPIR__) || defined(__SPIRV__)
33-
return __spirv_ReadClockKHR(static_cast<int>(scope));
32+
#if defined(__NVPTX__) || defined(__AMDGCN__)
33+
// Currently clock() is not supported on NVPTX and AMDGCN.
34+
return 0;
3435
#else
35-
throw sycl::exception(make_error_code(errc::feature_not_supported),
36-
"sycl::ext::oneapi::experimental::clock() is currently "
37-
"supported only on backends with SPIR-V support.");
38-
#endif // defined(__SPIR__) || defined(__SPIRV__)
36+
return __spirv_ReadClockKHR(static_cast<int>(scope));
37+
#endif // defined(__NVPTX__) || defined(__AMDGCN__)
3938
#else
4039
throw sycl::exception(
4140
make_error_code(errc::runtime),

0 commit comments

Comments
 (0)