1
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
2
// -----------------------------------------------------------------------------
3
- // Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
4
// See the top-level COPYRIGHT file for details.
5
5
// SPDX-License-Identifier: Apache-2.0
6
6
// -----------------------------------------------------------------------------
7
7
/* ---------------------------------------------------------------------------*/
8
- /* CudaAccelerator.cc (C) 2000-2023 */
8
+ /* CudaAccelerator.cc (C) 2000-2024 */
9
9
/* */
10
10
/* Backend 'CUDA' pour les accélérateurs. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -100,7 +100,7 @@ class UnifiedMemoryCudaMemoryAllocator
100
100
{
101
101
public:
102
102
103
- static constexpr Int64 page_size = 4096 ;
103
+ Int64 page_size = platform::getPageSize() ;
104
104
105
105
void initialize ()
106
106
{
@@ -121,7 +121,7 @@ class UnifiedMemoryCudaMemoryAllocator
121
121
_applyHint (ptr.baseAddress (), ptr.size (), new_args);
122
122
}
123
123
124
- Int64 adjustedCapacity (MemoryAllocationArgs args, Int64 wanted_capacity, Int64 element_size) const
124
+ Int64 adjustedCapacity (MemoryAllocationArgs args, Int64 wanted_capacity, Int64 element_size) const override
125
125
{
126
126
wanted_capacity = AlignedMemoryAllocator3::adjustedCapacity (args, wanted_capacity, element_size);
127
127
const bool do_page = m_page_allocate_level > 0 ;
@@ -173,7 +173,7 @@ class UnifiedMemoryCudaMemoryAllocator
173
173
return ::cudaFree (ptr);
174
174
}
175
175
176
- cudaError_t _allocate (void ** ptr, size_t new_size, MemoryAllocationArgs args)
176
+ cudaError_t _allocate (void ** ptr, size_t new_size, MemoryAllocationArgs args) override
177
177
{
178
178
auto r = ::cudaMallocManaged (ptr, new_size, cudaMemAttachGlobal);
179
179
void * p = *ptr;
0 commit comments