Skip to content

Commit

Permalink
Merge pull request #796 from arcaneframework/dev/gg-add-get-platform-…
Browse files Browse the repository at this point in the history
…stream

Add method 'RunQueue::platformStream()' to get the underlying accelerator stream
  • Loading branch information
grospelliergilles authored Jul 11, 2023
2 parents 654b9c5 + fe3e8e7 commit 47b15c7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
9 changes: 9 additions & 0 deletions arcane/src/arcane/accelerator/core/RunQueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ _getCommandImpl()
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

void* RunQueue::
platformStream()
{
return m_p->_internalStream()->_internalImpl();
}

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

void RunQueue::
copyMemory(const MemoryCopyArgs& args)
{
Expand Down
17 changes: 15 additions & 2 deletions arcane/src/arcane/accelerator/core/RunQueue.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* RunQueue.h (C) 2000-2022 */
/* RunQueue.h (C) 2000-2023 */
/* */
/* Gestion d'une file d'exécution sur accélérateur. */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -75,6 +75,19 @@ class ARCANE_ACCELERATOR_CORE_EXPORT RunQueue
//! Bloque l'exécution sur l'instance tant que les jobs enregistrés dans \a event ne sont pas terminés
void waitEvent(Ref<RunQueueEvent>& event);

public:

/*!
* \brief Pointeur sur la structure interne dépendante de l'implémentation.
*
* Cette méthode est réservée à un usage avancée.
* La file retournée ne doit pas être conservée au delà de la vie de l'instance.
*
* Avec CUDA, le pointeur retourné est un 'cudaStream_t*'. Avec HIP, il
* s'agit d'un 'hipStream_t*'.
*/
void* platformStream();

private:

impl::IRunnerRuntime* _internalRuntime() const;
Expand Down
1 change: 1 addition & 0 deletions arcane/src/arcane/tests/accelerator/RunQueueUnitTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ _executeTest1(bool use_priority)

auto task_func = [&](Ref<RunQueue> q, int id) {
info() << "EXECUTE_THREAD_ID=" << id;
info(4) << "Queue pointer=" << q->platformStream();
auto command1 = makeCommand(q.get());
auto v = viewOut(command1, values[id]);
command1 << RUNCOMMAND_LOOP1(iter, N)
Expand Down

0 comments on commit 47b15c7

Please sign in to comment.