Skip to content

Commit b221325

Browse files
authored
Avoid warning about unused variables (#1125)
* Avoid warning about unused variables
1 parent af1c63b commit b221325

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs_input/notebooks/gtc_lab/samples/kernel_fusion.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
2929
for (int i = 0; i < 10; i++) {
3030

3131
// first individual, independent kernels
32-
int unfused_range = MATX_NVTX_START_RANGE("Unfused Kernels");
32+
[[maybe_unused]] int unfused_range = MATX_NVTX_START_RANGE("Unfused Kernels");
3333
(result = cos(C)).run(exec);
3434
(result = result / D).run(exec);
3535
(result = result * B).run(exec);
3636
MATX_NVTX_END_RANGE(unfused_range);
3737

3838
// now, as a fused operation
39-
int fused_range = MATX_NVTX_START_RANGE("Fused Operation");
39+
[[maybe_unused]] int fused_range = MATX_NVTX_START_RANGE("Fused Operation");
4040
(A = B * cos(C)/D).run(exec);
4141
MATX_NVTX_END_RANGE(fused_range);
4242
}

examples/kernel_fusion.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
2929
for (int i = 0; i < 10; i++) {
3030

3131
// first individual, independent kernels
32-
int unfused_range = MATX_NVTX_START_RANGE("Unfused Kernels");
32+
[[maybe_unused]] int unfused_range = MATX_NVTX_START_RANGE("Unfused Kernels");
3333
(result = cos(C)).run(exec);
3434
(result = result / D).run(exec);
3535
(result = result * B).run(exec);
3636
MATX_NVTX_END_RANGE(unfused_range);
3737

3838
// now, as a fused operation
39-
int fused_range = MATX_NVTX_START_RANGE("Fused Operation");
39+
[[maybe_unused]] int fused_range = MATX_NVTX_START_RANGE("Fused Operation");
4040
(A = B * cos(C)/D).run(exec);
4141
MATX_NVTX_END_RANGE(fused_range);
42+
4243
}
4344
MATX_EXIT_HANDLER();
4445
}

0 commit comments

Comments
 (0)