Skip to content

Commit 37b5675

Browse files
committed
Add a comment to explain __CUDA_ARCH__ handling
Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent 25508ef commit 37b5675

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

codebasin/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ def parse_args(self, argv: list[str]) -> list[PreprocessorConfiguration]:
322322
defines.append("__CUDACC__")
323323

324324
if pass_ != "default":
325+
# The __CUDA_ARCH__ macro always has three digits.
326+
# Multiplying the SM version by 10 gives the macro value.
327+
# e.g., sm_71 corresponds to __CUDA_ARCH__=710.
325328
arch = int(pass_) * 10
326329
defines.append(f"__CUDA_ARCH__={arch}")
327330

0 commit comments

Comments
 (0)