DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
property_list.hpp
Go to the documentation of this file.
1 //==--------- property_list.hpp --- SYCL property list ---------------------==//
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 
14 
16 namespace sycl {
17 namespace ext {
18 namespace oneapi {
19 template <typename... PropsT> class accessor_property_list;
20 }
21 } // namespace ext
22 
27 
28  // The structs validate that all objects passed are SYCL properties
29  template <typename... Tail> struct AllProperties : std::true_type {};
30  template <typename T, typename... Tail>
31  struct AllProperties<T, Tail...>
32  : detail::conditional_t<is_property<T>::value, AllProperties<Tail...>,
33  std::false_type> {};
34 
35 public:
36  template <typename... PropsT, typename = typename detail::enable_if_t<
37  AllProperties<PropsT...>::value>>
38  property_list(PropsT... Props) : detail::PropertyListBase(false) {
39  ctorHelper(Props...);
40  }
41 
42  template <typename PropT> PropT get_property() const {
43  if (!has_property<PropT>())
44  throw sycl::invalid_object_error("The property is not found",
46 
47  return get_property_helper<PropT>();
48  }
49 
50  template <typename PropT> bool has_property() const {
51  return has_property_helper<PropT>();
52  }
53 
54  template <typename... T> operator ext::oneapi::accessor_property_list<T...>();
55 
56 private:
57  template <typename... PropsT>
59 };
60 
61 } // namespace sycl
62 } // __SYCL_INLINE_NAMESPACE(cl)
property_traits.hpp
property_list_base.hpp
cl::sycl::property_list::has_property
bool has_property() const
Definition: property_list.hpp:50
cl::sycl::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition: property_list.hpp:26
cl::sycl::detail::PropertyListBase
Definition: property_list_base.hpp:22
cl::sycl::detail::conditional_t
typename std::conditional< B, T, F >::type conditional_t
Definition: stl_type_traits.hpp:27
cl::sycl::property_list::property_list
property_list(PropsT... Props)
Definition: property_list.hpp:38
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::ext::oneapi::accessor_property_list
Objects of the accessor_property_list class are containers for the SYCL properties.
Definition: property_list.hpp:19
cl::sycl::property_list::get_property
PropT get_property() const
Definition: property_list.hpp:42
PI_INVALID_VALUE
@ PI_INVALID_VALUE
Definition: pi.h:87
common.hpp
cl::sycl::detail::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition: stl_type_traits.hpp:24
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12