Skip to content

Instantly share code, notes, and snippets.

@wphicks
Created September 22, 2023 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wphicks/2c791336955a33f9f74dbb50629e2fd4 to your computer and use it in GitHub Desktop.
Save wphicks/2c791336955a33f9f74dbb50629e2fd4 to your computer and use it in GitHub Desktop.
SFINAE error from raft::copy(res, some_const_mdspan, other_mdspan)
/home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp: In member function 'virtual void raft::MDSpanCopy_Uncopyable_Test::TestBody()':
/home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:34:13: error: no matching function for call to 'copy(raft::resources&, std::experimental::mdspan<const float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<std::experimental::default_accessor<const float>, raft::memory_type::host> >, raft::mdarray<float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<raft::host_vector_policy<float, std::allocator<float> >, raft::memory_type::host> >&)'
34 | raft::copy(res, std::as_const(out).view(), in);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/whicks/proj_raft/raft/cpp/include/raft/core/interruptible.hpp:26,
from /home/whicks/proj_raft/raft/cpp/include/raft/core/stream_view.hpp:20,
from /home/whicks/proj_raft/raft/cpp/include/raft/core/resource/stream_view.hpp:19,
from /home/whicks/proj_raft/raft/cpp/include/raft/core/detail/copy.hpp:26,
from /home/whicks/proj_raft/raft/cpp/include/raft/core/copy.hpp:18,
from /home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:20:
/home/whicks/proj_raft/raft/cpp/include/raft/util/cudart_utils.hpp:146:6: note: candidate: 'template<class Type> void raft::copy(Type*, const Type*, size_t, rmm::cuda_stream_view)'
146 | void copy(Type* dst, const Type* src, size_t len, rmm::cuda_stream_view stream)
| ^~~~
/home/whicks/proj_raft/raft/cpp/include/raft/util/cudart_utils.hpp:146:6: note: template argument deduction/substitution failed:
/home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:34:13: note: mismatched types 'Type*' and 'raft::resources'
34 | raft::copy(res, std::as_const(out).view(), in);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:20:
/home/whicks/proj_raft/raft/cpp/include/raft/core/copy.hpp:61:61: note: candidate: 'template<class DstType, class SrcType> raft::detail::mdspan_copyable_not_with_kernel_t<DstType, SrcType> raft::copy(const raft::resources&, DstType&&, SrcType&&)'
61 | detail::mdspan_copyable_not_with_kernel_t<DstType, SrcType> copy(resources const& res,
| ^~~~
/home/whicks/proj_raft/raft/cpp/include/raft/core/copy.hpp:61:61: note: template argument deduction/substitution failed:
In file included from /home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/bits/move.h:57,
from /home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/bits/stl_pair.h:59,
from /home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/bits/stl_algobase.h:64,
from /home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/bits/specfun.h:45,
from /home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/cmath:1935,
from /home/whicks/proj_raft/raft/cpp/test/core/../test_utils.h:19,
from /home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:17:
/home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/home/whicks/proj_raft/raft/cpp/include/raft/core/detail/copy.hpp:230:7: required by substitution of 'template<class DstType, class SrcType, class T> using mdspan_copyable_not_with_kernel_t = std::enable_if_t<mdspan_copyable_not_with_kernel_v<DstType, SrcType>, T> [with DstType = std::experimental::mdspan<const float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<std::experimental::default_accessor<const float>, raft::memory_type::host> >; SrcType = raft::mdarray<float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<raft::host_vector_policy<float, std::allocator<float> >, raft::memory_type::host> >&; T = void]'
/home/whicks/proj_raft/raft/cpp/include/raft/core/copy.hpp:61:61: required by substitution of 'template<class DstType, class SrcType> raft::detail::mdspan_copyable_not_with_kernel_t<DstType, SrcType> raft::copy(const raft::resources&, DstType&&, SrcType&&) [with DstType = std::experimental::mdspan<const float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<std::experimental::default_accessor<const float>, raft::memory_type::host> >; SrcType = raft::mdarray<float, std::experimental::extents<unsigned int, 18446744073709551615>, std::experimental::layout_right, raft::host_device_accessor<raft::host_vector_policy<float, std::allocator<float> >, raft::memory_type::host> >&]'
/home/whicks/proj_raft/raft/cpp/test/core/mdspan_copy.cpp:34:13: required from here
/home/whicks/miniconda3/envs/raft_dev/x86_64-conda-linux-gnu/include/c++/11.4.0/type_traits:2579:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2579 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment