Skip to content

Commit e3c6b26

Browse files
authored
Rename device_vector -> remote_vector and device_span -> (#1612)
1 parent 21a321e commit e3c6b26

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

include/oneapi/dpl/internal/distributed_ranges_impl/shp/containers/duplicated_vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/allocators.hpp>
8-
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/device_vector.hpp>
8+
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/remote_vector.hpp>
99

1010
namespace oneapi::dpl::experimental::dr::shp
1111
{
@@ -14,7 +14,7 @@ template <typename T, typename Allocator = device_allocator<T>>
1414
class duplicated_vector
1515
{
1616
public:
17-
using segment_type = device_vector<T, Allocator>;
17+
using segment_type = remote_vector<T, Allocator>;
1818

1919
using value_type = T;
2020
using size_type = std::size_t;

include/oneapi/dpl/internal/distributed_ranges_impl/shp/distributed_span.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/iterator_adaptor.hpp>
1111
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/ranges.hpp>
1212
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp>
13-
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/device_span.hpp>
13+
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/remote_span.hpp>
1414

1515
namespace oneapi::dpl::experimental::dr::shp
1616
{
@@ -151,7 +151,7 @@ class distributed_span : public rng::view_interface<distributed_span<T, L>>
151151
using element_type = T;
152152
using value_type = std::remove_cv_t<T>;
153153

154-
using segment_type = device_span<T, L>;
154+
using segment_type = remote_span<T, L>;
155155

156156
using size_type = rng::range_size_t<segment_type>;
157157
using difference_type = rng::range_difference_t<segment_type>;

include/oneapi/dpl/internal/distributed_ranges_impl/shp/distributed_vector.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/segments_tools.hpp>
1212
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/allocators.hpp>
1313
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/device_ptr.hpp>
14-
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/device_vector.hpp>
14+
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/remote_vector.hpp>
1515
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/vector.hpp>
1616

1717
namespace oneapi::dpl::experimental::dr::shp
@@ -138,8 +138,8 @@ template <typename T, typename Allocator = device_allocator<T>>
138138
struct distributed_vector
139139
{
140140
public:
141-
using segment_type = device_vector<T, Allocator>;
142-
using const_segment_type = std::add_const_t<device_vector<T, Allocator>>;
141+
using segment_type = remote_vector<T, Allocator>;
142+
using const_segment_type = std::add_const_t<remote_vector<T, Allocator>>;
143143

144144
using value_type = T;
145145
using size_type = std::size_t;

include/oneapi/dpl/internal/distributed_ranges_impl/shp/device_span.hpp renamed to include/oneapi/dpl/internal/distributed_ranges_impl/shp/remote_span.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
namespace oneapi::dpl::experimental::dr::shp
1212
{
1313

14-
// A `device_span` is simply a normal `std::span` that's
14+
// A `remote_span` is simply a normal `std::span` that's
1515
// been decorated with an extra `rank()` function, showing
1616
// which rank its memory is located on.
1717
// (Thus fulfilling the `remote_range` concept.)
1818
/*
1919
template <class T,
2020
std::size_t Extent = std::dynamic_extent>
21-
class device_span : public std::span<T, Extent> {
21+
class remote_span : public std::span<T, Extent> {
2222
public:
23-
constexpr device_span() noexcept {}
23+
constexpr remote_span() noexcept {}
2424
2525
template< class It >
2626
explicit(Extent != std::dynamic_extent)
27-
constexpr device_span(It first, std::size_t count, std::size_t rank)
27+
constexpr remote_span(It first, std::size_t count, std::size_t rank)
2828
: rank_(rank), std::span<T, Extent>(first, count) {}
2929
3030
template< class It, class End >
3131
explicit(Extent != std::dynamic_extent)
32-
constexpr device_span(It first, End last, std::size_t rank)
32+
constexpr remote_span(It first, End last, std::size_t rank)
3333
: rank_(rank), std::span<T, Extent>(first, last) {}
3434
3535
constexpr std::size_t rank() const noexcept {
@@ -42,33 +42,33 @@ class device_span : public std::span<T, Extent> {
4242
*/
4343

4444
template <typename T, typename Iter = T*>
45-
class device_span : public span<T, Iter>
45+
class remote_span : public span<T, Iter>
4646
{
4747
public:
48-
constexpr device_span() noexcept {}
48+
constexpr remote_span() noexcept {}
4949

5050
using value_type = T;
5151
using size_type = std::size_t;
5252
using difference_type = std::size_t;
5353
using reference = std::iter_reference_t<Iter>;
5454

5555
template <rng::random_access_range R>
56-
requires(remote_range<R>) device_span(R&& r) : span<T, Iter>(rng::begin(r), rng::size(r)), rank_(ranges::rank(r))
56+
requires(remote_range<R>) remote_span(R&& r) : span<T, Iter>(rng::begin(r), rng::size(r)), rank_(ranges::rank(r))
5757
{
5858
}
5959

6060
template <rng::random_access_range R>
61-
device_span(R&& r, std::size_t rank) : span<T, Iter>(rng::begin(r), rng::size(r)), rank_(rank)
61+
remote_span(R&& r, std::size_t rank) : span<T, Iter>(rng::begin(r), rng::size(r)), rank_(rank)
6262
{
6363
}
6464

6565
template <class It>
66-
constexpr device_span(It first, std::size_t count, std::size_t rank) : span<T, Iter>(first, count), rank_(rank)
66+
constexpr remote_span(It first, std::size_t count, std::size_t rank) : span<T, Iter>(first, count), rank_(rank)
6767
{
6868
}
6969

7070
template <class It, class End>
71-
constexpr device_span(It first, End last, std::size_t rank) : span<T, Iter>(first, last), rank_(rank)
71+
constexpr remote_span(It first, End last, std::size_t rank) : span<T, Iter>(first, last), rank_(rank)
7272
{
7373
}
7474

@@ -78,32 +78,32 @@ class device_span : public span<T, Iter>
7878
return rank_;
7979
}
8080

81-
device_span
81+
remote_span
8282
first(std::size_t n) const
8383
{
84-
return device_span(this->begin(), this->begin() + n, rank_);
84+
return remote_span(this->begin(), this->begin() + n, rank_);
8585
}
8686

87-
device_span
87+
remote_span
8888
last(std::size_t n) const
8989
{
90-
return device_span(this->end() - n, this->end(), rank_);
90+
return remote_span(this->end() - n, this->end(), rank_);
9191
}
9292

93-
device_span
93+
remote_span
9494
subspan(std::size_t offset, std::size_t count) const
9595
{
96-
return device_span(this->begin() + offset, this->begin() + offset + count, rank_);
96+
return remote_span(this->begin() + offset, this->begin() + offset + count, rank_);
9797
}
9898

9999
private:
100100
std::size_t rank_;
101101
};
102102

103103
template <rng::random_access_range R>
104-
device_span(R&&) -> device_span<rng::range_value_t<R>, rng::iterator_t<R>>;
104+
remote_span(R&&) -> remote_span<rng::range_value_t<R>, rng::iterator_t<R>>;
105105

106106
template <rng::random_access_range R>
107-
device_span(R&&, std::size_t) -> device_span<rng::range_value_t<R>, rng::iterator_t<R>>;
107+
remote_span(R&&, std::size_t) -> remote_span<rng::range_value_t<R>, rng::iterator_t<R>>;
108108

109109
} // namespace oneapi::dpl::experimental::dr::shp

include/oneapi/dpl/internal/distributed_ranges_impl/shp/device_vector.hpp renamed to include/oneapi/dpl/internal/distributed_ranges_impl/shp/remove_vector.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ namespace oneapi::dpl::experimental::dr::shp
1111
{
1212

1313
template <typename T, typename Allocator>
14-
class device_vector : public vector<T, Allocator>
14+
class remote_vector : public vector<T, Allocator>
1515
{
1616
public:
17-
constexpr device_vector() noexcept {}
17+
constexpr remote_vector() noexcept {}
1818

1919
using base = vector<T, Allocator>;
2020

2121
using value_type = T;
2222
using size_type = std::size_t;
2323
using difference_type = std::size_t;
2424

25-
constexpr device_vector(size_type count, const Allocator& alloc, size_type rank) : base(count, alloc), rank_(rank)
25+
constexpr remote_vector(size_type count, const Allocator& alloc, size_type rank) : base(count, alloc), rank_(rank)
2626
{
2727
}
2828

@@ -37,6 +37,6 @@ class device_vector : public vector<T, Allocator>
3737
};
3838

3939
template <class Alloc>
40-
device_vector(std::size_t, const Alloc, std::size_t) -> device_vector<typename Alloc::value_type, Alloc>;
40+
remote_vector(std::size_t, const Alloc, std::size_t) -> remote_vector<typename Alloc::value_type, Alloc>;
4141

4242
} // namespace oneapi::dpl::experimental::dr::shp

include/oneapi/dpl/internal/distributed_ranges_impl/shp/zip_view.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/owning_view.hpp>
1111
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/ranges_shim.hpp>
1212
#include <oneapi/dpl/internal/distributed_ranges_impl/detail/view_detectors.hpp>
13-
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/device_span.hpp>
13+
#include <oneapi/dpl/internal/distributed_ranges_impl/shp/remote_span.hpp>
1414

1515
namespace oneapi::dpl::experimental::dr
1616
{
@@ -318,7 +318,7 @@ class zip_view : public rng::view_interface<zip_view<Rs...>>
318318
{
319319
if constexpr (remote_range<T>)
320320
{
321-
return device_span(std::forward<T>(t));
321+
return remote_span(std::forward<T>(t));
322322
}
323323
else
324324
{

0 commit comments

Comments
 (0)