From da4f91878834f3e2e3b907003eefcb77538e0f9b Mon Sep 17 00:00:00 2001 From: James Price Date: Tue, 3 May 2016 14:45:13 +0100 Subject: [PATCH] Add initial SYCL implementation --- CMakeLists.txt | 8 ++++++++ main.cpp | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dda6cd..d43a22a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,3 +30,11 @@ else (${OpenCL_FOUND}) message("Skipping OpenCL...") endif (${OpenCL_FOUND}) +# TODO: Find SYCL implementations somehow +if (true) + add_executable(gpu-stream-sycl main.cpp SYCLStream.cpp) + target_compile_definitions(gpu-stream-sycl PUBLIC SYCL) + set_property(TARGET gpu-stream-sycl PROPERTY CXX_STANDARD 14) +else () + message("Skipping SYCL...") +endif () diff --git a/main.cpp b/main.cpp index 209fc98..f12a7e1 100644 --- a/main.cpp +++ b/main.cpp @@ -24,7 +24,8 @@ #include "OCLStream.h" #elif defined(ACC) #include "ACCStream.h" - +#elif defined(SYCL) +#include "SYCLStream.h" #endif @@ -87,6 +88,10 @@ void run() // Use the OpenACC implementation stream = new ACCStream(ARRAY_SIZE, a.data(), b.data(), c.data()); +#elif defined(SYCL) + // Use the SYCL implementation + stream = new SYCLStream(ARRAY_SIZE, deviceIndex); + #endif stream->write_arrays(a, b, c); @@ -285,4 +290,3 @@ void parseArguments(int argc, char *argv[]) } } } -