Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with current DPC++ #203

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ else()
set(ENABLE_ACC_CHECK OFF)
endif()

option(CELERITY_USE_MIMALLOC "Use the mimalloc memory allocator" ON)
option(CELERITY_ACCESSOR_BOUNDARY_CHECK "Enable accessor boundary check" ${ENABLE_ACC_CHECK})

if(CELERITY_ACCESSOR_BOUNDARY_CHECK)
Expand Down Expand Up @@ -119,6 +118,15 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake Build Type" FORCE)
endif()

if(CELERITY_SYCL_IMPL STREQUAL "DPC++")
# See https://github.com/oneapi-src/unified-runtime/issues/803
message(STATUS "Not enabling mimalloc by default because it breaks with oneAPI plugin loading")
set(CELERITY_USE_MIMALLOC_DEFAULT OFF)
else()
set(CELERITY_USE_MIMALLOC_DEFAULT ON)
endif()
option(CELERITY_USE_MIMALLOC "Use the mimalloc memory allocator" ${CELERITY_USE_MIMALLOC_DEFAULT})

# 3rdparty dependencies
include(FetchContent)

Expand Down
4 changes: 3 additions & 1 deletion cmake/celerity-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ find_dependency(fmt REQUIRED)
find_dependency(spdlog REQUIRED)
find_dependency(small_vector REQUIRED)
find_dependency(libenvpp REQUIRED)
find_dependency(mimalloc REQUIRED)
if(@CELERITY_USE_MIMALLOC@)
find_dependency(mimalloc REQUIRED)
endif()
if(@CELERITY_ENABLE_CUDA_BACKEND@)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17")
find_dependency(CUDAToolkit REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion src/worker_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ namespace detail {
try {
const auto info = m_buffer_mngr.access_device_buffer(bid, mode, sr);
#if CELERITY_ACCESSOR_BOUNDARY_CHECK
auto* const oob_idx = sycl::malloc_shared<id<3>>(2, m_queue.get_sycl_queue());
auto* const oob_idx = sycl::malloc_host<id<3>>(2, m_queue.get_sycl_queue());
assert(oob_idx != nullptr);
constexpr size_t size_t_max = std::numeric_limits<size_t>::max();
const auto buffer_dims = m_buffer_mngr.get_buffer_info(bid).dimensions;
Expand Down
7 changes: 7 additions & 0 deletions test/backend_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ TEMPLATE_TEST_CASE_SIG("memcpy_strided_device allows to copy between the same de
const size_t platform_id = GENERATE(Catch::Generators::range(size_t(0), sycl::platform::get_platforms().size()));
const auto test_type = GENERATE(copy_test_type::intra_device, copy_test_type::inter_device, copy_test_type::host_to_device, copy_test_type::device_to_host);
CAPTURE(platform_id, test_type);

const auto platform = sycl::platform::get_platforms()[platform_id];
CAPTURE(platform.get_info<sycl::info::platform::name>());

if(platform.get_info<sycl::info::platform::name>().substr(0, 5) == "Intel" && test_type == copy_test_type::inter_device) {
SKIP("Inter-GPU copy appears to currently be broken on Intel OpenCL / Level Zero");
}

auto [src, tgt] = ([&] {
try {
return select_source_and_target(test_type, platform);
Expand Down