Skip to content

Commit

Permalink
Build fix for CUDA 12.2 (rapidsai#1870)
Browse files Browse the repository at this point in the history
Building on cuda 12.2 shows errors like

```
/code/raft/cpp/include/raft/spatial/knn/detail/ball_cover/registers-inl.cuh(177): error #20054-D: dynamic initialization is not supported for a function-scope static __shared__ variable within a __device__/__global__ function
              KeyValuePair<value_t, value_idx> shared_memV[kNumWarps * warp_q];
```

Fix by using default constructors for structures in shared memory, even trivial constructors will cause this issue

Authors:
  - Ben Frederickson (https://github.com/benfred)
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: rapidsai#1870
  • Loading branch information
benfred authored and divyegala committed Oct 6, 2023
1 parent 4124f27 commit 7c3738e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions cpp/cmake/patches/ggnn.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
diff --git a/include/ggnn/cache/cuda_simple_knn_sym_cache.cuh b/include/ggnn/cache/cuda_simple_knn_sym_cache.cuh
index 890420e..d792903 100644
--- a/include/ggnn/cache/cuda_simple_knn_sym_cache.cuh
+++ b/include/ggnn/cache/cuda_simple_knn_sym_cache.cuh
@@ -62,7 +62,7 @@ struct SimpleKNNSymCache {
const ValueT dist_half)
: dist_query(dist_query), dist_half(dist_half) {}

- __device__ __forceinline__ DistQueryAndHalf() {}
+ DistQueryAndHalf() = default;
};

struct DistanceAndNorm {
@@ -98,8 +98,7 @@ struct SimpleKNNSymCache {
KeyT cache;
DistQueryAndHalf dist;
bool flag;
-
- __device__ __forceinline__ SyncTempStorage() {}
+ SyncTempStorage() = default;
};

public:
diff --git a/include/ggnn/cuda_knn_ggnn_gpu_instance.cuh b/include/ggnn/cuda_knn_ggnn_gpu_instance.cuh
index 8cbaf0d..6eb72ac 100644
--- a/include/ggnn/cuda_knn_ggnn_gpu_instance.cuh
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/core/kvp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct KeyValuePair {
Value value; ///< Item value

/// Constructor
RAFT_INLINE_FUNCTION KeyValuePair() {}
KeyValuePair() = default;

#ifdef _RAFT_HAS_CUDA
/// Conversion Constructor to allow integration w/ cub
Expand Down

0 comments on commit 7c3738e

Please sign in to comment.