Arcane  v4.1.0.0
Documentation développeur
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/*---------------------------------------------------------------------------*/
33{
34 public:
35
37 template <typename... RemainingArgs> static void
38 applyRemainingArgsAtBegin(RemainingArgs&... remaining_args)
39 {
40 (_doOneAtBegin(remaining_args), ...);
41 }
42
44 template <typename... RemainingArgs> static void
45 applyRemainingArgsAtEnd(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 //if constexpr (requires { one_arg._internalHostExecWorkItemAtBegin(); })
55 one_arg._internalHostExecWorkItemAtBegin();
56 }
57 template <typename OneArg> static void _doOneAtEnd(OneArg& one_arg)
58 {
59 //if constexpr (requires { one_arg._internalHostExecWorkItemAtEnd(); })
60 one_arg._internalHostExecWorkItemAtEnd();
61 }
62};
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67} // namespace Arcane::Impl
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72#endif
Classe pour appliquer des méthodes des arguments additionnels en début et fin de kernel.
static void applyRemainingArgsAtEnd(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels à la fin de l'itération.
static void applyRemainingArgsAtBegin(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels au début de l'itération.