1
- // ==----- fpga_kernel_properties.hpp - SYCL properties associated with FPGA
2
- // kernel properties ---==//
1
+ // === --------------------- fpga_kernel_properties.hpp ---------------------===//
2
+ // SYCL properties associated with FPGA kernel properties
3
3
//
4
4
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
5
// See https://llvm.org/LICENSE.txt for license information.
12
12
#include < sycl/ext/oneapi/properties/property.hpp>
13
13
#include < sycl/ext/oneapi/properties/property_value.hpp>
14
14
15
+ #include < cstdint>
16
+ #include < type_traits>
17
+
15
18
namespace sycl {
16
19
inline namespace _V1 {
17
20
namespace ext ::intel::experimental {
18
21
19
22
template <typename T, typename PropertyListT> class fpga_kernel_attribute ;
23
+ template <auto &f, typename PropertyListT> class task_sequence ;
20
24
21
25
enum class streaming_interface_options_enum : uint16_t {
22
26
accept_downstream_stall,
@@ -28,6 +32,11 @@ enum class register_map_interface_options_enum : uint16_t {
28
32
wait_for_done_write,
29
33
};
30
34
35
+ enum class fpga_cluster_options_enum : std::uint16_t {
36
+ stall_free,
37
+ stall_enable
38
+ };
39
+
31
40
struct streaming_interface_key
32
41
: oneapi::experimental::detail::compile_time_property_key<
33
42
oneapi::experimental::detail::PropKind::StreamingInterface> {
@@ -54,6 +63,15 @@ struct pipelined_key : oneapi::experimental::detail::compile_time_property_key<
54
63
std::integral_constant<int , pipeline_directive_or_initiation_interval>>;
55
64
};
56
65
66
+ struct fpga_cluster_key
67
+ : oneapi::experimental::detail::compile_time_property_key<
68
+ oneapi::experimental::detail::PropKind::FPGACluster> {
69
+ template <fpga_cluster_options_enum option>
70
+ using value_t = ext::oneapi::experimental::property_value<
71
+ fpga_cluster_key,
72
+ std::integral_constant<fpga_cluster_options_enum, option>>;
73
+ };
74
+
57
75
template <streaming_interface_options_enum option =
58
76
streaming_interface_options_enum::accept_downstream_stall>
59
77
inline constexpr streaming_interface_key::value_t <option> streaming_interface;
@@ -84,6 +102,18 @@ inline constexpr pipelined_key::value_t<
84
102
pipeline_directive_or_initiation_interval>
85
103
pipelined;
86
104
105
+ template <fpga_cluster_options_enum option =
106
+ fpga_cluster_options_enum::stall_free>
107
+ inline constexpr fpga_cluster_key::value_t <option> fpga_cluster;
108
+
109
+ inline constexpr fpga_cluster_key::value_t <
110
+ fpga_cluster_options_enum::stall_free>
111
+ stall_free_clusters;
112
+
113
+ inline constexpr fpga_cluster_key::value_t <
114
+ fpga_cluster_options_enum::stall_enable>
115
+ stall_enable_clusters;
116
+
87
117
} // namespace ext::intel::experimental
88
118
89
119
namespace ext ::oneapi::experimental {
@@ -103,6 +133,22 @@ struct is_property_key_of<
103
133
intel::experimental::fpga_kernel_attribute<T, PropertyListT>>
104
134
: std::true_type {};
105
135
136
+ template <typename T, typename PropertyListT>
137
+ struct is_property_key_of <
138
+ intel::experimental::fpga_cluster_key,
139
+ intel::experimental::fpga_kernel_attribute<T, PropertyListT>>
140
+ : std::true_type {};
141
+
142
+ template <auto &f, typename PropertyListT>
143
+ struct is_property_key_of <intel::experimental::pipelined_key,
144
+ intel::experimental::task_sequence<f, PropertyListT>>
145
+ : std::true_type {};
146
+
147
+ template <auto &f, typename PropertyListT>
148
+ struct is_property_key_of <intel::experimental::fpga_cluster_key,
149
+ intel::experimental::task_sequence<f, PropertyListT>>
150
+ : std::true_type {};
151
+
106
152
namespace detail {
107
153
template <intel::experimental::streaming_interface_options_enum option>
108
154
struct HasCompileTimeEffect <
@@ -133,6 +179,14 @@ struct PropertyMetaInfo<intel::experimental::pipelined_key::value_t<Value>> {
133
179
static constexpr int value = Value;
134
180
};
135
181
182
+ template <intel::experimental::fpga_cluster_options_enum ClusterType>
183
+ struct PropertyMetaInfo <
184
+ intel::experimental::fpga_cluster_key::value_t <ClusterType>> {
185
+ static constexpr const char *name = " sycl-fpga-cluster" ;
186
+ static constexpr intel::experimental::fpga_cluster_options_enum value =
187
+ ClusterType;
188
+ };
189
+
136
190
} // namespace detail
137
191
} // namespace ext::oneapi::experimental
138
192
} // namespace _V1
0 commit comments