Add initial SYCL implementation

This commit is contained in:
James Price 2016-05-03 14:45:13 +01:00
parent 1a38b18954
commit da4f918788
2 changed files with 14 additions and 2 deletions

View File

@ -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 ()

View File

@ -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<T>(ARRAY_SIZE, a.data(), b.data(), c.data());
#elif defined(SYCL)
// Use the SYCL implementation
stream = new SYCLStream<T>(ARRAY_SIZE, deviceIndex);
#endif
stream->write_arrays(a, b, c);
@ -285,4 +290,3 @@ void parseArguments(int argc, char *argv[])
}
}
}