Skip to content

Commit

Permalink
[arcane] Supprime utilisation de la méthode obsolète 'getAcceleratorH…
Browse files Browse the repository at this point in the history
…ostMemoryAllocator()'.
  • Loading branch information
grospelliergilles committed Dec 3, 2024
1 parent da319d9 commit e00b52a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions arcane/src/arcane/materials/MeshMaterialVariableIndexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ MeshMaterialVariableIndexer::
MeshMaterialVariableIndexer(ITraceMng* tm, const String& name)
: TraceAccessor(tm)
, m_name(name)
, m_matvar_indexes(platform::getAcceleratorHostMemoryAllocator())
, m_local_ids(platform::getAcceleratorHostMemoryAllocator())
, m_matvar_indexes(MemoryUtils::getDefaultDataAllocator())
, m_local_ids(MemoryUtils::getDefaultDataAllocator())
{
_init();
m_matvar_indexes.setDebugName(String("VariableIndexerMatVarIndexes")+name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ SimpleHydroAcceleratorService(const ServiceBuildInfo& sbi)
, m_delta_t_f(VariableBuildInfo(sbi.mesh(),"SplitDeltaT"))
, m_old_dt_f(VariableBuildInfo(sbi.mesh(),"OldDTf"))
, m_module(nullptr)
, m_node_index_in_cells(platform::getAcceleratorHostMemoryAllocator())
, m_node_index_in_cells(MemoryUtils::getDefaultDataAllocator())
, m_runner(sbi.subDomain()->acceleratorMng()->defaultRunner())
, m_default_queue(sbi.subDomain()->acceleratorMng()->defaultQueue())
{
Expand Down
9 changes: 5 additions & 4 deletions arcane/src/arcane/utils/MemoryResourceMng.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "arcane/utils/Array.h"
#include "arcane/utils/MemoryView.h"
#include "arcane/utils/MemoryAllocator.h"
#include "arcane/utils/MemoryUtils.h"
#include "arcane/utils/internal/MemoryUtilsInternal.h"

/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -109,15 +110,15 @@ getAllocator(eMemoryResource r, bool throw_if_not_found)
// Si pas d'allocateur spécifique et qu'on n'est pas sur accélérateur,
// utilise platform::getAcceleratorHostMemoryAllocator().
if (!a && !m_is_accelerator) {
if (r == eMemoryRessource::UnifiedMemory || r == eMemoryRessource::HostPinned) {
a = platform::getAcceleratorHostMemoryAllocator();
if (r == eMemoryResource::UnifiedMemory || r == eMemoryResource::HostPinned) {
a = MemoryUtils::getDefaultDataAllocator();
if (!a)
a = m_allocators[(int)eMemoryRessource::Host];
a = m_allocators[(int)eMemoryResource::Host];
}
}

if (!a && throw_if_not_found)
ARCANE_FATAL("Allocator for ressource '{0}' is not available", r);
ARCANE_FATAL("Allocator for resource '{0}' is not available", r);

return a;
}
Expand Down

0 comments on commit e00b52a

Please sign in to comment.