File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 5
5
<tests >
6
6
<test testName =" array_copy" configFile =" config/TEMPLATE_help_function.xml" />
7
7
<test testName =" assign_device_vector" configFile =" config/TEMPLATE_help_function.xml" />
8
+ <test testName =" move_device_vector" configFile =" config/TEMPLATE_help_function.xml" />
8
9
<test testName =" atomic_add_float" configFile =" config/TEMPLATE_help_function.xml" />
9
10
<test testName =" atomic_fetch_compare_inc" configFile =" config/TEMPLATE_help_function.xml" />
10
11
<test testName =" async_exception" configFile =" config/TEMPLATE_help_function.xml" />
Original file line number Diff line number Diff line change
1
+ #include < oneapi/dpl/execution>
2
+ #include < oneapi/dpl/algorithm>
3
+ #include < sycl.hpp>
4
+ #include < dpct/dpct.hpp>
5
+ #include < dpct/dpl_utils.hpp>
6
+
7
+ bool verify (dpct::device_vector<int > &D, int N, int V) {
8
+ if (D.size () != N)
9
+ return false ;
10
+ for (int i = 0 ; i < N; ++i)
11
+ if (D[i] != V)
12
+ return false ;
13
+ return true ;
14
+ }
15
+
16
+ int main (void ) {
17
+ constexpr int N = 4 ;
18
+ constexpr int V = 42 ;
19
+ // Construct D1 from move constructor.
20
+ dpct::device_vector<int > D1 (std::move (dpct::device_vector<int >(N, V)));
21
+ if (!verify (D1, N, V)) {
22
+ return 1 ;
23
+ }
24
+ // Move assign to D2.
25
+ dpct::device_vector<int > D2;
26
+ D2 = std::move (dpct::device_vector<int >(N, V));
27
+ if (!verify (D2, N, V)) {
28
+ return 1 ;
29
+ }
30
+ return 0 ;
31
+ }
You can’t perform that action at this time.
0 commit comments