From 78e06d5dcd438bc99eb3716175289aebf3d220c9 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Tue, 2 Apr 2024 13:41:11 -0400 Subject: [PATCH] Fix old cuda atomics There are some overloads for atomic adds of floating point numbers for older versions of cuda that do not include them directly. These were misnamed and thus not properly overloading the generic implementation. This caused compile errors with older versions of cuda. --- docs/changelog/fix-old-cuda-atomics.md | 6 ++++++ vtkm/Atomic.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 docs/changelog/fix-old-cuda-atomics.md diff --git a/docs/changelog/fix-old-cuda-atomics.md b/docs/changelog/fix-old-cuda-atomics.md new file mode 100644 index 000000000..87ca20bd4 --- /dev/null +++ b/docs/changelog/fix-old-cuda-atomics.md @@ -0,0 +1,6 @@ +# Fix old cuda atomics + +There are some overloads for atomic adds of floating point numbers for +older versions of cuda that do not include them directly. These were +misnamed and thus not properly overloading the generic implementation. +This caused compile errors with older versions of cuda. diff --git a/vtkm/Atomic.h b/vtkm/Atomic.h index c6ff4398c..acb69dbd6 100644 --- a/vtkm/Atomic.h +++ b/vtkm/Atomic.h @@ -226,9 +226,9 @@ VTKM_EXEC_CONT inline bool AtomicCompareExchangeImpl(T* addr, } } #if __CUDA_ARCH__ < 200 -VTKM_EXEC_CONT inline vtkm::Float32 vtkmAtomicAddImpl(vtkm::Float32* address, - vtkm::Float32 value, - vtkm::MemoryOrder order) +VTKM_EXEC_CONT inline vtkm::Float32 AtomicAddImpl(vtkm::Float32* address, + vtkm::Float32 value, + vtkm::MemoryOrder order) { AtomicStoreFence(order); vtkm::UInt32 assumed; @@ -245,7 +245,7 @@ VTKM_EXEC_CONT inline vtkm::Float32 vtkmAtomicAddImpl(vtkm::Float32* address, } #endif #if __CUDA_ARCH__ < 600 -VTKM_EXEC_CONT inline vtkm::Float64 vtkmAtomicAdd(vtkm::Float64* address, +VTKM_EXEC_CONT inline vtkm::Float64 AtomicAddImpl(vtkm::Float64* address, vtkm::Float64 value, vtkm::MemoryOrder order) {