Skip to content

Commit d49d7c9

Browse files
authored
[NVIDIA] Add support Thor, Spark and GB300 and CUDA 13 (#776)
* Update setup.py * refactor: replace cub::CTA_SYNC() with __syncthreads() for better clarity * Update setup.py
1 parent 3f2b93c commit d49d7c9

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

csrc/selective_scan/reverse_scan.cuh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct WarpReverseScan {
129129
/// Constructor
130130
explicit __device__ __forceinline__
131131
WarpReverseScan()
132-
: lane_id(cub::LaneId())
132+
: lane_id(threadIdx.x & 0x1f)
133133
, warp_id(IS_ARCH_WARP ? 0 : (lane_id / LOGICAL_WARP_THREADS))
134134
, member_mask(cub::WarpMask<LOGICAL_WARP_THREADS>(warp_id))
135135
{
@@ -332,7 +332,7 @@ struct BlockReverseScan {
332332
// Place thread partial into shared memory raking grid
333333
T *placement_ptr = BlockRakingLayout::PlacementPtr(temp_storage.raking_grid, linear_tid);
334334
detail::uninitialized_copy(placement_ptr, input);
335-
cub::CTA_SYNC();
335+
__syncthreads();
336336
// Reduce parallelism down to just raking threads
337337
if (linear_tid < RAKING_THREADS) {
338338
WarpReverseScan warp_scan;
@@ -350,7 +350,7 @@ struct BlockReverseScan {
350350
// Exclusive raking downsweep scan
351351
ExclusiveDownsweep(scan_op, downsweep_postfix);
352352
}
353-
cub::CTA_SYNC();
353+
__syncthreads();
354354
// Grab thread postfix from shared memory
355355
exclusive_output = *placement_ptr;
356356

@@ -382,7 +382,7 @@ struct BlockReverseScan {
382382
// }
383383
// }
384384

385-
// cub::CTA_SYNC();
385+
// __syncthreads();
386386

387387
// // Incorporate thread block postfix into outputs
388388
// T block_postfix = temp_storage.block_postfix;

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ def append_nvcc_threads(nvcc_extra_args):
195195
cc_flag.append("arch=compute_100,code=sm_100")
196196
cc_flag.append("-gencode")
197197
cc_flag.append("arch=compute_120,code=sm_120")
198+
if bare_metal_version >= Version("13.0"):
199+
cc_flag.append("-gencode")
200+
cc_flag.append("arch=compute_103,code=sm_103")
201+
cc_flag.append("-gencode")
202+
cc_flag.append("arch=compute_110,code=sm_110")
203+
cc_flag.append("-gencode")
204+
cc_flag.append("arch=compute_121,code=sm_121")
198205

199206

200207
# HACK: The compiler flag -D_GLIBCXX_USE_CXX11_ABI is set to be the same as

0 commit comments

Comments
 (0)