Skip to content

Commit

Permalink
refactor(sycl): do not override CMAKE_CXX_COMPILER
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pranav-sivaraman committed Jan 24, 2024
1 parent 0e57e55 commit bd7741e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions src/sycl/fasten.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ template <size_t PPWI> class IMPL_CLS final : public Bude<PPWI> {
queue.submit([&](sycl::handler &h) { h.copy(energies.get_access<R>(h), sample.energies.data()); });
queue.wait_and_throw();
auto deviceToHostEnd = now();

sample.deviceToHost = {deviceToHostStart, deviceToHostEnd};

return sample;
Expand Down
7 changes: 0 additions & 7 deletions src/sycl/model.cmake
Original file line number Diff line number Diff line change
@@ -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++")
Expand Down Expand Up @@ -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 ()
Expand Down

0 comments on commit bd7741e

Please sign in to comment.