File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
sycl/include/sycl/ext/oneapi/experimental Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,12 @@ enum class clock_scope : int {
2929inline uint64_t
3030clock ([[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),
You can’t perform that action at this time.
0 commit comments