@@ -30,6 +30,11 @@ struct Placeholder
30
30
int n;
31
31
};
32
32
33
+ struct PlaceholderWithoutMemory
34
+ {
35
+ int n;
36
+ };
37
+
33
38
template <typename MemorySpace>
34
39
struct ArborX ::AccessTraits<Placeholder<MemorySpace>>
35
40
{
@@ -43,6 +48,19 @@ struct ArborX::AccessTraits<Placeholder<MemorySpace>>
43
48
}
44
49
};
45
50
51
+ template <>
52
+ struct ArborX ::AccessTraits<PlaceholderWithoutMemory>
53
+ {
54
+ using Self = PlaceholderWithoutMemory;
55
+ using memory_space = Kokkos::DefaultExecutionSpace::memory_space;
56
+
57
+ KOKKOS_FUNCTION static auto size (Self const &self) { return self.n ; }
58
+ KOKKOS_FUNCTION static auto get (Self const &, int i)
59
+ {
60
+ return ArborX::Point<2 >{(float )i, (float )i};
61
+ }
62
+ };
63
+
46
64
struct IntersectsTag
47
65
{};
48
66
struct IntersectsWithRadiusTag
@@ -131,22 +149,32 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(make_predicates, DeviceType, ARBORX_DEVICE_TYPES)
131
149
v.data (), v.size ()));
132
150
133
151
Placeholder<MemorySpace> points_access{3 };
152
+ PlaceholderWithoutMemory points_access_nomem{3 };
134
153
135
154
BOOST_TEST (checkPredicates (IntersectsTag{}, space,
136
155
make_intersects (points_view), points_view));
137
156
BOOST_TEST (checkPredicates (IntersectsTag{}, space,
138
157
make_intersects (points_access), points_access));
158
+ BOOST_TEST (checkPredicates (IntersectsTag{}, space,
159
+ make_intersects (points_access_nomem),
160
+ points_access_nomem));
139
161
140
162
float r = 1 .f ;
141
163
BOOST_TEST (checkPredicates (IntersectsWithRadiusTag{}, space,
142
164
make_intersects (points_view, r), points_view, r));
143
165
BOOST_TEST (checkPredicates (IntersectsWithRadiusTag{}, space,
144
166
make_intersects (points_access, r), points_access,
145
167
r));
168
+ BOOST_TEST (checkPredicates (IntersectsWithRadiusTag{}, space,
169
+ make_intersects (points_access_nomem, r),
170
+ points_access_nomem, r));
146
171
147
172
int const k = 3 ;
148
173
BOOST_TEST (checkPredicates (NearestTag{}, space, make_nearest (points_view, k),
149
174
points_view, k));
150
175
BOOST_TEST (checkPredicates (NearestTag{}, space,
151
176
make_nearest (points_access, k), points_access, k));
177
+ BOOST_TEST (checkPredicates (NearestTag{}, space,
178
+ make_nearest (points_access_nomem, k),
179
+ points_access_nomem, k));
152
180
}
0 commit comments