Skip to content

Commit

Permalink
NVRTC workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 29, 2025
1 parent 5d729b2 commit 3085199
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions libcudacxx/include/nv/detail/__target_macros
Original file line number Diff line number Diff line change
Expand Up @@ -587,3 +587,28 @@
#endif

#endif // _NV__TARGET_MACROS

// NVRTC ships a built-in copy of this header file, so including this header will omit the content since the header
// guards are already defined. To make older NVRTC versions have a few newer feature macros, we define them here outside
// the header guards.
// TODO(bgruber): limit this workaround to NVRTC versions older than the first one shipping those macros
#ifdef __CUDACC_RTC__
#ifndef NV_HAS_FEATURE_SM_100a
# define NV_HAS_FEATURE_SM_100a __NV_HAS_FEATURE_SM_100a
# if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 1000) && defined(__CUDA_ARCH_FEAT_SM100_ALL))
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_100a 1
# else
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_100a 0
# endif
#endif // NV_HAS_FEATURE_SM_100a

// Re-enable sm_101a support in nvcc.
#ifndef NV_HAS_FEATURE_SM_101a
# define NV_HAS_FEATURE_SM_101a __NV_HAS_FEATURE_SM_101a
# if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 1010) && defined(__CUDA_ARCH_FEAT_SM101_ALL))
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_101a 1
# else
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_101a 0
# endif
#endif // NV_HAS_FEATURE_SM_101a
#endif // __CUDACC_RTC__

0 comments on commit 3085199

Please sign in to comment.