Arcane  v4.1.0.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 template<typename T> friend class RunCommandLocalMemory;
52
53 friend RunCommand makeCommand(const RunQueue& run_queue);
54 friend RunCommand makeCommand(const RunQueue* run_queue);
55
56 public:
57
58 ~RunCommand();
59
60 protected:
61
62 explicit RunCommand(const RunQueue& run_queue);
63
64 public:
65
66 RunCommand(RunCommand&& command) = delete;
67 RunCommand(const RunCommand&) = delete;
68 RunCommand& operator=(const RunCommand&) = delete;
69 RunCommand& operator=(RunCommand&&) = delete;
70
71 public:
72
80 RunCommand& addTraceInfo(const TraceInfo& ti);
81
87 RunCommand& addKernelName(const String& v);
88
96 RunCommand& addNbThreadPerBlock(Int32 v);
97
99 const TraceInfo& traceInfo() const;
100
102 const String& kernelName() const;
103
104 /*
105 * \brief Nombre de threads par bloc ou 0 pour la valeur par défaut.
106 *
107 * Cette valeur est utilisée uniquement si on s'exécute sur accélérateur.
108 */
109 Int32 nbThreadPerBlock() const;
110
113
116
118 friend ARCANE_ACCELERATOR_CORE_EXPORT RunCommand&
119 operator<<(RunCommand& command, const TraceInfo& trace_info);
120
121 private:
122
123 // Pour RunCommandLaunchInfo
124 void _internalNotifyBeginLaunchKernel();
125 void _internalNotifyEndLaunchKernel();
126 void _internalNotifyBeginLaunchKernelSyclEvent(void* sycl_event_ptr);
127 ForLoopOneExecStat* _internalCommandExecStat();
128
129 private:
130
133 impl::NativeStream _internalNativeStream() const;
134 static impl::RunCommandImpl* _internalCreateImpl(impl::RunQueueImpl* queue);
135 static void _internalDestroyImpl(impl::RunCommandImpl* p);
136 void _addSharedMemory(Int32 size);
137 Int32 _sharedMemory() const;
138
139 private:
140
141 void _allocateReduceMemory(Int32 nb_grid);
142
143 private:
144
146};
147
148/*---------------------------------------------------------------------------*/
149/*---------------------------------------------------------------------------*/
150
151} // End namespace Arcane::Accelerator
152
153/*---------------------------------------------------------------------------*/
154/*---------------------------------------------------------------------------*/
155
156#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.
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.