diff --git a/sycl/include/sycl/device_event.hpp b/sycl/include/sycl/device_event.hpp index cf14d265bf71a..7c283857c085f 100644 --- a/sycl/include/sycl/device_event.hpp +++ b/sycl/include/sycl/device_event.hpp @@ -30,7 +30,7 @@ class device_event { device_event(__ocl_event_t Event) : m_Event(Event) {} - void wait() { + void wait() noexcept { (void)m_Event; #ifdef __SYCL_DEVICE_ONLY__ __spirv_GroupWaitEvents(__spv::Scope::Workgroup, 1, &m_Event); diff --git a/sycl/test/basic_tests/nd_item_interface.cpp b/sycl/test/basic_tests/nd_item_interface.cpp index 7c0f1385767af..19ff04ee95842 100644 --- a/sycl/test/basic_tests/nd_item_interface.cpp +++ b/sycl/test/basic_tests/nd_item_interface.cpp @@ -132,5 +132,6 @@ static_assert(noexcept(std::declval().async_work_group_copy( std::declval(), std::declval(), std::size_t{}))); +static_assert(noexcept(std::declval().wait())); static_assert(noexcept( std::declval().wait_for(std::declval())));