17#include "arcane/utils/IMemoryAllocator.h"
19#include "arcane/accelerator/core/RunQueue.h"
20#include "arcane/accelerator/core/Memory.h"
22#include "arcane/core/IData.h"
23#include "arcane/core/IVariable.h"
24#include "arcane/core/VariableRef.h"
25#include "arcane/core/internal/IDataInternal.h"
26#include "arcane/core/internal/IVariableInternal.h"
27#include "arcane/core/datatype/DataAllocationInfo.h"
29#include "arcane/core/materials/internal/IMeshMaterialVariableInternal.h"
45using namespace Arcane::Accelerator;
59 INumericDataInternal* nd = d->_commonInternal()->numericData();
84markVariableAsMostlyReadOnly(
IVariable* var)
105 auto vars = var.
materialVariable()->_internalApi()->variableReferenceList();
118 Arcane::Materials::IMeshMaterialVariableInternal* mat_var = var->_internalApi();
119 for (
VariableRef* vref : mat_var->variableReferenceList())
120 vref->variable()->_internalApi()->changeAllocator(mem_opts);
140 experimentalChangeAllocator(var.
variable(), mem);
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
Utility functions for variables.
void markVariableAsMostlyReadOnly(IVariable *var)
Indicates that the variable is mostly read-only.
void prefetchVariableAsync(IVariable *var, const RunQueue *queue_or_null)
Prefetches the memory associated with the variable var.
Memory and allocator management functions.
Memory prefetching arguments.
Execution queue for an accelerator.
void prefetchMemory(const MemoryPrefetchArgs &args) const
Performs a memory prefetch.
Constant view on a contiguous memory region containing fixed-size elements.
Information on data allocation.
Interface of a data item.
virtual IData * data()=0
Data associated with the variable.
virtual bool isUsed() const =0
Usage state of the variable.
virtual void setAllocationInfo(const DataAllocationInfo &v)=0
Sets allocation information.
virtual IVariableInternal * _internalApi()=0
Internal Arcane API.
Interface of a material variable on a mesh.
virtual IVariable * globalVariable() const =0
Associated global variable on the mesh.
Base class for material variable references.
IMeshMaterialVariable * materialVariable() const
Associated material variable.
Options to configure allocations.
IVariable * variable() const
Associated variable.
MemoryAllocationOptions getAllocationOptions(eMemoryResource mem_resource)
Default allocation for the resource mem_resource.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
@ HostAndDeviceMostlyRead
Indicates that the data will be used both on the accelerator and on the CPU and will not be frequentl...
Arcane::eMemoryResource eMemoryRessource
Typedef for the historical Arcane version (with 2's').
@ UnifiedMemory
Allocates using unified memory.