DPC++ Runtime
Runtime libraries for oneAPI DPC++
fpga_utils.hpp
Go to the documentation of this file.
1 //==------------- fpga_utils.hpp --- SYCL FPGA Reg Extensions --------------==//
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/ext/oneapi/latency_control/properties.hpp> // for latency_co...
12 
13 #include <stdint.h> // for int32_t
14 #include <type_traits> // for conditional_t
15 
16 namespace sycl {
17 inline namespace _V1 {
18 namespace ext::intel::experimental::detail {
19 
20 template <template <int32_t> class _Type, class _T>
21 struct _MatchType : std::is_same<_Type<_T::value>, _T> {};
22 
23 template <template <int32_t> class _Type, class... _T> struct _GetValue {
24  static constexpr auto value = _Type<0>::default_value;
25 };
26 
27 template <template <int32_t> class _Type, class _T1, class... _T>
28 struct _GetValue<_Type, _T1, _T...> {
29  static constexpr auto value =
30  std::conditional_t<_MatchType<_Type, _T1>::value, _T1,
31  _GetValue<_Type, _T...>>::value;
32 };
33 
34 // Get the specified property from the given compile-time property list. If
35 // the property is not provided in the property list, get the default version of
36 // this property.
37 template <typename PropListT, typename PropKeyT, typename DefaultPropValT,
38  typename = void>
40  using type = DefaultPropValT;
41 };
42 template <typename PropListT, typename PropKeyT, typename DefaultPropValT>
44  PropListT, PropKeyT, DefaultPropValT,
45  std::enable_if_t<PropListT::template has_property<PropKeyT>()>> {
46  using type = decltype(PropListT::template get_property<PropKeyT>());
47 };
48 
49 // Default latency_anchor_id property for latency control, indicating the
50 // applied operation is not an anchor.
52 // Default latency_constraint property for latency control, indicating the
53 // applied operation is not a non-anchor.
56 
57 } // namespace ext::intel::experimental::detail
58 } // namespace _V1
59 } // namespace sycl
Definition: access.hpp:18