Arcane  v4.1.1.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
HostKernelRemainingArgsHelper.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* HostKernelRemainingArgsHelper.h (C) 2000-2025 */
9/* */
10/* Classe pour exécuter une méthode en début et fin de noyau. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_HOSTKERNELREMAININGARGSHELPER_H
13#define ARCCORE_COMMON_HOSTKERNELREMAININGARGSHELPER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/common/CommonGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::Impl
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27/*!
28 * \internal
29 * \brief Classe pour appliquer des méthodes des arguments additionnels
30 * en début et fin de kernel.
31 */
33{
34 public:
35
36 //! Applique les functors des arguments additionnels au début de l'itération.
37 template <typename... RemainingArgs> static void
38 applyAtBegin(RemainingArgs&... remaining_args)
39 {
40 (_doOneAtBegin(remaining_args), ...);
41 }
42
43 //! Applique les functors des arguments additionnels à la fin de l'itération.
44 template <typename... RemainingArgs> static void
45 applyAtEnd(RemainingArgs&... remaining_args)
46 {
47 (_doOneAtEnd(remaining_args), ...);
48 }
49
50 private:
51
52 template <typename OneArg> static void _doOneAtBegin(OneArg& one_arg)
53 {
54 using HandlerType = OneArg::RemainingArgHandlerType;
55 HandlerType::execWorkItemAtBeginForHost(one_arg);
56 }
57 template <typename OneArg> static void _doOneAtEnd(OneArg& one_arg)
58 {
59 using HandlerType = OneArg::RemainingArgHandlerType;
60 HandlerType::execWorkItemAtEndForHost(one_arg);
61 }
62};
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67} // namespace Arcane::Impl
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72#endif
static void applyAtEnd(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels à la fin de l'itération.
static void applyAtBegin(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels au début de l'itération.