From b459e58395d0fcc75e3753f6430fb686bc9a5985 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Thu, 27 Jul 2023 16:01:20 -0700 Subject: [PATCH] SYCL: Allocate 3/4 of total global memory by default (#3431) In the past, we had issues with allocating too big a chunk of memory on Intel GPUs, so we only allocated 1 GB by default. This is no longer the case. --- Src/Base/AMReX_Arena.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Src/Base/AMReX_Arena.cpp b/Src/Base/AMReX_Arena.cpp index 0a1996a26d0..d18fa0dd5d5 100644 --- a/Src/Base/AMReX_Arena.cpp +++ b/Src/Base/AMReX_Arena.cpp @@ -278,12 +278,10 @@ Arena::Initialize () BL_ASSERT(the_comms_arena == nullptr || the_comms_arena == The_BArena()); #ifdef AMREX_USE_GPU -#ifdef AMREX_USE_SYCL - the_arena_init_size = 1024L*1024L*1024L; // xxxxx SYCL: todo -#else the_arena_init_size = Gpu::Device::totalGlobalMem() / Gpu::Device::numDevicePartners() / 4L * 3L; +#ifdef AMREX_USE_SYCL + the_arena_init_size = std::min(the_arena_init_size, Gpu::Device::maxMemAllocSize()); #endif - the_pinned_arena_release_threshold = Gpu::Device::totalGlobalMem(); #endif