Skip to content

Commit 65a98a4

Browse files
Deprecate GridBarrier and GridBarrierLifetime (#3258)
Fixes: #1389
1 parent 3d53514 commit 65a98a4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

cub/cub/grid/grid_barrier.cuh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ CUB_NAMESPACE_BEGIN
5050

5151
/**
5252
* \brief GridBarrier implements a software global barrier among thread blocks within a CUDA grid
53+
*
54+
* deprecated [Since 2.9.0]
5355
*/
54-
class GridBarrier
56+
class CCCL_DEPRECATED_BECAUSE("Use the APIs from cooperative groups instead") GridBarrier
5557
{
5658
protected:
5759
using SyncFlag = unsigned int;
@@ -131,8 +133,11 @@ public:
131133
*
132134
* Uses RAII for lifetime, i.e., device resources are reclaimed when
133135
* the destructor is called.
136+
*
137+
* deprecated [Since 2.9.0]
134138
*/
135-
class GridBarrierLifetime : public GridBarrier
139+
_CCCL_SUPPRESS_DEPRECATED_PUSH
140+
class CCCL_DEPRECATED_BECAUSE("Use the APIs from cooperative groups instead") GridBarrierLifetime : public GridBarrier
136141
{
137142
protected:
138143
// Number of bytes backed by d_sync
@@ -211,5 +216,6 @@ public:
211216
return retval;
212217
}
213218
};
219+
_CCCL_SUPPRESS_DEPRECATED_POP
214220

215221
CUB_NAMESPACE_END

cub/test/test_grid_barrier.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ using namespace cub;
4747
/**
4848
* Kernel that iterates through the specified number of software global barriers
4949
*/
50-
__global__ void Kernel(GridBarrier global_barrier, int iterations)
50+
_CCCL_SUPPRESS_DEPRECATED_PUSH
51+
__global__ void Kernel(GridBarrier global_barrier, int iterations) //
52+
_CCCL_SUPPRESS_DEPRECATED_POP
5153
{
5254
for (int i = 0; i < iterations; i++)
5355
{
@@ -126,7 +128,9 @@ int main(int argc, char** argv)
126128
fflush(stdout);
127129

128130
// Init global barrier
131+
_CCCL_SUPPRESS_DEPRECATED_PUSH
129132
GridBarrierLifetime global_barrier;
133+
_CCCL_SUPPRESS_DEPRECATED_POP
130134
global_barrier.Setup(grid_size);
131135

132136
// Time kernel

0 commit comments

Comments
 (0)