From 3c1b1b0ff6150540d75a316f585cd5a89e91068f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20J=C3=BCnger?= Date: Wed, 12 Jun 2024 01:39:37 +0000 Subject: [PATCH] Reset CUDA error after cudaFuncSetAttribute --- include/cuco/detail/hyperloglog/hyperloglog_ref.cuh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/cuco/detail/hyperloglog/hyperloglog_ref.cuh b/include/cuco/detail/hyperloglog/hyperloglog_ref.cuh index 056088fe9..bd7cd95ad 100644 --- a/include/cuco/detail/hyperloglog/hyperloglog_ref.cuh +++ b/include/cuco/detail/hyperloglog/hyperloglog_ref.cuh @@ -550,9 +550,12 @@ class hyperloglog_ref { [[nodiscard]] __host__ constexpr bool try_reserve_shmem(Kernel kernel, int shmem_bytes) const noexcept { - return cudaSuccess == cudaFuncSetAttribute(reinterpret_cast(kernel), - cudaFuncAttributeMaxDynamicSharedMemorySize, - shmem_bytes); + bool const ret = + cudaSuccess == cudaFuncSetAttribute(reinterpret_cast(kernel), + cudaFuncAttributeMaxDynamicSharedMemorySize, + shmem_bytes); + cudaGetLastError(); // flush CUDA error + return ret; } hasher hash_; ///< Hash function used to hash items