File tree 6 files changed +26
-9
lines changed
6 files changed +26
-9
lines changed 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-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2024 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
- /* IRunQueueStream.h (C) 2000-2022 */
8
+ /* IRunQueueStream.h (C) 2000-2024 */
9
9
/* */
10
10
/* Interface d'un flux d'exécution pour une RunQueue. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -65,6 +65,9 @@ class ARCANE_ACCELERATOR_CORE_EXPORT IRunQueueStream
65
65
66
66
// ! Pointeur sur la structure interne dépendante de l'implémentation
67
67
virtual void * _internalImpl () = 0;
68
+
69
+ // ! Barrière sans exception. Retourne \a true en cas d'erreur
70
+ virtual bool _barrierNoException () = 0;
68
71
};
69
72
70
73
/* ---------------------------------------------------------------------------*/
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-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2024 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
- /* RunQueueImpl.cc (C) 2000-2023 */
8
+ /* RunQueueImpl.cc (C) 2000-2024 */
9
9
/* */
10
10
/* Gestion d'une file d'exécution sur accélérateur. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -68,8 +68,13 @@ _release()
68
68
// les commandes ne seront pas désallouées.
69
69
// TODO: Regarder s'il ne faudrait pas plutôt indiquer cela à l'utilisateur
70
70
// ou faire une erreur fatale.
71
- if (!m_active_run_command_list.empty ())
72
- _internalBarrier ();
71
+ if (!m_active_run_command_list.empty ()){
72
+ if (!_internalStream ()->_barrierNoException ()){
73
+ _internalFreeRunningCommands ();
74
+ }
75
+ else
76
+ std::cerr << " WARNING: Error in internal accelerator barrier\n " ;
77
+ }
73
78
if (_isInPool ())
74
79
m_runner->_internalPutRunQueueImplInPool (this );
75
80
else
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-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3
+ // Copyright 2000-2024 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-2022 */
8
+ /* RunQueueRuntime.cc (C) 2000-2024 */
9
9
/* */
10
10
/* Implémentation d'un RunQueue pour une cible donnée. */
11
11
/* ---------------------------------------------------------------------------*/
@@ -53,6 +53,7 @@ class ARCANE_ACCELERATOR_CORE_EXPORT HostRunQueueStream
53
53
}
54
54
void prefetchMemory (const MemoryPrefetchArgs&) override {}
55
55
void * _internalImpl () override { return nullptr ; }
56
+ bool _barrierNoException () override { return false ; }
56
57
57
58
private:
58
59
Original file line number Diff line number Diff line change @@ -148,6 +148,10 @@ class CudaRunQueueStream
148
148
if (global_cupti_flush > 0 )
149
149
flushCupti ();
150
150
}
151
+ bool _barrierNoException () override
152
+ {
153
+ return (cudaStreamSynchronize (m_cuda_stream)!=CUDA_SUCCESS);
154
+ }
151
155
void copyMemory (const MemoryCopyArgs& args) override
152
156
{
153
157
auto source_bytes = args.source ().bytes ();
Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ class HipRunQueueStream
90
90
{
91
91
ARCANE_CHECK_HIP (hipStreamSynchronize (m_hip_stream));
92
92
}
93
+ bool _barrierNoException () override
94
+ {
95
+ return hipStreamSynchronize (m_hip_stream) != HIP_SUCCESS;
96
+ }
93
97
void copyMemory (const MemoryCopyArgs& args) override
94
98
{
95
99
auto r = hipMemcpyAsync (args.destination ().data (), args.source ().data (),
Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ _superItemBase(ConstituentItemIndex id) const
437
437
return m_super_component_item_shared_info->_item (super_local_id);
438
438
}
439
439
440
- inline matimpl::ConstituentItemBase ComponentItemSharedInfo::
440
+ inline ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase ComponentItemSharedInfo::
441
441
_subItemBase (ConstituentItemIndex id,Int32 sub_index) const
442
442
{
443
443
ARCCORE_CHECK_RANGE (id.localId (), -1 , m_storage_size);
You can’t perform that action at this time.
0 commit comments