From bd7741e071dabda2fcfe3d994e393c9a405c7448 Mon Sep 17 00:00:00 2001 From: Pranav Sivaraman <14294205+pranav-sivaraman@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:21:42 -0800 Subject: [PATCH] refactor(sycl): do not override CMAKE_CXX_COMPILER Spack injects its own compiler wrappers which rpath shared libraries for us and also any user defined flags. Therefore we do not want to set the compiler in this scenario. --- src/sycl/fasten.hpp | 1 + src/sycl/model.cmake | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/sycl/fasten.hpp b/src/sycl/fasten.hpp index e709214..c33ca4e 100644 --- a/src/sycl/fasten.hpp +++ b/src/sycl/fasten.hpp @@ -233,6 +233,7 @@ template class IMPL_CLS final : public Bude { queue.submit([&](sycl::handler &h) { h.copy(energies.get_access(h), sample.energies.data()); }); queue.wait_and_throw(); auto deviceToHostEnd = now(); + sample.deviceToHost = {deviceToHostStart, deviceToHostEnd}; return sample; diff --git a/src/sycl/model.cmake b/src/sycl/model.cmake index 6a517c1..65b5b52 100644 --- a/src/sycl/model.cmake +++ b/src/sycl/model.cmake @@ -1,4 +1,3 @@ - register_flag_optional(CMAKE_CXX_COMPILER "Any CXX compiler that is supported by CMake detection, this is used for host compilation when required by the SYCL compiler" "c++") @@ -60,18 +59,12 @@ macro(setup) set(COMPUTECPP_USER_FLAGS -O3 -no-serial-memop) elseif (${SYCL_COMPILER} STREQUAL "DPCPP") - set(CMAKE_CXX_COMPILER ${SYCL_COMPILER_DIR}/bin/clang++) - include_directories(${SYCL_COMPILER_DIR}/include/sycl) register_append_cxx_flags(ANY -fsycl) register_append_link_flags(-fsycl) elseif (${SYCL_COMPILER} STREQUAL "ONEAPI-ICPX") - set(CMAKE_CXX_COMPILER icpx) - set(CMAKE_C_COMPILER icx) register_append_cxx_flags(ANY -fsycl) register_append_link_flags(-fsycl) elseif (${SYCL_COMPILER} STREQUAL "ONEAPI-Clang") - set(CMAKE_CXX_COMPILER clang++) - set(CMAKE_C_COMPILER clang) register_append_cxx_flags(ANY -fsycl) register_append_link_flags(-fsycl) else ()