Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
NumArrayViews.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/* NumArrayViews.cc (C) 2000-2025 */
9/* */
10/* Managing views on 'NumArray' for accelerators. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arccore/base/MemoryView.h"
17
18#include "arccore/common/accelerator/RunCommand.h"
19#include "arccore/common/accelerator/Memory.h"
20#include "arccore/common/accelerator/internal/RunQueueImpl.h"
21#include "arccore/common/accelerator/internal/IRunQueueStream.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26/*!
27 * \file NumArrayViews.h
28 *
29 * This file contains the type declarations for managing
30 * views for 'NumArray' class accelerators.
31 */
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36namespace Arcane::Accelerator
37{
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42NumArrayViewBase::
43NumArrayViewBase(const ViewBuildInfo& vbi, Span<const std::byte> bytes)
44{
45 Impl::RunQueueImpl* q = vbi._internalQueue();
46 if (q->isAutoPrefetchCommand()) {
47 ConstMemoryView mem_view(bytes);
48 q->prefetchMemory(MemoryPrefetchArgs(mem_view).addAsync());
49 }
50}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55} // namespace Arcane::Accelerator
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
Namespace for accelerator usage.