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

WIP: Implement SYCL functions for explicit memory operations #253

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

keryell
Copy link
Member

@keryell keryell commented Jul 19, 2019

Start implementing #66 for @jeffhammond

Prefer item<> to id<> because we can use some range information too in
the test cases, use ge_linear_id() and other goodies.
@jeffhammond
Copy link

Am I doing something wrong in the PRK or should I not be testing this yet?

jrhammon-mac02:Cxx11 jrhammon$ make sycl
g++-9 -std=gnu++17 -pthread -O3 -Wall -std=c++17 -fopenmp -DPRKVERSION="2.16" -I./triSYCL/include  -I./boostall/libs/circular_buffer/include -I./boostall/libs/compute/include -I./boostall/libs/config/include -I./boostall/libs/core/include -I./boostall/libs/log/include -I./boostall/libs/array/include -I./boostall/libs/multi_array/include -I./boostall/libs/optional/include -I./boostall/libs/preprocessor/include -I./boostall/libs/type_index/include -I./boostall/libs/utility/include -I./boostall/libs/assert/include -I./boostall/libs/static_assert/include -I./boostall/libs/exception/include -I./boostall/libs/throw_exception/include -I./boostall/libs/concept_check/include -I./boostall/libs/type_traits/include -I./boostall/libs/iterator/include -I./boostall/libs/mpl/include -I./boostall/libs/detail/include -I./boostall/libs/functional/include -I./boostall/libs/move/include -I./boostall/libs/range/include -DTRISYCL -DUSE_BOOST_IRANGE  -I./boostall/libs/circular_buffer/include -I./boostall/libs/compute/include -I./boostall/libs/config/include -I./boostall/libs/core/include -I./boostall/libs/log/include -I./boostall/libs/array/include -I./boostall/libs/multi_array/include -I./boostall/libs/optional/include -I./boostall/libs/preprocessor/include -I./boostall/libs/type_index/include -I./boostall/libs/utility/include -I./boostall/libs/assert/include -I./boostall/libs/static_assert/include -I./boostall/libs/exception/include -I./boostall/libs/throw_exception/include -I./boostall/libs/concept_check/include -I./boostall/libs/type_traits/include -I./boostall/libs/iterator/include -I./boostall/libs/mpl/include -I./boostall/libs/detail/include -I./boostall/libs/functional/include -I./boostall/libs/move/include -I./boostall/libs/range/include -DUSE_SYCL -DUSE_2D_INDEXING=0 -DUSE_BOOST_IRANGE  -I./boostall/libs/circular_buffer/include -I./boostall/libs/compute/include -I./boostall/libs/config/include -I./boostall/libs/core/include -I./boostall/libs/log/include -I./boostall/libs/array/include -I./boostall/libs/multi_array/include -I./boostall/libs/optional/include -I./boostall/libs/preprocessor/include -I./boostall/libs/type_index/include -I./boostall/libs/utility/include -I./boostall/libs/assert/include -I./boostall/libs/static_assert/include -I./boostall/libs/exception/include -I./boostall/libs/throw_exception/include -I./boostall/libs/concept_check/include -I./boostall/libs/type_traits/include -I./boostall/libs/iterator/include -I./boostall/libs/mpl/include -I./boostall/libs/detail/include -I./boostall/libs/functional/include -I./boostall/libs/move/include -I./boostall/libs/range/include -DUSE_RANGES transpose-explicit-sycl.cc -o transpose-explicit-sycl
transpose-explicit-sycl.cc: In instantiation of 'void run(trisycl::queue&, int, size_t) [with T = float; size_t = long unsigned int]':
transpose-explicit-sycl.cc:269:43:   required from here
transpose-explicit-sycl.cc:156:9: error: cannot bind non-const lvalue reference of type 'float*&' to an rvalue of type 'float*'
  156 |         h.copy(B,h_B.data());
      |         ^
In file included from ./triSYCL/include/triSYCL/buffer.hpp:25,
                 from ./triSYCL/include/triSYCL/sycl.hpp:51,
                 from ./triSYCL/include/CL/sycl.hpp:10,
                 from transpose-explicit-sycl.cc:52:
