Skip to content

Commit

Permalink
Fix compile warning from CUDF_FUNC_RANGE in a member function (#11798)
Browse files Browse the repository at this point in the history
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: #11798
  • Loading branch information
davidwendt authored Sep 29, 2022
1 parent 90afe92 commit ec4cdd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/nvtx/nvtx3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ inline void mark(event_attributes const& attr) noexcept
#define NVTX3_FUNC_RANGE_IN(D) \
static ::nvtx3::registered_message<D> const nvtx3_func_name__{__func__}; \
static ::nvtx3::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \
::nvtx3::domain_thread_range<D> const nvtx3_range__{nvtx3_func_attr__};
[[maybe_unused]] ::nvtx3::domain_thread_range<D> const nvtx3_range__{nvtx3_func_attr__};

/**
* @brief Convenience macro for generating a range in the global domain from the
Expand Down

0 comments on commit ec4cdd8

Please sign in to comment.