@@ -37,6 +37,17 @@ using namespace Arccore;
37
37
/* ---------------------------------------------------------------------------*/
38
38
/* ---------------------------------------------------------------------------*/
39
39
40
+ // ! Liste des flags pour le pool mémoire à activer
41
+ enum class MemoryPoolFlags
42
+ {
43
+ UVM = 1 ,
44
+ Device = 2 ,
45
+ HostPinned = 4
46
+ };
47
+
48
+ /* ---------------------------------------------------------------------------*/
49
+ /* ---------------------------------------------------------------------------*/
50
+
40
51
void arcaneCheckCudaErrors (const TraceInfo& ti, cudaError_t e)
41
52
{
42
53
if (e != cudaSuccess)
@@ -203,7 +214,7 @@ class CudaMemoryAllocatorBase
203
214
, m_sub_allocator(&m_direct_sub_allocator)
204
215
, m_allocator_name(allocator_name)
205
216
{
206
- if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_CUDA_MALLOC_PRINT_LEVEL " , true ))
217
+ if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_ACCELERATOR_MEMORY_PRINT_LEVEL " , true ))
207
218
m_print_level = v.value ();
208
219
}
209
220
@@ -349,8 +360,8 @@ class UnifiedMemoryCudaMemoryAllocator
349
360
m_block_wrapper.initialize (page_size, do_page_allocate);
350
361
351
362
bool use_memory_pool = false ;
352
- if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_CUDA_MALLOCMANAGED_POOL " , true ))
353
- use_memory_pool = (v.value () != 0 ) ;
363
+ if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_ACCELERATOR_MEMORY_POOL " , true ))
364
+ use_memory_pool = (v.value () & static_cast < int >(MemoryPoolFlags::UVM)) != 0 ;
354
365
_setUseMemoryPool (use_memory_pool);
355
366
}
356
367
@@ -446,8 +457,8 @@ class HostPinnedCudaMemoryAllocator
446
457
void initialize ()
447
458
{
448
459
bool use_memory_pool = false ;
449
- if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_CUDA_HOSTPINNED_POOL " , true ))
450
- use_memory_pool = (v.value () != 0 ) ;
460
+ if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_ACCELERATOR_MEMORY_POOL " , true ))
461
+ use_memory_pool = (v.value () & static_cast < int >(MemoryPoolFlags::HostPinned)) != 0 ;
451
462
_setUseMemoryPool (use_memory_pool);
452
463
m_block_wrapper.initialize (128 , use_memory_pool);
453
464
}
@@ -484,8 +495,8 @@ class DeviceCudaMemoryAllocator
484
495
void initialize ()
485
496
{
486
497
bool use_memory_pool = false ;
487
- if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_CUDA_DEVICE_POOL " , true ))
488
- use_memory_pool = (v.value () != 0 ) ;
498
+ if (auto v = Convert::Type<Int32>::tryParseFromEnvironment (" ARCANE_ACCELERATOR_MEMORY_POOL " , true ))
499
+ use_memory_pool = (v.value () & static_cast < int >(MemoryPoolFlags::Device)) != 0 ;
489
500
_setUseMemoryPool (use_memory_pool);
490
501
m_block_wrapper.initialize (128 , use_memory_pool);
491
502
}
0 commit comments