DPC++ Runtime
Runtime libraries for oneAPI DPC++
fusion_properties.hpp
Go to the documentation of this file.
1 //==----------- fusion_properties.hpp --- SYCL fusion properties -----------==//
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/access/access.hpp> // for mode, placeholder
12 #include <sycl/detail/property_helper.hpp> // for DataLessPropKind, Dat...
13 #include <sycl/properties/property_traits.hpp> // for is_property, is_prope...
14 #include <sycl/queue.hpp> // for queue
15 
16 #include <type_traits> // for true_type
17 
18 namespace sycl {
19 inline namespace _V1 {
20 namespace ext::codeplay::experimental::property {
21 
23  : public detail::DataLessProperty<detail::FusionPromotePrivate> {};
24 
26  : public detail::DataLessProperty<detail::FusionPromoteLocal> {};
27 
28 class no_barriers : public detail::DataLessProperty<detail::FusionNoBarrier> {};
29 
30 class force_fusion : public detail::DataLessProperty<detail::FusionForce> {};
31 
32 namespace queue {
33 class enable_fusion : public detail::DataLessProperty<detail::FusionEnable> {};
34 } // namespace queue
35 
36 } // namespace ext::codeplay::experimental::property
37 
38 // Forward declarations
39 template <typename T, int Dimensions, typename AllocatorT, typename Enable>
40 class buffer;
41 
42 template <typename DataT, int Dimensions, access::mode AccessMode,
44  typename PropertyListT>
45 class accessor;
46 
47 class queue;
48 
49 // Property trait specializations.
50 template <>
51 struct is_property<ext::codeplay::experimental::property::promote_private>
52  : std::true_type {};
53 
54 template <>
55 struct is_property<ext::codeplay::experimental::property::promote_local>
56  : std::true_type {};
57 
58 template <>
59 struct is_property<ext::codeplay::experimental::property::no_barriers>
60  : std::true_type {};
61 
62 template <>
63 struct is_property<ext::codeplay::experimental::property::force_fusion>
64  : std::true_type {};
65 
66 template <>
67 struct is_property<ext::codeplay::experimental::property::queue::enable_fusion>
68  : std::true_type {};
69 
70 // Buffer property trait specializations
71 template <typename T, int Dimensions, typename AllocatorT>
72 struct is_property_of<ext::codeplay::experimental::property::promote_private,
73  buffer<T, Dimensions, AllocatorT, void>>
74  : std::true_type {};
75 
76 template <typename T, int Dimensions, typename AllocatorT>
77 struct is_property_of<ext::codeplay::experimental::property::promote_local,
78  buffer<T, Dimensions, AllocatorT, void>>
79  : std::true_type {};
80 
81 // Accessor property trait specializations
82 template <typename DataT, int Dimensions, access::mode AccessMode,
84  typename PropertyListT>
85 struct is_property_of<ext::codeplay::experimental::property::promote_private,
86  accessor<DataT, Dimensions, AccessMode, AccessTarget,
87  IsPlaceholder, PropertyListT>> : std::true_type {
88 };
89 
90 template <typename DataT, int Dimensions, access::mode AccessMode,
92  typename PropertyListT>
93 struct is_property_of<ext::codeplay::experimental::property::promote_local,
94  accessor<DataT, Dimensions, AccessMode, AccessTarget,
95  IsPlaceholder, PropertyListT>> : std::true_type {
96 };
97 
98 // Queue property trait specializations
99 template <>
101  ext::codeplay::experimental::property::queue::enable_fusion, queue>
102  : std::true_type {};
103 
104 } // namespace _V1
105 } // namespace sycl
Defines a shared array that can be used by kernels in queues.
Definition: buffer.hpp:167
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition: queue.hpp:111
class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
class __SYCL_EBO __SYCL_SPECIAL_CLASS IsPlaceholder
class __SYCL_EBO __SYCL_SPECIAL_CLASS AccessMode
Definition: access.hpp:18