Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method 'RunQueue::platformStream()' to get the underlying accelerator stream #796

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading