DPC++ Runtime
Runtime libraries for oneAPI DPC++
common.hpp
Go to the documentation of this file.
1 //==---------------- common.hpp - DPC++ Explicit SIMD API ----------------==//
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 // Common definitions used in experimental Explicit SIMD APIs.
9 //===----------------------------------------------------------------------===//
10 
11 #pragma once
12 
17 
18 #include <cstdint>
19 #include <type_traits>
20 
21 namespace sycl {
22 inline namespace _V1 {
23 namespace ext::intel::experimental::esimd {
24 
27 
30 enum class __SYCL_DEPRECATED(
31  "use sycl::ext::intel::esimd::fence_scope") lsc_scope : uint8_t {
32  group = 0,
33  local = 1,
34  tile = 2,
35  gpu = 3,
36  gpus = 4,
37  system = 5,
38  sysacq = 6,
39 };
40 
44  lsc_fence_op : uint8_t {
45  none = 0,
46  evict = 1,
47  invalidate = 2,
48  discard = 3,
49  clean = 4,
51  flushl3 = 5,
52  };
53 
57  lsc_memory_kind : uint8_t {
58  untyped_global = 0,
59  untyped_global_low_pri = 1,
60  typed_global = 2,
61  shared_local = 3,
62  };
63 
65 
66 namespace detail {
67 
69 
71 
72 template <lsc_vector_size VS> constexpr void check_lsc_vector_size() {
73  __ESIMD_DNS::check_lsc_vector_size<VS>();
74 }
75 
76 template <int VS> constexpr void check_lsc_vector_size() {
77  __ESIMD_DNS::check_lsc_vector_size<VS>();
78 }
79 
80 template <typename T, lsc_data_size DS> constexpr void check_lsc_data_size() {
81  __ESIMD_DNS::check_lsc_data_size<T, DS>();
82 }
83 
84 template <lsc_vector_size VS> constexpr uint8_t to_int() {
85  return __ESIMD_DNS::to_int<VS>();
86 }
87 
88 template <int VS> constexpr lsc_vector_size to_lsc_vector_size() {
89  return __ESIMD_DNS::to_lsc_vector_size<VS>();
90 }
91 
92 template <typename T, lsc_data_size DS>
94  return __ESIMD_DNS::finalize_data_size<T, DS>();
95 }
96 
99 }
100 
101 template <typename T> struct lsc_expand_type {
102  using type = __ESIMD_DNS::lsc_expand_type<T>::type;
103 };
104 
105 } // namespace detail
106 
109 
111 enum class split_barrier_action : uint8_t {
112  wait = 0, // split barrier wait
113  signal = 1, // split barrier signal
114 };
115 
117 
118 } // namespace ext::intel::experimental::esimd
119 } // namespace _V1
120 } // namespace sycl
("use sycl::ext::intel::esimd::memory_kind") lsc_memory_kind __ESIMD_DNS::lsc_data_size lsc_data_size
The scope that lsc_fence operation should apply to Supported platforms: DG2, PVC.
Definition: common.hpp:64
sycl::ext::intel::esimd::cache_hint cache_hint
L1 or L2 cache hint kinds.
Definition: common.hpp:108
split_barrier_action
Represents a split barrier action.
Definition: common.hpp:111
__SYCL_DEPRECATED("Please use sycl::ext::intel::esimd::addc(carry, src0, src1);") __ESIMD_API sycl
Definition: math.hpp:500
cache_hint
L1, L2 or L3 cache hints.
fence_scope
The scope that fence() operation should apply to.
Definition: common.hpp:350
fence_flush_op
The cache flush operation to apply to caches after fence() is complete.
Definition: common.hpp:384
memory_kind
The target memory kind for fence() operation.
Definition: common.hpp:397
constexpr lsc_data_size finalize_data_size()
Definition: common.hpp:93
constexpr lsc_vector_size to_lsc_vector_size()
Definition: common.hpp:88
constexpr lsc_data_size expand_data_size(lsc_data_size DS)
Definition: common.hpp:97
__ESIMD_DNS::lsc_data_order lsc_data_order
Definition: common.hpp:70
__ESIMD_DNS::lsc_vector_size lsc_vector_size
Definition: common.hpp:68
Definition: access.hpp:18