diff --git a/CMakeLists.txt b/CMakeLists.txt index dfdba1b..b1cc63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project (SyclSTL) enable_testing() -option(PARALLEL_STL_BENCHMARKS "Build the internal benchmarks" OFF) -option(USE_COMPUTECPP "Use ComputeCPP" ON) +option(PARALLEL_STL_BENCHMARKS "Build the internal benchmarks" ON) +option(USE_COMPUTECPP "Use ComputeCPP" OFF) message(STATUS " Path to CMAKE source directory: ${CMAKE_SOURCE_DIR} ") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/) @@ -27,8 +27,8 @@ if (USE_COMPUTECPP) else() - message(STATUS " Using triSYCL CMake") - include(FindTriSYCL) + message(STATUS " Using alternate CMake") + # include(FindTriSYCL) endif() @@ -37,8 +37,10 @@ include_directories("include") add_subdirectory (src) add_subdirectory (examples) -add_subdirectory (tests) +# add_subdirectory (tests) +add_definitions(-fsycl) +add_link_options(-fsycl) if (PARALLEL_STL_BENCHMARKS) add_subdirectory (benchmarks) endif() diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 16d3ab7..07cb786 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -12,8 +12,9 @@ foreach(file ${EXAMPLE_FILES}) target_link_libraries(${SOURCE_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT}) - add_sycl_to_target(${SOURCE_NAME} ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_NAME}.cpp) + # add_sycl_to_target(${SOURCE_NAME} ${CMAKE_CURRENT_BINARY_DIR} + # ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_NAME}.cpp) + target_compile_options(${SOURCE_NAME} PRIVATE -fsycl) endforeach() diff --git a/benchmarks/sycl_reduce.cpp b/benchmarks/sycl_reduce.cpp index 4671c9a..2ebcbc6 100644 --- a/benchmarks/sycl_reduce.cpp +++ b/benchmarks/sycl_reduce.cpp @@ -56,7 +56,7 @@ benchmark<>::time_units_t benchmark_reduce(const unsigned numReps, cl::sycl::queue q(cds); auto device = q.get_device(); const cl::sycl::id<3> maxWorkItemSizes = - device.get_info(); + device.get_info>(); const auto local = std::min( device.get_info(), maxWorkItemSizes[0]); diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9e73aa2..eec4b25 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,7 +13,9 @@ foreach(file ${BENCHMARK_FILES}) target_compile_options(${SOURCE_NAME} PUBLIC ${HOST_COMPILER_OPTIONS}) target_link_libraries(${SOURCE_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT}) - add_sycl_to_target(${SOURCE_NAME} ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_NAME}.cpp ) + # add_sycl_to_target(${SOURCE_NAME} ${CMAKE_CURRENT_BINARY_DIR} + # ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_NAME}.cpp ) +add_definitions(-fsycl) +add_link_options(-fsycl) endforeach() diff --git a/include/sycl/algorithm/buffer_algorithms.hpp b/include/sycl/algorithm/buffer_algorithms.hpp index 5c4adf2..14b5fdd 100644 --- a/include/sycl/algorithm/buffer_algorithms.hpp +++ b/include/sycl/algorithm/buffer_algorithms.hpp @@ -87,8 +87,8 @@ sycl_algorithm_descriptor compute_mapreduce_descriptor(cl::sycl::device device, size_t max_work_group = device.get_info(); - const cl::sycl::id<3>max_work_item_sizes = - device.get_info(); + const auto max_work_item_sizes = + device.get_info>(); const auto max_work_item = min( device.get_info(), max_work_item_sizes[0]); @@ -344,7 +344,7 @@ sycl_algorithm_descriptor compute_mapscan_descriptor(cl::sycl::device device, size_t nb_work_group = up_rounded_division(size, size_per_work_group); const cl::sycl::id<3> max_work_item_sizes = - device.get_info(); + device.get_info>(); const auto max_work_item = min( device.get_info(), max_work_item_sizes[0]); diff --git a/include/sycl/algorithm/sort.hpp b/include/sycl/algorithm/sort.hpp index 026425e..b1b6518 100644 --- a/include/sycl/algorithm/sort.hpp +++ b/include/sycl/algorithm/sort.hpp @@ -155,7 +155,7 @@ void sequential_sort(cl::sycl::queue q, cl::sycl::buffer buf, size_t vectorSize) { auto f = [buf, vectorSize](cl::sycl::handler &h) mutable { auto a = buf.template get_access(h); - h.single_task(sort_kernel_sequential(a, vectorSize)); + // h.single_task(sort_kernel_sequential(a, vectorSize)); }; q.submit(f); } diff --git a/include/sycl/execution_policy b/include/sycl/execution_policy index be47cf9..5232fa0 100644 --- a/include/sycl/execution_policy +++ b/include/sycl/execution_policy @@ -106,7 +106,7 @@ class sycl_execution_policy { cl::sycl::nd_range<1> calculateNdRange(size_t problemSize) { const auto& d = m_q.get_device(); const cl::sycl::id<3> maxWorkItemSizes = - d.template get_info(); + d.template get_info>(); const auto localSize = std::min(problemSize, std::min( d.template get_info(), diff --git a/include/sycl/helpers/sycl_namegen.hpp b/include/sycl/helpers/sycl_namegen.hpp index 75a40ec..e2d0b76 100644 --- a/include/sycl/helpers/sycl_namegen.hpp +++ b/include/sycl/helpers/sycl_namegen.hpp @@ -35,7 +35,7 @@ #define _EXPERIMENTAL_DETAIL_SYCL_NAMEGEN__ namespace cl { -namespace sycl { +using namespace sycl; namespace helpers { /** @@ -47,6 +47,5 @@ template class NameGen {}; } } -} #endif // _EXPERIMENTAL_DETAIL_SYCL_NAMEGEN__ \ No newline at end of file diff --git a/tests/pstl-tests/CMakeLists.txt b/tests/pstl-tests/CMakeLists.txt index a02392f..e94aaac 100644 --- a/tests/pstl-tests/CMakeLists.txt +++ b/tests/pstl-tests/CMakeLists.txt @@ -9,8 +9,9 @@ function(compile_test source) PUBLIC "${CMAKE_THREAD_LIBS_INIT}") add_dependencies(${test_name} gtest_main) add_dependencies(${test_name} gtest) - add_sycl_to_target(${test_name} ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/${source}) + # add_sycl_to_target(${test_name} ${CMAKE_CURRENT_BINARY_DIR} + # ${CMAKE_CURRENT_SOURCE_DIR}/${source}) + target_compile_options(${test_name} PRIVATE -fsycl) add_test(test.${test_name} ${test_name}) endfunction()