Skip to content

Commit

Permalink
Strange
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed May 26, 2023
1 parent 2ed91b2 commit 35a752c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cub/agent/single_pass_scan_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,18 @@ __device__ __forceinline__ void delay()
template <unsigned int GridThreshold = 500>
__device__ __forceinline__ void delay(int ns)
{
NV_IF_TARGET(NV_PROVIDES_SM_70, (__nanosleep(ns);), ((void)ns;));
NV_IF_TARGET(NV_PROVIDES_SM_70,
(if (ns > 0)
{
if (gridDim.x < GridThreshold)
{
__threadfence_block();
}
else
{
__nanosleep(ns);
}
}));
}

template <unsigned int GridThreshold = 500>
Expand Down

0 comments on commit 35a752c

Please sign in to comment.