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/detail/defines.hpp>
14 #include <sycl/stl.hpp>
15 #include <tuple>
16 
17 namespace sycl {
19 namespace ext::intel::experimental::detail {
20 
21 template <template <int32_t> class _Type, class _T>
22 struct _MatchType : std::is_same<_Type<_T::value>, _T> {};
23 
24 template <template <int32_t> class _Type, class... _T> struct _GetValue {
25  static constexpr auto value = _Type<0>::default_value;
26 };
27 
28 template <template <int32_t> class _Type, class _T1, class... _T>
29 struct _GetValue<_Type, _T1, _T...> {
30  static constexpr auto value =
31  std::conditional_t<_MatchType<_Type, _T1>::value, _T1,
32  _GetValue<_Type, _T...>>::value;
33 };
34 
35 // Get the specified property from the given compile-time property list. If
36 // the property is not provided in the property list, get the default version of
37 // this property.
38 template <typename PropListT, typename PropKeyT, typename DefaultPropValT,
39  typename = void>
41  using type = DefaultPropValT;
42 };
43 template <typename PropListT, typename PropKeyT, typename DefaultPropValT>
45  PropListT, PropKeyT, DefaultPropValT,
46  std::enable_if_t<PropListT::template has_property<PropKeyT>()>> {
47  using type = decltype(PropListT::template get_property<PropKeyT>());
48 };
49 
50 // Default latency_anchor_id property for latency control, indicating the
51 // applied operation is not an anchor.
53 // Default latency_constraint property for latency control, indicating the
54 // applied operation is not a non-anchor.
57 
58 } // namespace ext::intel::experimental::detail
59 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
60 } // namespace sycl
#define __SYCL_INLINE_VER_NAMESPACE(X)
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14