Arcane  4.2.1.0
User documentation
Loading...
Searching...
No Matches
VariableViews.cc
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/* VariableViews.cc (C) 2000-2026 */
9/* */
10/* Management of views on variables for accelerators. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arcane/accelerator/core/RunCommand.h"
17#include "arcane/accelerator/core/RunQueue.h"
18#include "arccore/common/accelerator/internal/RunQueueImpl.h"
19#include "arccore/common/accelerator/internal/IRunQueueStream.h"
20
22#include "arcane/accelerator/MDVariableViews.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26/*!
27 * \file VariableViews.h
28 *
29 * This file contains the type declarations for managing
30 * views for mesh variable accelerators.
31 */
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35namespace Arcane::Accelerator
36{
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41VariableViewBase::
42VariableViewBase(const ViewBuildInfo& vbi, IVariable* var)
43{
44 Impl::RunQueueImpl* q = vbi._internalQueue();
45 if (q->isAutoPrefetchCommand()) {
46 RunQueue rq(q);
47 VariableUtils::prefetchVariableAsync(var, &rq);
48 }
49}
50
51/*---------------------------------------------------------------------------*/
52/*---------------------------------------------------------------------------*/
53
54} // namespace Arcane::Accelerator
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
Utility functions for variables.
Namespace for accelerator usage.