Skip to content

Commit b3ca482

Browse files
authored
Add compile-time check for minimum CUDA arch (#855)
MatX requires CUDA compute capability / architecture 6.0 (Pascal) or newer. Building for an older version, such as 5.2 (Maxwell), results in errors due to missing atomic support for some data types. Add an explicit check to the matx.h header to generate an earlier compile-time error that specifies the minimum architecture requirement.
1 parent 877b4ec commit b3ca482

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/matx.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#pragma once
3434
#ifdef __CUDACC__
35+
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600
36+
#error "MatX requires CUDA compute capability 6.0 or newer."
37+
#endif
3538
#include <cuda_runtime_api.h>
3639
#endif
3740
#include <cuda/std/ccomplex>

0 commit comments

Comments
 (0)