64 friend ::Arcane::Accelerator::Runner;
75 if (
p->m_use_pool_mutex) {
76 m_mutex =
p->m_pool_mutex.get();
87 Lock& operator=(
const Lock&) =
delete;
91 std::mutex* m_mutex =
nullptr;
97 : m_internal_api(this)
110 void setConcurrentQueueCreation(
bool v)
112 m_use_pool_mutex = v;
113 if (!m_pool_mutex.get())
114 m_pool_mutex = std::make_unique<std::mutex>();
116 bool isConcurrentQueueCreation()
const {
return m_use_pool_mutex; }
120 RunQueueImplStack* getPool();
121 void addTime(
double v)
127 double cumulativeCommandTime()
const
130 return static_cast<double>(x) / 1.0e9;
133 impl::IRunnerRuntime* runtime()
const {
return m_runtime; }
137 bool isInit()
const {
return m_is_init; }
139 DeviceId deviceId()
const {
return m_device_id; }
143 void _internalPutRunQueueImplInPool(RunQueueImpl* p);
144 RunQueueImpl* _internalCreateOrGetRunQueueImpl();
145 RunQueueImpl* _internalCreateOrGetRunQueueImpl(
const RunQueueBuildInfo& bi);
146 IRunQueueEventImpl* _createEvent();
147 IRunQueueEventImpl* _createEventWithTimer();
148 RunnerInternal* _internalApi() {
return &m_internal_api; }
153 bool m_is_init =
false;
155 DeviceId m_device_id;
156 impl::IRunnerRuntime* m_runtime =
nullptr;
157 RunQueueImplStack m_run_queue_pool;
158 std::unique_ptr<std::mutex> m_pool_mutex;
159 bool m_use_pool_mutex =
false;
174 void _checkIsInit()
const;