diff --git a/CMakeLists.txt b/CMakeLists.txt index 73baecc34..8dc8bd447 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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) diff --git a/cmake/celerity-config.cmake.in b/cmake/celerity-config.cmake.in index d8d784f19..9d7f6d9e1 100644 --- a/cmake/celerity-config.cmake.in +++ b/cmake/celerity-config.cmake.in @@ -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)