DPC++ Runtime
Runtime libraries for oneAPI DPC++
backend_types.hpp
Go to the documentation of this file.
1 //==-------------- backend_types.hpp - SYCL backend types ------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
11 #include <sycl/detail/defines.hpp>
13 
14 #include <fstream>
15 #include <istream>
16 #include <string>
17 
18 namespace sycl {
20 
21 enum class backend : char {
22  host __SYCL2020_DEPRECATED("'host' backend is no longer supported") = 0,
23  opencl = 1,
25  level_zero __SYCL2020_DEPRECATED("use 'ext_oneapi_level_zero' instead") =
27  ext_oneapi_cuda = 3,
28  cuda __SYCL2020_DEPRECATED("use 'ext_oneapi_cuda' instead") = ext_oneapi_cuda,
29  all = 4,
31  esimd_cpu __SYCL2020_DEPRECATED("use 'ext_intel_esimd_emulator' instead") =
33  ext_oneapi_hip = 6,
34  hip __SYCL2020_DEPRECATED("use 'ext_oneapi_hip' instead") = ext_oneapi_hip,
36 };
37 
38 template <backend Backend> class backend_traits;
39 
40 template <backend Backend, typename SYCLObjectT>
41 using backend_input_t =
42  typename backend_traits<Backend>::template input_type<SYCLObjectT>;
43 template <backend Backend, typename SYCLObjectT>
44 using backend_return_t =
45  typename backend_traits<Backend>::template return_type<SYCLObjectT>;
46 
47 inline std::ostream &operator<<(std::ostream &Out, backend be) {
48  switch (be) {
49  case backend::host:
50  Out << "host";
51  break;
52  case backend::opencl:
53  Out << "opencl";
54  break;
55  case backend::ext_oneapi_level_zero:
56  Out << "ext_oneapi_level_zero";
57  break;
58  case backend::ext_oneapi_cuda:
59  Out << "ext_oneapi_cuda";
60  break;
61  case backend::ext_intel_esimd_emulator:
62  Out << "ext_intel_esimd_emulator";
63  break;
64  case backend::ext_oneapi_hip:
65  Out << "ext_oneapi_hip";
66  break;
67  case backend::ext_oneapi_unified_runtime:
68  Out << "ext_oneapi_unified_runtime";
69  break;
70  case backend::all:
71  Out << "all";
72  }
73  return Out;
74 }
75 
76 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
77 } // namespace sycl
#define __SYCL_INLINE_VER_NAMESPACE(X)
#define __SYCL2020_DEPRECATED(message)
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
Definition: backend.hpp:72
std::ostream & operator<<(std::ostream &Out, backend be)
typename backend_traits< Backend >::template input_type< SyclType > backend_input_t
Definition: backend.hpp:68
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14