alpaka
Abstraction Library for Parallel Kernel Acceleration
AccGpuSyclIntel.hpp
Go to the documentation of this file.
1 /* Copyright 2022 Jan Stephan
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
8 #include "alpaka/acc/Tag.hpp"
11 #include "alpaka/core/Sycl.hpp"
13 #include "alpaka/dev/Traits.hpp"
15 #include "alpaka/kernel/Traits.hpp"
18 #include "alpaka/vec/Vec.hpp"
19 
20 #include <string>
21 #include <utility>
22 
23 #if defined(ALPAKA_ACC_SYCL_ENABLED) && defined(ALPAKA_SYCL_ONEAPI_GPU)
24 
25 namespace alpaka
26 {
27  //! The Intel GPU SYCL accelerator.
28  //!
29  //! This accelerator allows parallel kernel execution on a oneAPI-capable Intel GPU target device.
30  template<typename TDim, typename TIdx>
31  class AccGpuSyclIntel final
32  : public AccGenericSycl<TDim, TIdx>
33  , public concepts::Implements<ConceptAcc, AccGpuSyclIntel<TDim, TIdx>>
34  {
35  public:
36  using AccGenericSycl<TDim, TIdx>::AccGenericSycl;
37  };
38 } // namespace alpaka
39 
40 namespace alpaka::trait
41 {
42  //! The Intel GPU SYCL accelerator name trait specialization.
43  template<typename TDim, typename TIdx>
44  struct GetAccName<AccGpuSyclIntel<TDim, TIdx>>
45  {
46  static auto getAccName() -> std::string
47  {
48  return "AccGpuSyclIntel<" + std::to_string(TDim::value) + "," + core::demangled<TIdx> + ">";
49  }
50  };
51 
52  //! The Intel GPU SYCL accelerator device type trait specialization.
53  template<typename TDim, typename TIdx>
54  struct DevType<AccGpuSyclIntel<TDim, TIdx>>
55  {
56  using type = DevGpuSyclIntel;
57  };
58 
59  //! The Intel GPU SYCL accelerator execution task type trait specialization.
60  template<typename TDim, typename TIdx, typename TWorkDiv, typename TKernelFnObj, typename... TArgs>
61  struct CreateTaskKernel<AccGpuSyclIntel<TDim, TIdx>, TWorkDiv, TKernelFnObj, TArgs...>
62  {
63  static auto createTaskKernel(TWorkDiv const& workDiv, TKernelFnObj const& kernelFnObj, TArgs&&... args)
64  {
65  return TaskKernelGpuSyclIntel<TDim, TIdx, TKernelFnObj, TArgs...>{
66  workDiv,
67  kernelFnObj,
68  std::forward<TArgs>(args)...};
69  }
70  };
71 
72  //! The Intel GPU SYCL execution task platform type trait specialization.
73  template<typename TDim, typename TIdx>
74  struct PlatformType<AccGpuSyclIntel<TDim, TIdx>>
75  {
76  using type = PlatformGpuSyclIntel;
77  };
78 
79  template<typename TDim, typename TIdx>
80  struct AccToTag<alpaka::AccGpuSyclIntel<TDim, TIdx>>
81  {
82  using type = alpaka::TagGpuSyclIntel;
83  };
84 
85  template<typename TDim, typename TIdx>
86  struct TagToAcc<alpaka::TagGpuSyclIntel, TDim, TIdx>
87  {
88  using type = alpaka::AccGpuSyclIntel<TDim, TIdx>;
89  };
90 } // namespace alpaka::trait
91 
92 #endif
The accelerator traits.
The alpaka accelerator library.
ALPAKA_FN_HOST auto createTaskKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
Creates a kernel execution task.
Definition: Traits.hpp:262
typename trait::AccToTag< TAcc >::type AccToTag
maps an acc type to a tag type
Definition: Tag.hpp:47
typename trait::TagToAcc< TTag, TDim, TIdx >::type TagToAcc
maps a tag type to an acc type
Definition: Tag.hpp:54
static ALPAKA_FN_HOST auto getAccName() -> std::string
Definition: Traits.hpp:49