-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbhomerding.cpp
More file actions
40 lines (33 loc) · 1.08 KB
/
Copy pathbhomerding.cpp
File metadata and controls
40 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <CL/sycl.hpp>
#include <iostream>
#include "pretty_name.h"
using namespace cl::sycl;
int main() {
double num = 0.0;
//queue q;
auto pi = 3.14;
auto two = 2;
auto pipowtwo = ::pow(pi, two);
std::cout << cool::pretty_name(pi) << ' ' << cool::pretty_name(two) << ' '
<< cool::pretty_name(pipowtwo) << '\n';
#if 0
{
buffer<double> buf{&num, 1};
q.submit([&](handler& h) {
auto num = buf.get_access<access::mode::write>(h);
h.parallel_for<class test>(range<1>(1), [=](item<1> i) {
// Assume this code is passed in from a RAJA Lambda
using cl::sycl::pow; // <- Existing RAJA/Kokkos kernels require
// edit
num[i] = ::pow(
3.14,
2); // <- error: no matching function for call to 'pow'
num[i] =
pow(3.14, 2.); // <- This one works, required another edit.
});
});
}
std::cout << num << std::endl;
#endif
return 0;
}