Skip to content

Commit

Permalink
Deprecate GridBarrier and GridBarrierLifetime (#3258) (#3288)
Browse files Browse the repository at this point in the history
Fixes: #1389
  • Loading branch information
bernhardmgruber authored Jan 10, 2025
1 parent 292f3ae commit 13b8f7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cub/cub/grid/grid_barrier.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ CUB_NAMESPACE_BEGIN

/**
* \brief GridBarrier implements a software global barrier among thread blocks within a CUDA grid
*
* deprecated [Since 2.9.0]
*/
class GridBarrier
class CCCL_DEPRECATED_BECAUSE("Use the APIs from cooperative groups instead") GridBarrier
{
protected:
using SyncFlag = unsigned int;
Expand Down Expand Up @@ -131,8 +133,11 @@ public:
*
* Uses RAII for lifetime, i.e., device resources are reclaimed when
* the destructor is called.
*
* deprecated [Since 2.9.0]
*/
class GridBarrierLifetime : public GridBarrier
_CCCL_SUPPRESS_DEPRECATED_PUSH
class CCCL_DEPRECATED_BECAUSE("Use the APIs from cooperative groups instead") GridBarrierLifetime : public GridBarrier
{
protected:
// Number of bytes backed by d_sync
Expand Down Expand Up @@ -211,5 +216,6 @@ public:
return retval;
}
};
_CCCL_SUPPRESS_DEPRECATED_POP

CUB_NAMESPACE_END
6 changes: 5 additions & 1 deletion cub/test/test_grid_barrier.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ using namespace cub;
/**
* Kernel that iterates through the specified number of software global barriers
*/
__global__ void Kernel(GridBarrier global_barrier, int iterations)
_CCCL_SUPPRESS_DEPRECATED_PUSH
__global__ void Kernel(GridBarrier global_barrier, int iterations) //
_CCCL_SUPPRESS_DEPRECATED_POP
{
for (int i = 0; i < iterations; i++)
{
Expand Down Expand Up @@ -126,7 +128,9 @@ int main(int argc, char** argv)
fflush(stdout);

// Init global barrier
_CCCL_SUPPRESS_DEPRECATED_PUSH
GridBarrierLifetime global_barrier;
_CCCL_SUPPRESS_DEPRECATED_POP
global_barrier.Setup(grid_size);

// Time kernel
Expand Down

0 comments on commit 13b8f7c

Please sign in to comment.