Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IRunnerRuntime.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* IRunnerRuntime.h (C) 2000-2025 */
9/* */
10/* Interface of the runtime associated with a RunQueue. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_ACCELERATOR_INTERNAL_IRUNQUEUERUNTIME_H
13#define ARCCORE_COMMON_ACCELERATOR_INTERNAL_IRUNQUEUERUNTIME_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/common/accelerator/CommonAcceleratorGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::Accelerator::Impl
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
35class ARCCORE_COMMON_EXPORT IRunnerRuntime
36{
37 public:
38
39 virtual ~IRunnerRuntime() = default;
40
41 public:
42
43 virtual void notifyBeginLaunchKernel() = 0;
44 virtual void notifyEndLaunchKernel() = 0;
45 virtual void barrier() = 0;
46 virtual eExecutionPolicy executionPolicy() const = 0;
47 virtual IRunQueueStream* createStream(const RunQueueBuildInfo& bi) = 0;
48 virtual IRunQueueEventImpl* createEventImpl() = 0;
49 virtual IRunQueueEventImpl* createEventImplWithTimer() = 0;
50 virtual void setMemoryAdvice(ConstMemoryView buffer, eMemoryAdvice advice, DeviceId device_id) = 0;
51 virtual void unsetMemoryAdvice(ConstMemoryView buffer, eMemoryAdvice advice, DeviceId device_id) = 0;
52 virtual void setCurrentDevice(DeviceId device_id) = 0;
53 virtual const IDeviceInfoList* deviceInfoList() = 0;
54 virtual void getPointerAttribute(PointerAttribute& attribute, const void* ptr) = 0;
55 virtual DeviceMemoryInfo getDeviceMemoryInfo(DeviceId device_id) = 0;
56
57 virtual void startProfiling() {}
58 virtual void stopProfiling() {}
59 virtual bool isProfilingActive() { return false; }
60 virtual void pushProfilerRange([[maybe_unused]] const String& name, [[maybe_unused]] Int32 color_gdb) {}
61 virtual void popProfilerRange() {}
62 virtual void finalize(ITraceMng*) {}
63 virtual KernelLaunchArgs computeKernalLaunchArgs(const KernelLaunchArgs& orig_args,
64 const void* kernel_ptr,
65 Int64 total_loop_size);
66
67 protected:
68
69 void _fillPointerAttribute(PointerAttribute& attribute,
70 ePointerMemoryType mem_type,
71 int device, const void* pointer, const void* device_pointer,
72 const void* host_pointer);
73 void _fillPointerAttribute(PointerAttribute& attribute, const void* pointer);
74};
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // namespace Arcane::Accelerator::Impl
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84#endif
Interface for event implementation.
Interface of an execution stream for a RunQueue.
Interface of the runtime associated with an accelerator.
Constant view on a contiguous memory region containing fixed-size elements.
ePointerMemoryType
Memory type for a pointer.
eExecutionPolicy
Execution policy for a Runner.
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.