diff --git a/sycl/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp b/sycl/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp index 4319577eb202e..996bff2f9bac0 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/cuda/barrier.hpp @@ -32,6 +32,8 @@ class barrier { #ifdef __SYCL_DEVICE_ONLY__ __clc_BarrierInitialize(&state, expected_count); #else + (void)state; + (void)expected_count; throw runtime_error("Barrier is not supported on host device.", PI_INVALID_DEVICE); #endif @@ -68,6 +70,7 @@ class barrier { #ifdef __SYCL_DEVICE_ONLY__ return __clc_BarrierArriveNoComplete(&state, count); #else + (void)count; throw runtime_error("Barrier is not supported on host device.", PI_INVALID_DEVICE); #endif @@ -77,6 +80,7 @@ class barrier { #ifdef __SYCL_DEVICE_ONLY__ return __clc_BarrierArriveAndDropNoComplete(&state, count); #else + (void)count; throw runtime_error("Barrier is not supported on host device.", PI_INVALID_DEVICE); #endif @@ -104,6 +108,7 @@ class barrier { #ifdef __SYCL_DEVICE_ONLY__ __clc_BarrierWait(&state, arrival); #else + (void)arrival; throw runtime_error("Barrier is not supported on host device.", PI_INVALID_DEVICE); #endif @@ -113,6 +118,7 @@ class barrier { #ifdef __SYCL_DEVICE_ONLY__ return __clc_BarrierTestWait(&state, arrival); #else + (void)arrival; throw runtime_error("Barrier is not supported on host device.", PI_INVALID_DEVICE); #endif