Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
VariableUtils.h
Go to the documentation of this file.
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* VariableUtils.h (C) 2000-2024 */
9/* */
10/* Various utility functions for variables. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARIABLEUTILS_H
13#define ARCANE_CORE_VARIABLEUTILS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/materials/MaterialsCoreGlobal.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane::VariableUtils
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \brief Prefetches the memory associated with the variable \a var.
31 *
32 * Prefetches the memory associated with the variable \a onto the accelerator
33 * specified by \a queue_or_null if it is not already there.
34 *
35 * \a var must be a numerical type variable.
36 * If \a queue_or_null is null, no operation is performed.
37 * The operation is asynchronous.
38 */
39extern "C++" ARCANE_CORE_EXPORT void prefetchVariableAsync(IVariable* var, const RunQueue* queue_or_null);
40
41/*!
42 * \brief Prefetches the memory associated with the variable \a var.
43 * \sa void prefetchVariableAsync(IVariable* var, RunQueue* queue_or_null);
44 */
45extern "C++" ARCANE_CORE_EXPORT void prefetchVariableAsync(VariableRef& var, const RunQueue* queue_or_null);
46
47/*!
48 * \brief Indicates that the variable is mostly read-only.
49 *
50 * This is used only with accelerators and prevents memory transfers
51 * between the accelerator and the CPU.
52 */
53extern "C++" ARCANE_CORE_EXPORT void markVariableAsMostlyReadOnly(IVariable* var);
54
55/*!
56 * \brief Indicates that the variable is mostly read-only.
57 * \a void markVariableAsMostlyReadOnly(IVariableRef* var);
58 */
59extern "C++" ARCANE_CORE_EXPORT void markVariableAsMostlyReadOnly(VariableRef& var);
60
61/*!
62 * \brief Indicates that the variable is mostly read-only.
63 * \a void markVariableAsMostlyReadOnly(IVariableRef* var);
64 */
65extern "C++" ARCANE_CORE_EXPORT void markVariableAsMostlyReadOnly(::Arcane::Materials::MeshMaterialVariableRef& var);
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70extern "C++" ARCANE_CORE_EXPORT void experimentalChangeAllocator(::Arcane::Materials::IMeshMaterialVariable* var,
72
73extern "C++" ARCANE_CORE_EXPORT void experimentalChangeAllocator(IVariable* var, eMemoryRessource mem);
74
75extern "C++" ARCANE_CORE_EXPORT void experimentalChangeAllocator(VariableRef& var, eMemoryRessource mem);
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80} // namespace Arcane::VariableUtils
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
85#endif
Declarations of Arcane's general types.
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.
Arcane::eMemoryResource eMemoryRessource
Typedef for the historical Arcane version (with 2's').