Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
RunCommandLaunch.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/* RunCommandLaunch.cc (C) 2000-2026 */
9/* */
10/* RunCommand for hierarchical parallelism. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
19/*!
20 * \file RunCommandLaunch.h
21 *
22 * \brief Types and macros for managing hierarchical parallelism on accelerators.
23 */
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane::Accelerator::Impl
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34template <typename IndexType_> ARCCORE_ACCELERATOR_EXPORT HostLaunchLoopRangeBase<IndexType_>::
35HostLaunchLoopRangeBase(IndexType total_size, Int32 nb_block, IndexType block_size)
36: m_total_size(total_size)
37, m_block_size(block_size)
38, m_nb_block(nb_block)
39{
40 m_last_block_size = (total_size - (block_size * (nb_block - 1)));
41 if (m_last_block_size <= 0)
42 ARCCORE_FATAL("Bad value '{0}' for last group size", m_last_block_size);
43}
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
48template class HostLaunchLoopRangeBase<Int32>;
49template class HostLaunchLoopRangeBase<Int64>;
50
51/*---------------------------------------------------------------------------*/
52/*---------------------------------------------------------------------------*/
53
54} // namespace Arcane::Accelerator::Impl
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
#define ARCCORE_FATAL(...)
Macro throwing a FatalErrorException.
Types and macros for managing hierarchical parallelism on accelerators.
Information of a loop using hierarchical parallelism on the host.
std::int32_t Int32
Signed integer type of 32 bits.