From ec4cdd8c010736c09135edf4e35be345c1c1ada1 Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:16:07 -0400 Subject: [PATCH] Fix compile warning from CUDF_FUNC_RANGE in a member function (#11798) Compile warning was introduced in #11652 in `bgzip_data_chunk_source.cu`. The warning can be seen here https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cudf/job/prb/job/cudf-cpu-cuda-build/CUDA=11.5/12417/consoleFull (search for `177-D`) ``` /cudf/cpp/src/io/text/bgzip_data_chunk_source.cu(362): warning #177-D: variable "nvtx3_range__" was declared but never referenced ``` The `nvtx3_range__` is part of the `CUDF_FUNC_RANGE()` macro. The warning is incorrect and likely a compiler bug. The workaround in this PR is to add `[[maybe_unused]]` to the variable declaration. I was not able to create a small reproducer for compile bug filing. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Tobias Ribizel (https://github.com/upsj) - MithunR (https://github.com/mythrocks) URL: https://github.com/rapidsai/cudf/pull/11798 --- cpp/include/cudf/detail/nvtx/nvtx3.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cudf/detail/nvtx/nvtx3.hpp b/cpp/include/cudf/detail/nvtx/nvtx3.hpp index fb90ea668f5..c77714181ef 100644 --- a/cpp/include/cudf/detail/nvtx/nvtx3.hpp +++ b/cpp/include/cudf/detail/nvtx/nvtx3.hpp @@ -1907,7 +1907,7 @@ inline void mark(event_attributes const& attr) noexcept #define NVTX3_FUNC_RANGE_IN(D) \ static ::nvtx3::registered_message const nvtx3_func_name__{__func__}; \ static ::nvtx3::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \ - ::nvtx3::domain_thread_range const nvtx3_range__{nvtx3_func_attr__}; + [[maybe_unused]] ::nvtx3::domain_thread_range const nvtx3_range__{nvtx3_func_attr__}; /** * @brief Convenience macro for generating a range in the global domain from the