12#ifndef ARCANE_ACCELERATOR_ACCELERATORUTILS_H
13#define ARCANE_ACCELERATOR_ACCELERATORUTILS_H
17#include "arcane/utils/Array.h"
19#include "arcane/accelerator/AcceleratorGlobal.h"
20#include "arcane/accelerator/core/RunQueue.h"
22#if defined(ARCANE_COMPILING_HIP)
23#include "arcane/accelerator/hip/HipAccelerator.h"
24#include <hip/hip_runtime.h>
25#include <rocprim/rocprim.hpp>
27#if defined(ARCANE_COMPILING_CUDA)
28#include "arcane/accelerator/cuda/CudaAccelerator.h"
31#if defined(ARCANE_COMPILING_SYCL)
32#include "arcane/accelerator/sycl/SyclAccelerator.h"
33#include <sycl/sycl.hpp>
34#if defined(__INTEL_LLVM_COMPILER)
35#include <oneapi/dpl/execution>
36#include <oneapi/dpl/algorithm>
43namespace Arcane::Accelerator::impl
49#if defined(ARCANE_COMPILING_CUDA)
50class ARCANE_ACCELERATOR_EXPORT CudaUtils
54 static cudaStream_t toNativeStream(
const RunQueue* queue);
55 static cudaStream_t toNativeStream(
const RunQueue& queue);
62#if defined(ARCANE_COMPILING_HIP)
63class ARCANE_ACCELERATOR_EXPORT HipUtils
67 static hipStream_t toNativeStream(
const RunQueue* queue);
68 static hipStream_t toNativeStream(
const RunQueue& queue);
75#if defined(ARCANE_COMPILING_SYCL)
76class ARCANE_ACCELERATOR_EXPORT SyclUtils
80 static sycl::queue toNativeStream(
const RunQueue* queue);
81 static sycl::queue toNativeStream(
const RunQueue& queue);
93namespace Arcane::Accelerator::AcceleratorUtils
99#if defined(ARCANE_COMPILING_CUDA)
106toCudaNativeStream(
const RunQueue& queue)
108 return impl::CudaUtils::toNativeStream(queue);
112#if defined(ARCANE_COMPILING_HIP)
119toHipNativeStream(
const RunQueue& queue)
121 return impl::HipUtils::toNativeStream(queue);
125#if defined(ARCANE_COMPILING_SYCL)
132toSyclNativeStream(
const RunQueue& queue)
134 return impl::SyclUtils::toNativeStream(queue);