File tree Expand file tree Collapse file tree 7 files changed +54
-8
lines changed
arcane/src/arcane/accelerator Expand file tree Collapse file tree 7 files changed +54
-8
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,17 @@ wait()
142
142
/* ---------------------------------------------------------------------------*/
143
143
/* ---------------------------------------------------------------------------*/
144
144
145
+ bool RunQueueEvent::
146
+ hasPendingWork () const
147
+ {
148
+ if (m_p)
149
+ return m_p->m_impl ->hasPendingWork ();
150
+ return false ;
151
+ }
152
+
153
+ /* ---------------------------------------------------------------------------*/
154
+ /* ---------------------------------------------------------------------------*/
155
+
145
156
impl::IRunQueueEventImpl* RunQueueEvent::
146
157
_internalEventImpl () const
147
158
{
Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ class ARCANE_ACCELERATOR_CORE_EXPORT RunQueueEvent
74
74
// ! Bloque tant que les files associées à cet évènement n'ont pas fini leur travail.
75
75
void wait ();
76
76
77
+ /* !
78
+ * \brief Indique si les RunQueue associées à cet évènement ont fini leur travail.
79
+ *
80
+ * Retourne \a false si les RunQueue enregistrées via RunQueue::recordEvent() ont
81
+ * fini leur travail. Retourn \a true sinon.
82
+ */
83
+ bool hasPendingWork () const ;
84
+
77
85
private:
78
86
79
87
impl::IRunQueueEventImpl* _internalEventImpl () const ;
Original file line number Diff line number Diff line change 1
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
2
// -----------------------------------------------------------------------------
3
- // Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
4
// See the top-level COPYRIGHT file for details.
5
5
// SPDX-License-Identifier: Apache-2.0
6
6
// -----------------------------------------------------------------------------
7
7
/* ---------------------------------------------------------------------------*/
8
- /* RunQueueRuntime.cc (C) 2000-2024 */
8
+ /* RunQueueRuntime.cc (C) 2000-2025 */
9
9
/* */
10
10
/* Implémentation d'un RunQueue pour une cible donnée. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -83,6 +83,7 @@ class ARCANE_ACCELERATOR_CORE_EXPORT HostRunQueueEvent
83
83
}
84
84
void wait () final {}
85
85
void waitForEvent (IRunQueueStream*) final {}
86
+ bool hasPendingWork () final { return false ; }
86
87
Int64 elapsedTime (IRunQueueEventImpl* start_event) final
87
88
{
88
89
ARCANE_CHECK_POINTER (start_event);
Original file line number Diff line number Diff line change 1
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
2
// -----------------------------------------------------------------------------
3
- // Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
4
// See the top-level COPYRIGHT file for details.
5
5
// SPDX-License-Identifier: Apache-2.0
6
6
// -----------------------------------------------------------------------------
7
7
/* ---------------------------------------------------------------------------*/
8
- /* IRunQueueEventImpl.h (C) 2000-2024 */
8
+ /* IRunQueueEventImpl.h (C) 2000-2025 */
9
9
/* */
10
10
/* Interface de l'implémentation d'un évènement. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -42,6 +42,8 @@ class ARCANE_ACCELERATOR_CORE_EXPORT IRunQueueEventImpl
42
42
43
43
// ! Temps écoulé (en nanoseconde) entre l'évènement \a from_event et cet évènement.
44
44
virtual Int64 elapsedTime (IRunQueueEventImpl* from_event) = 0;
45
+
46
+ virtual bool hasPendingWork () =0;
45
47
};
46
48
47
49
/* ---------------------------------------------------------------------------*/
Original file line number Diff line number Diff line change @@ -232,6 +232,15 @@ class CudaRunQueueEvent
232
232
return nano_time;
233
233
}
234
234
235
+ bool hasPendingWork () final
236
+ {
237
+ cudaError_t v = cudaEventQuery (m_cuda_event);
238
+ if (v == cudaErrorNotReady)
239
+ return true ;
240
+ ARCANE_CHECK_CUDA (v);
241
+ return false ;
242
+ }
243
+
235
244
private:
236
245
237
246
cudaEvent_t m_cuda_event;
Original file line number Diff line number Diff line change 1
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
2
// -----------------------------------------------------------------------------
3
- // Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
4
// See the top-level COPYRIGHT file for details.
5
5
// SPDX-License-Identifier: Apache-2.0
6
6
// -----------------------------------------------------------------------------
7
7
/* ---------------------------------------------------------------------------*/
8
- /* HipAcceleratorRuntime.cc (C) 2000-2024 */
8
+ /* HipAcceleratorRuntime.cc (C) 2000-2025 */
9
9
/* */
10
10
/* Runtime pour 'HIP'. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -187,6 +187,15 @@ class HipRunQueueEvent
187
187
return nano_time;
188
188
}
189
189
190
+ bool hasPendingWork () final
191
+ {
192
+ hipError_t v = hipEventQuery (m_hip_event);
193
+ if (v == hipErrorNotReady)
194
+ return true ;
195
+ ARCANE_CHECK_HIP (v);
196
+ return false ;
197
+ }
198
+
190
199
private:
191
200
192
201
hipEvent_t m_hip_event;
Original file line number Diff line number Diff line change 1
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
2
// -----------------------------------------------------------------------------
3
- // Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4
4
// See the top-level COPYRIGHT file for details.
5
5
// SPDX-License-Identifier: Apache-2.0
6
6
// -----------------------------------------------------------------------------
7
7
/* ---------------------------------------------------------------------------*/
8
- /* SyclAcceleratorRuntime.cc (C) 2000-2024 */
8
+ /* SyclAcceleratorRuntime.cc (C) 2000-2025 */
9
9
/* */
10
10
/* Runtime pour 'SYCL'. */
11
11
/* ---------------------------------------------------------------------------*/
16
16
17
17
#include " arcane/utils/PlatformUtils.h"
18
18
#include " arcane/utils/NotSupportedException.h"
19
+ #include " arcane/utils/NotImplementedException.h"
19
20
#include " arcane/utils/FatalErrorException.h"
20
21
#include " arcane/utils/IMemoryRessourceMng.h"
21
22
#include " arcane/utils/internal/IMemoryRessourceMngInternal.h"
@@ -216,6 +217,11 @@ class SyclRunQueueEvent
216
217
return (end - start);
217
218
}
218
219
220
+ bool hasPendingWork () final
221
+ {
222
+ ARCANE_THROW (NotImplementedException," hasPendingWork()" );
223
+ }
224
+
219
225
private:
220
226
221
227
sycl::event m_sycl_event;
You can’t perform that action at this time.
0 commit comments