Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset CUDA error after cudaFuncSetAttribute #504

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions include/cuco/detail/hyperloglog/hyperloglog_ref.cuh
Original file line number Diff line number Diff line change
@@ -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<void const*>(kernel),
cudaFuncAttributeMaxDynamicSharedMemorySize,
shmem_bytes);
bool const ret =
cudaSuccess == cudaFuncSetAttribute(reinterpret_cast<void const*>(kernel),
cudaFuncAttributeMaxDynamicSharedMemorySize,
shmem_bytes);
cudaGetLastError(); // flush CUDA error
return ret;
}

hasher hash_; ///< Hash function used to hash items