Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence spurious compiler warnings #3913

Merged
merged 4 commits into from
Oct 14, 2023

Conversation

seunghwak
Copy link
Contributor

We see compiler warnings basically saying some internal data member in std::optional may be used uninitialized. This lengthy warnings are very annoying and can hide important warnings/errors.

Seeing https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635, it seems like this warning is not valid and due to the fact that the compiler cannot perfectly track when an std::optional object is valid or not in every code path.

Anyways, this PR tweaks the code to silence the warnings. There is very little practical difference between the old and new code, but I don't see the annoying warnings anymore with this update.

See the below for the actual warnings.

[1/1] Building CUDA object CMakeFiles/cugraph.dir/src/structure/graph_view_mg.cu.o
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_src_property_t<GraphViewType, T>::edge_src_property_t(const raft::handle_t&, const GraphViewType&) [with GraphViewType = cugraph::graph_view_t<int, int, true, true>; T = int]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:425:13,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '((const std::size_t*)((char*)&<unnamed> + offsetof(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>,cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::keys_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::_M_payload.std::_Optional_payload<raft::span<const int, true, 18446744073709551615>, true, true, true>::<unnamed>.std::_Optional_payload_base<raft::span<const int, true, 18446744073709551615> >::_M_payload)))[1]' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20: note: '<anonymous>' declared here
  522 |       minor_tmp_buffer = edge_src_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_src_property_t<GraphViewType, T>::edge_src_property_t(const raft::handle_t&, const GraphViewType&) [with GraphViewType = cugraph::graph_view_t<int, int, true, true>; T = int]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:425:13,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(long unsigned int*)((char*)&<unnamed> + offsetof(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>,cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_size_.std::optional<long unsigned int>::<unnamed>.std::_Optional_base<long unsigned int, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20: note: '<anonymous>' declared here
  522 |       minor_tmp_buffer = edge_src_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>& cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>::operator=(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:375:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(const int**)((char*)&<unnamed> + offsetof(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>,cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::keys_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20: note: '<anonymous>' declared here
  522 |       minor_tmp_buffer = edge_src_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>& cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>::operator=(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:375:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(const int**)((char*)&<unnamed> + offsetof(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>,cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_start_offsets_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20: note: '<anonymous>' declared here
  522 |       minor_tmp_buffer = edge_src_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>& cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>::operator=(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:375:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '((std::size_t*)((char*)&<unnamed> + offsetof(cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>,cugraph::edge_src_property_t<cugraph::graph_view_t<int, int, true, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_start_offsets_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::_M_payload.std::_Optional_payload<raft::span<const int, true, 18446744073709551615>, true, true, true>::<unnamed>.std::_Optional_payload_base<raft::span<const int, true, 18446744073709551615> >::_M_payload)))[1]' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = false; GraphViewType = cugraph::graph_view_t<int, int, true, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, true, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, true, true>, 1> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:522:20: note: '<anonymous>' declared here
  522 |       minor_tmp_buffer = edge_src_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_dst_property_t<GraphViewType, T>::edge_dst_property_t(const raft::handle_t&, const GraphViewType&) [with GraphViewType = cugraph::graph_view_t<int, int, false, true>; T = int]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:527:13,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '((const std::size_t*)((char*)&<unnamed> + offsetof(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>,cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::keys_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::_M_payload.std::_Optional_payload<raft::span<const int, true, 18446744073709551615>, true, true, true>::<unnamed>.std::_Optional_payload_base<raft::span<const int, true, 18446744073709551615> >::_M_payload)))[1]' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20: note: '<anonymous>' declared here
  524 |       minor_tmp_buffer = edge_dst_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_dst_property_t<GraphViewType, T>::edge_dst_property_t(const raft::handle_t&, const GraphViewType&) [with GraphViewType = cugraph::graph_view_t<int, int, false, true>; T = int]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:527:13,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(long unsigned int*)((char*)&<unnamed> + offsetof(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>,cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_size_.std::optional<long unsigned int>::<unnamed>.std::_Optional_base<long unsigned int, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20: note: '<anonymous>' declared here
  524 |       minor_tmp_buffer = edge_dst_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>& cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>::operator=(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:467:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(const int**)((char*)&<unnamed> + offsetof(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>,cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::keys_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20: note: '<anonymous>' declared here
  524 |       minor_tmp_buffer = edge_dst_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>& cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>::operator=(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:467:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '*(const int**)((char*)&<unnamed> + offsetof(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>,cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_start_offsets_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20: note: '<anonymous>' declared here
  524 |       minor_tmp_buffer = edge_dst_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'cugraph::detail::edge_minor_property_t<int, int>& cugraph::detail::edge_minor_property_t<int, int>::operator=(cugraph::detail::edge_minor_property_t<int, int>&&)',
    inlined from 'cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>& cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>::operator=(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true>, int>&&)' at /home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:467:7,
    inlined from 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]' at /home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:18:
/home/seunghwak/RAPIDS/development/cugraph/cpp/include/cugraph/edge_src_dst_property.hpp:285:7: warning: '((std::size_t*)((char*)&<unnamed> + offsetof(cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>,cugraph::edge_dst_property_t<cugraph::graph_view_t<int, int, false, true, void>, int>::property_.cugraph::detail::edge_minor_property_t<int, int>::key_chunk_start_offsets_.std::optional<raft::span<const int, true, 18446744073709551615> >::<unnamed>.std::_Optional_base<raft::span<const int, true, 18446744073709551615>, true, true>::_M_payload.std::_Optional_payload<raft::span<const int, true, 18446744073709551615>, true, true, true>::<unnamed>.std::_Optional_payload_base<raft::span<const int, true, 18446744073709551615> >::_M_payload)))[1]' may be used uninitialized [-Wmaybe-uninitialized]
  285 | class edge_minor_property_t {
      |       ^~~~~~~~~~~~~~~~~~~~~
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh: In function 'void cugraph::detail::per_v_transform_reduce_e(const raft::handle_t&, const GraphViewType&, EdgeSrcValueInputWrapper, EdgeDstValueInputWrapper, EdgeValueInputWrapper, EdgeOp, T, ReduceOp, VertexValueOutputIterator) [with bool incoming = true; GraphViewType = cugraph::graph_view_t<int, int, false, true>; EdgeSrcValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeDstValueInputWrapper = cugraph::detail::edge_endpoint_dummy_property_view_t; EdgeValueInputWrapper = cugraph::edge_dummy_property_view_t; EdgeOp = __nv_dl_wrapper_t<__nv_dl_tag<rmm::device_uvector<int> (*)(const raft::handle_t&, const cugraph::graph_view_t<int, int, false, true>&), cugraph::_GLOBAL__N__fbd7e12b_16_graph_view_mg_cu_854a5764_83484::compute_minor_degrees<int, int, false, true>, 2> >; ReduceOp = cugraph::reduce_op::plus<int>; T = int; VertexValueOutputIterator = int*]':
/home/seunghwak/RAPIDS/development/cugraph/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh:524:20: note: '<anonymous>' declared here
  524 |       minor_tmp_buffer = edge_dst_property_t<GraphViewType, T>(handle, graph_view);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@seunghwak seunghwak added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 4, 2023
@seunghwak seunghwak added this to the 23.12 milestone Oct 4, 2023
@seunghwak seunghwak requested a review from a team as a code owner October 4, 2023 19:17
@seunghwak seunghwak self-assigned this Oct 4, 2023
using minor_tmp_buffer_type = std::conditional_t<GraphViewType::is_storage_transposed,
edge_src_property_t<GraphViewType, T>,
edge_dst_property_t<GraphViewType, T>>;
std::unique_ptr<minor_tmp_buffer_type> minor_tmp_buffer{};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an explicit std::optional<minor_tmp_buffer_type> defined here and initialized to std::nullopt also work? That's a code pattern we use quite a bit. Would that perhaps be a closer idiom to [[maybe_unused]] until the warning issue is corrected in the compiler?

Approving either way, just wondering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may work as well but std::optional is for run-time resolution. Here whether minor_tmp_buffer is used or not can be determined in compile-time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... but your comment reminded me that I didn't add [[maybe_unused]] in this update. Adding this to minor_tmp_buffer declaration.

Copy link
Contributor

@naimnv naimnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is also nice that it doesn't require if/else block.

@ChuckHastings
Copy link
Collaborator

/merge

@rapids-bot rapids-bot bot merged commit 89e884a into rapidsai:branch-23.12 Oct 14, 2023
75 checks passed
@seunghwak seunghwak deleted the enh_fix_warning branch May 22, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants