diff --git a/libcudacxx/include/cuda/stream_ref b/libcudacxx/include/cuda/stream_ref index a8b044909eb..df22c7adc19 100644 --- a/libcudacxx/include/cuda/stream_ref +++ b/libcudacxx/include/cuda/stream_ref @@ -9,7 +9,7 @@ //===----------------------------------------------------------------------===// #ifndef _CUDA_STREAM_REF -#define _CUDA_STREAM_REF +# define _CUDA_STREAM_REF /* stream_ref synopsis @@ -38,22 +38,22 @@ private: } // cuda */ -#include +# include // cuda_runtime_api needs to come first -#include +# include -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header +# if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +# elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +# elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +# endif // no system header -#include -#include -#include +# include +# include +# include _LIBCUDACXX_BEGIN_NAMESPACE_CUDA @@ -164,7 +164,15 @@ public: break; default: ::cudaGetLastError(); // Clear CUDA error state +# ifdef _CCCL_HAS_CUDA_COMPILER ::cuda::__throw_cuda_error(__result, "Failed to query stream."); +# else +# ifndef _CCCL_NO_EXCEPTIONS + throw ::std::runtime_error("Failed to query stream."); +# else + ::std::terminate(); +# else +# endif } return true; } @@ -186,4 +194,4 @@ public: _LIBCUDACXX_END_NAMESPACE_CUDA -#endif //_CUDA_STREAM_REF +# endif //_CUDA_STREAM_REF