Skip to content

Commit f26e09e

Browse files
committed
Fix MSVC unused variable warnerr
1 parent f4d84af commit f26e09e

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

cub/test/catch2_test_device_histogram_env.cu

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ TEST_CASE("DeviceHistogram::HistogramRange works with default environment", "[hi
8383

8484
TEST_CASE("DeviceHistogram::MultiHistogramEven works with default environment", "[histogram][device]")
8585
{
86-
constexpr int NUM_CHANNELS = 4;
87-
constexpr int NUM_ACTIVE_CHANNELS = 3;
86+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
87+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
8888

8989
// 2 pixels: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)
9090
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
@@ -117,8 +117,8 @@ TEST_CASE("DeviceHistogram::MultiHistogramEven works with default environment",
117117

118118
TEST_CASE("DeviceHistogram::MultiHistogramRange works with default environment", "[histogram][device]")
119119
{
120-
constexpr int NUM_CHANNELS = 4;
121-
constexpr int NUM_ACTIVE_CHANNELS = 3;
120+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
121+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
122122

123123
// 2 pixels: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)
124124
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
@@ -318,8 +318,8 @@ TEST_CASE("DeviceHistogram::HistogramRange uses custom stream", "[histogram][dev
318318

319319
C2H_TEST("DeviceHistogram::MultiHistogramEven uses environment", "[histogram][device]")
320320
{
321-
constexpr int NUM_CHANNELS = 4;
322-
constexpr int NUM_ACTIVE_CHANNELS = 3;
321+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
322+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
323323

324324
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
325325
int num_pixels = 2;
@@ -365,8 +365,8 @@ C2H_TEST("DeviceHistogram::MultiHistogramEven uses environment", "[histogram][de
365365

366366
TEST_CASE("DeviceHistogram::MultiHistogramEven uses custom stream", "[histogram][device]")
367367
{
368-
constexpr int NUM_CHANNELS = 4;
369-
constexpr int NUM_ACTIVE_CHANNELS = 3;
368+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
369+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
370370

371371
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
372372
int num_pixels = 2;
@@ -420,8 +420,8 @@ TEST_CASE("DeviceHistogram::MultiHistogramEven uses custom stream", "[histogram]
420420

421421
C2H_TEST("DeviceHistogram::MultiHistogramRange uses environment", "[histogram][device]")
422422
{
423-
constexpr int NUM_CHANNELS = 4;
424-
constexpr int NUM_ACTIVE_CHANNELS = 3;
423+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
424+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
425425

426426
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
427427
int num_pixels = 2;
@@ -473,8 +473,8 @@ C2H_TEST("DeviceHistogram::MultiHistogramRange uses environment", "[histogram][d
473473

474474
TEST_CASE("DeviceHistogram::MultiHistogramRange uses custom stream", "[histogram][device]")
475475
{
476-
constexpr int NUM_CHANNELS = 4;
477-
constexpr int NUM_ACTIVE_CHANNELS = 3;
476+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
477+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
478478

479479
auto d_samples = c2h::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
480480
int num_pixels = 2;

cub/test/catch2_test_device_histogram_env_api.cu

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ C2H_TEST("cub::DeviceHistogram::MultiHistogramEven accepts env with stream (1D)"
8585
{
8686
// example-begin multi-histogram-even-1d-env
8787
// 4-channel RGBA pixels, histogram 3 active channels
88-
constexpr int NUM_CHANNELS = 4;
89-
constexpr int NUM_ACTIVE_CHANNELS = 3;
88+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
89+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
9090

9191
// clang-format off
9292
// 2 pixels: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)
@@ -137,8 +137,8 @@ C2H_TEST("cub::DeviceHistogram::MultiHistogramEven accepts env with stream (2D)"
137137
{
138138
// example-begin multi-histogram-even-2d-env
139139
// 4-channel RGBA pixels, histogram 3 active channels, 2D region
140-
constexpr int NUM_CHANNELS = 4;
141-
constexpr int NUM_ACTIVE_CHANNELS = 3;
140+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
141+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
142142

143143
// 2 rows, 2 pixels per row, with row stride = 2 pixels * 4 channels * 1 byte = 8 bytes
144144
// Row 0: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)
@@ -199,8 +199,8 @@ C2H_TEST("cub::DeviceHistogram::MultiHistogramRange accepts env with stream (1D)
199199
{
200200
// example-begin multi-histogram-range-1d-env
201201
// 4-channel RGBA pixels, histogram 3 active channels
202-
constexpr int NUM_CHANNELS = 4;
203-
constexpr int NUM_ACTIVE_CHANNELS = 3;
202+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
203+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
204204

205205
// 2 pixels: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)
206206
auto d_samples = thrust::device_vector<unsigned char>{0, 2, 1, 255, 3, 4, 2, 128};
@@ -256,8 +256,8 @@ C2H_TEST("cub::DeviceHistogram::MultiHistogramRange accepts env with stream (2D)
256256
{
257257
// example-begin multi-histogram-range-2d-env
258258
// 4-channel RGBA pixels, histogram 3 active channels, 2D region
259-
constexpr int NUM_CHANNELS = 4;
260-
constexpr int NUM_ACTIVE_CHANNELS = 3;
259+
[[maybe_unused]] constexpr int NUM_CHANNELS = 4;
260+
[[maybe_unused]] constexpr int NUM_ACTIVE_CHANNELS = 3;
261261

262262
// 2 rows, 2 pixels per row
263263
// Row 0: (R=0, G=2, B=1, A=255), (R=3, G=4, B=2, A=128)

0 commit comments

Comments
 (0)