Arcane  v3.16.6.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
core/RunCommand.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/* RunCommand.h (C) 2000-2025 */
9/* */
10/* Gestion d'une commande sur accélérateur. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_ACCELERATOR_CORE_RUNCOMMAND_H
13#define ARCANE_ACCELERATOR_CORE_RUNCOMMAND_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::Accelerator
23{
24namespace impl
25{
26extern "C++" ARCANE_ACCELERATOR_CORE_EXPORT IReduceMemoryImpl*
27internalGetOrCreateReduceMemoryImpl(RunCommand* command);
28}
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
45class ARCANE_ACCELERATOR_CORE_EXPORT RunCommand
46{
47 friend impl::IReduceMemoryImpl* impl::internalGetOrCreateReduceMemoryImpl(RunCommand* command);
49 friend impl::RunQueueImpl;
50 friend class ViewBuildInfo;
51
52 friend RunCommand makeCommand(const RunQueue& run_queue);
53 friend RunCommand makeCommand(const RunQueue* run_queue);
54
55 public:
56
57 ~RunCommand();
58
59 protected:
60
61 explicit RunCommand(const RunQueue& run_queue);
62
63 public:
64
65 RunCommand(RunCommand&& command) = delete;
66 RunCommand(const RunCommand&) = delete;
67 RunCommand& operator=(const RunCommand&) = delete;
68 RunCommand& operator=(RunCommand&&) = delete;
69
70 public:
71
79 RunCommand& addTraceInfo(const TraceInfo& ti);
80
86 RunCommand& addKernelName(const String& v);
87
95 RunCommand& addNbThreadPerBlock(Int32 v);
96
98 const TraceInfo& traceInfo() const;
99
101 const String& kernelName() const;
102
103 /*
104 * \brief Nombre de threads par bloc ou 0 pour la valeur par défaut.
105 *
106 * Cette valeur est utilisée uniquement si on s'exécute sur accélérateur.
107 */
108 Int32 nbThreadPerBlock() const;
109
112
115
117 friend ARCANE_ACCELERATOR_CORE_EXPORT RunCommand&
118 operator<<(RunCommand& command, const TraceInfo& trace_info);
119
120 private:
121
122 // Pour RunCommandLaunchInfo
123 void _internalNotifyBeginLaunchKernel();
124 void _internalNotifyEndLaunchKernel();
125 void _internalNotifyBeginLaunchKernelSyclEvent(void* sycl_event_ptr);
126 ForLoopOneExecStat* _internalCommandExecStat();
127
128 private:
129
132 impl::NativeStream _internalNativeStream() const;
133 static impl::RunCommandImpl* _internalCreateImpl(impl::RunQueueImpl* queue);
134 static void _internalDestroyImpl(impl::RunCommandImpl* p);
135
136 private:
137
138 void _allocateReduceMemory(Int32 nb_grid);
139
140 private:
141
143};
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148} // End namespace Arcane::Accelerator
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153#endif
impl::RunQueueImpl * _internalQueueImpl() const
const ParallelLoopOptions & parallelLoopOptions() const
Configuration des boucles multi-thread.
friend RunCommand makeCommand(const RunQueue &run_queue)
Créé une commande associée à la file run_queue.
void setParallelLoopOptions(const ParallelLoopOptions &opt)
Positionne la configuration des boucles multi-thread.
friend RunCommand & operator<<(RunCommand &command, const TraceInfo &trace_info)
Affichage des informations de la commande.
RunCommand & addNbThreadPerBlock(Int32 v)
Positionne le nombre de thread par bloc pour les accélérateurs.
RunCommand & addKernelName(const String &v)
Positionne le nom du noyau.
Definition RunCommand.cc:93
RunCommand & addTraceInfo(const TraceInfo &ti)
Positionne le informations de trace.
Definition RunCommand.cc:83
const TraceInfo & traceInfo() const
Informations pour les traces.
Definition RunCommand.cc:56
const String & kernelName() const
Nom du noyau.
Definition RunCommand.cc:65
File d'exécution pour un accélérateur.
Interface de la gestion mémoire pour les réductions.
Type opaque pour encapsuler une 'stream' native.
Implémentation d'une commande pour accélérateur.
Object temporaire pour conserver les informations d'exécution d'une commande et regrouper les tests.
File d'exécution pour accélérateur.
Classe pour gérer le profiling d'une seule exécution d'une boucle.
Definition Profiling.h:93
Options d'exécution d'une boucle parallèle en multi-thread.
Chaîne de caractères unicode.
Espace de nom pour l'utilisation des accélérateurs.
std::int32_t Int32
Type entier signé sur 32 bits.