./triSYCL/include/triSYCL/handler.hpp:511:44: note:   initializing argument 2 of 'void trisycl::handler::copy(AccessorSrc&, AccessorDst&) [with AccessorSrc = trisycl::accessor<float, 1, trisycl::access::mode::read, trisycl::access::target::global_buffer>; AccessorDst = float*]'
  511 |   void copy(AccessorSrc &src, AccessorDst &dst) {
      |                               ~~~~~~~~~~~~~^~~
transpose-explicit-sycl.cc:171:3: warning: catching polymorphic type 'class std::exception' by value [-Wcatch-value=]
  171 |   catch (std::exception e) {
      |   ^~~~~
transpose-explicit-sycl.cc: In instantiation of 'void run(trisycl::queue&, int, size_t) [with T = double; size_t = long unsigned int]':
transpose-explicit-sycl.cc:270:44:   required from here
transpose-explicit-sycl.cc:156:9: error: cannot bind non-const lvalue reference of type 'double*&' to an rvalue of type 'double*'
  156 |         h.copy(B,h_B.data());
      |         ^
In file included from ./triSYCL/include/triSYCL/buffer.hpp:25,
                 from ./triSYCL/include/triSYCL/sycl.hpp:51,
                 from ./triSYCL/include/CL/sycl.hpp:10,
                 from transpose-explicit-sycl.cc:52:
./triSYCL/include/triSYCL/handler.hpp:511:44: note:   initializing argument 2 of 'void trisycl::handler::copy(AccessorSrc&, AccessorDst&) [with AccessorSrc = trisycl::accessor<double, 1, trisycl::access::mode::read, trisycl::access::target::global_buffer>; AccessorDst = double*]'
  511 |   void copy(AccessorSrc &src, AccessorDst &dst) {
      |                               ~~~~~~~~~~~~~^~~
transpose-explicit-sycl.cc:171:3: warning: catching polymorphic type 'class std::exception' by value [-Wcatch-value=]
  171 |   catch (std::exception e) {
      |   ^~~~~
In file included from ./triSYCL/include/triSYCL/buffer.hpp:27,
                 from ./triSYCL/include/triSYCL/sycl.hpp:51,
                 from ./triSYCL/include/CL/sycl.hpp:10,
                 from transpose-explicit-sycl.cc:52:
./triSYCL/include/triSYCL/queue.hpp:320:9: error: 'trisycl::event trisycl::queue::submit(Handler_Functor) [with Handler_Functor = run(trisycl::queue&, int, size_t) [with T = float; size_t = long unsigned int]::<lambda(trisycl::handler&)>]', declared using local type 'run(trisycl::queue&, int, size_t) [with T = float; size_t = long unsigned int]::<lambda(trisycl::handler&)>', is used but never defined [-fpermissive]
  320 |   event submit(Handler_Functor cgf) {
      |         ^~~~~~
./triSYCL/include/triSYCL/queue.hpp:320:9: error: 'trisycl::event trisycl::queue::submit(Handler_Functor) [with Handler_Functor = run(trisycl::queue&, int, size_t) [with T = double; size_t = long unsigned int]::<lambda(trisycl::handler&)>]', declared using local type 'run(trisycl::queue&, int, size_t) [with T = double; size_t = long unsigned int]::<lambda(trisycl::handler&)>', is used but never defined [-fpermissive]
make: *** [transpose-explicit-sycl] Error 1
jrhammon-mac02:Cxx11 jrhammon$ git diff
diff --git a/Cxx11/transpose-explicit-sycl.cc b/Cxx11/transpose-explicit-sycl.cc
index cedeafd6..51efd5a6 100644
--- a/Cxx11/transpose-explicit-sycl.cc
+++ b/Cxx11/transpose-explicit-sycl.cc
@@ -333,7 +333,7 @@ int main(int argc, char * argv[])
 #endif
     return 1;
   }
-  catch (std::exception e) {
+  catch (std::exception & e) {
     std::cout << e.what() << std::endl;
     return 1;
   }

@keryell
Copy link
Member Author

keryell commented Sep 12, 2019

It looks like the member function to copy between an accessor and a host pointer is not implemented yet... :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants