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

mdspan/mdarray template functions and utilities #601

Merged
merged 25 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
119d75b
working through is_device_mdspan
divyegala Mar 30, 2022
c205a40
Merge remote-tracking branch 'upstream/branch-22.06' into imp-22.06-l…
divyegala Mar 30, 2022
b6799f5
specializations for is_mdspan
divyegala Mar 30, 2022
3451b07
flatten and tests
divyegala Mar 30, 2022
1eb7565
checking for derived mdspan
divyegala Apr 1, 2022
fb2de54
working flatten for mdarray and mdspan
divyegala Apr 6, 2022
6539936
add copyright
divyegala Apr 6, 2022
eb400c6
working through reshape
divyegala Apr 19, 2022
27c5c19
finishing up host/device flatten with tests
divyegala Apr 19, 2022
ff282f3
working host reshape with tests
divyegala Apr 19, 2022
b8aec4c
working reshape for device arrays
divyegala Apr 19, 2022
ceb7dd4
adding docstrings
divyegala Apr 19, 2022
fa88e23
Apply suggestions from code review
divyegala Apr 20, 2022
e3f52ce
static extents tests, some variable renaming
divyegala Apr 21, 2022
95e66b9
Merge remote-tracking branch 'origin/fea-22.06-mdspan_utils' into fea…
divyegala Apr 21, 2022
de6bea6
merging upstream
divyegala Apr 21, 2022
4fc4a5d
working array_interface
divyegala Apr 21, 2022
f87d02f
small fix to docstring
divyegala Apr 21, 2022
30d878c
removing unneeded aliases from array_interface
divyegala Apr 21, 2022
65e54a5
using array_interface with CRTP
divyegala Apr 27, 2022
8659b39
Merge remote-tracking branch 'upstream/branch-22.06' into fea-22.06-m…
divyegala Apr 27, 2022
66ade4b
remove implict operator converters of mdspan from mdarray
divyegala Apr 27, 2022
a407aee
remove flatten overloads
divyegala Apr 27, 2022
7848219
explicit cstddef include
divyegala Apr 28, 2022
30d0b8b
stddef.h
divyegala Apr 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/include/raft/detail/mdarray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
#pragma once
#include <experimental/mdspan>
#include <raft/cudart_utils.h>
#include <raft/detail/span.hpp> // dynamic_extent
#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
Expand Down Expand Up @@ -58,7 +59,7 @@ class device_reference {
auto operator=(T const& other) -> device_reference&
{
auto* raw = ptr_.get();
update_device(raw, &other, 1, stream_);
raft::update_device(raw, &other, 1, stream_);
return *this;
}
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/distance/distance.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void distance(raft::handle_t const& handle,
RAFT_EXPECTS(x.is_contiguous(), "Input x must be contiguous.");
RAFT_EXPECTS(y.is_contiguous(), "Input y must be contiguous.");

auto is_rowmajor = std::is_same<layout, layout_c_contiguous>::value;
constexpr auto is_rowmajor = std::is_same_v<layout, layout_c_contiguous>;

distance<distanceType, InType, AccType, OutType, Index_>(x.data(),
y.data(),
Expand Down Expand Up @@ -433,7 +433,7 @@ void pairwise_distance(raft::handle_t const& handle,
RAFT_EXPECTS(y.is_contiguous(), "Input y must be contiguous.");
RAFT_EXPECTS(dist.is_contiguous(), "Output must be contiguous.");

bool rowmajor = x.stride(0) == 0;
constexpr auto rowmajor = std::is_same_v<layout, layout_c_contiguous>;

rmm::device_uvector<char> workspace(0, handle.get_stream());

Expand Down
Loading