20#include <condition_variable>
27#if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED)
31 template<
typename TApi>
32 class EventUniformCudaHipRt;
34 template<
typename TApi>
35 class DevUniformCudaHipRt;
37 template<
typename TApi>
38 struct PlatformUniformCudaHipRt;
40 namespace uniform_cuda_hip::detail
43 template<
typename TApi>
49 , m_UniformCudaHipQueue()
66 TApi::streamCreateWithFlags(&m_UniformCudaHipQueue, TApi::streamNonBlocking));
72 static_cast<std::size_t
>(TApi::getCurrentDevice())))
73 , m_UniformCudaHipQueue(stream)
97 return m_UniformCudaHipQueue;
105 typename TApi::Stream_t m_UniformCudaHipQueue;
110 template<
typename TApi,
bool TBlocking>
136 return !((*this) == rhs);
157 template<
typename TApi,
bool TBlocking>
158 struct GetDev<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>>
164 return queue.m_spQueueImpl->m_dev;
169 template<
typename TApi,
bool TBlocking>
170 struct Empty<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>>
178 typename TApi::Error_t ret = TApi::success;
180 ret = TApi::streamQuery(queue.getNativeHandle()),
181 TApi::errorNotReady);
182 return (ret == TApi::success);
190 template<
typename TApi,
bool TBlocking>
204 template<
typename TApi,
bool TBlocking>
205 struct DevType<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>>
211 template<
typename TApi,
bool TBlocking>
212 struct EventType<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>>
218 template<
typename TApi,
bool TBlocking,
typename TTask>
219 struct Enqueue<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>, TTask>
237 auto data = std::unique_ptr<HostFuncData>(
reinterpret_cast<HostFuncData*
>(arg));
238 auto& queue = data->q;
239 auto f = queue.m_callbackThread.submit([d = std::move(data)] { d->t(); });
245 TTask
const& task) ->
void
248 queue.getNativeHandle(),
249 uniformCudaHipRtHostFunc,
250 new HostFuncData{*queue.m_spQueueImpl, task}));
251 if constexpr(TBlocking)
257 template<
typename TApi,
bool TBlocking>
258 struct NativeHandle<uniform_cuda_hip::detail::QueueUniformCudaHipRt<TApi, TBlocking>>
#define ALPAKA_DEBUG_MINIMAL_LOG_SCOPE
The alpaka accelerator library.
ALPAKA_FN_HOST auto getDevByIdx(TPlatform const &platform, std::size_t const &devIdx) -> Dev< TPlatform >
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...