DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
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 
12 
13 #include <fstream>
14 #include <iostream>
15 #include <istream>
16 #include <string>
17 
19 namespace sycl {
20 
21 enum class backend : char {
22  host = 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_oneapi_esimd_emulator' instead") =
33  ext_oneapi_hip = 6,
34  hip __SYCL2020_DEPRECATED("use 'ext_oneapi_hip' instead") = ext_oneapi_hip,
35 };
36 
37 template <backend Backend> class backend_traits;
38 
39 template <backend Backend, typename SYCLObjectT>
40 using backend_input_t =
41  typename backend_traits<Backend>::template input_type<SYCLObjectT>;
42 template <backend Backend, typename SYCLObjectT>
43 using backend_return_t =
44  typename backend_traits<Backend>::template return_type<SYCLObjectT>;
45 
46 inline std::ostream &operator<<(std::ostream &Out, backend be) {
47  switch (be) {
48  case backend::host:
49  Out << "host";
50  break;
51  case backend::opencl:
52  Out << "opencl";
53  break;
54  case backend::ext_oneapi_level_zero:
55  Out << "ext_oneapi_level_zero";
56  break;
57  case backend::ext_oneapi_cuda:
58  Out << "ext_oneapi_cuda";
59  break;
60  case backend::ext_intel_esimd_emulator:
61  Out << "ext_intel_esimd_emulator";
62  break;
63  case backend::ext_oneapi_hip:
64  Out << "ext_oneapi_hip";
65  break;
66  case backend::all:
67  Out << "all";
68  }
69  return Out;
70 }
71 
72 } // namespace sycl
73 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::backend
backend
Definition: backend_types.hpp:21
cl::sycl::backend_return_t
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
Definition: backend.hpp:65
__SYCL2020_DEPRECATED
#define __SYCL2020_DEPRECATED(message)
Definition: defines_elementary.hpp:56
cl::sycl::backend::opencl
@ opencl
cl::sycl::backend::ext_intel_esimd_emulator
@ ext_intel_esimd_emulator
cl::sycl::operator<<
std::ostream & operator<<(std::ostream &Out, backend be)
Definition: backend_types.hpp:46
char
cl::sycl::backend::ext_oneapi_hip
@ ext_oneapi_hip
cl::sycl::backend::ext_oneapi_level_zero
@ ext_oneapi_level_zero
defines.hpp
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::backend::ext_oneapi_cuda
@ ext_oneapi_cuda
cl::sycl::backend_input_t
typename backend_traits< Backend >::template input_type< SyclType > backend_input_t
Definition: backend.hpp:61
cl::sycl::all
detail::enable_if_t< detail::is_sigeninteger< T >::value, int > all(T x) __NOEXC
Definition: builtins.hpp:1282
cl::sycl::aspect::host
@ host
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12