|
| 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> |
| 12 | +#include <sycl/detail/property_helper.hpp> |
| 13 | +#include <sycl/properties/property_traits.hpp> |
| 14 | + |
| 15 | +namespace sycl { |
| 16 | +__SYCL_INLINE_VER_NAMESPACE(_V1) { |
| 17 | +namespace ext { |
| 18 | +namespace codeplay { |
| 19 | +namespace experimental { |
| 20 | +namespace property { |
| 21 | + |
| 22 | +class promote_private |
| 23 | + : public detail::DataLessProperty<detail::FusionPromotePrivate> {}; |
| 24 | + |
| 25 | +class promote_local |
| 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 property |
| 37 | +} // namespace experimental |
| 38 | +} // namespace codeplay |
| 39 | +} // namespace ext |
| 40 | + |
| 41 | +// Forward declarations |
| 42 | +template <typename T, int Dimensions, typename AllocatorT, typename Enable> |
| 43 | +class buffer; |
| 44 | + |
| 45 | +template <typename DataT, int Dimensions, access::mode AccessMode, |
| 46 | + access::target AccessTarget, access::placeholder IsPlaceholder, |
| 47 | + typename PropertyListT> |
| 48 | +class accessor; |
| 49 | + |
| 50 | +class queue; |
| 51 | + |
| 52 | +// Property trait specializations. |
| 53 | +template <> |
| 54 | +struct is_property<ext::codeplay::experimental::property::promote_private> |
| 55 | + : std::true_type {}; |
| 56 | + |
| 57 | +template <> |
| 58 | +struct is_property<ext::codeplay::experimental::property::promote_local> |
| 59 | + : std::true_type {}; |
| 60 | + |
| 61 | +template <> |
| 62 | +struct is_property<ext::codeplay::experimental::property::no_barriers> |
| 63 | + : std::true_type {}; |
| 64 | + |
| 65 | +template <> |
| 66 | +struct is_property<ext::codeplay::experimental::property::force_fusion> |
| 67 | + : std::true_type {}; |
| 68 | + |
| 69 | +template <> |
| 70 | +struct is_property<ext::codeplay::experimental::property::queue::enable_fusion> |
| 71 | + : std::true_type {}; |
| 72 | + |
| 73 | +// Buffer property trait specializations |
| 74 | +template <typename T, int Dimensions, typename AllocatorT> |
| 75 | +struct is_property_of<ext::codeplay::experimental::property::promote_private, |
| 76 | + buffer<T, Dimensions, AllocatorT, void>> |
| 77 | + : std::true_type {}; |
| 78 | + |
| 79 | +template <typename T, int Dimensions, typename AllocatorT> |
| 80 | +struct is_property_of<ext::codeplay::experimental::property::promote_local, |
| 81 | + buffer<T, Dimensions, AllocatorT, void>> |
| 82 | + : std::true_type {}; |
| 83 | + |
| 84 | +// Accessor property trait specializations |
| 85 | +template <typename DataT, int Dimensions, access::mode AccessMode, |
| 86 | + access::target AccessTarget, access::placeholder IsPlaceholder, |
| 87 | + typename PropertyListT> |
| 88 | +struct is_property_of<ext::codeplay::experimental::property::promote_private, |
| 89 | + accessor<DataT, Dimensions, AccessMode, AccessTarget, |
| 90 | + IsPlaceholder, PropertyListT>> : std::true_type { |
| 91 | +}; |
| 92 | + |
| 93 | +template <typename DataT, int Dimensions, access::mode AccessMode, |
| 94 | + access::target AccessTarget, access::placeholder IsPlaceholder, |
| 95 | + typename PropertyListT> |
| 96 | +struct is_property_of<ext::codeplay::experimental::property::promote_local, |
| 97 | + accessor<DataT, Dimensions, AccessMode, AccessTarget, |
| 98 | + IsPlaceholder, PropertyListT>> : std::true_type { |
| 99 | +}; |
| 100 | + |
| 101 | +// Queue property trait specializations |
| 102 | +template <> |
| 103 | +struct is_property_of< |
| 104 | + ext::codeplay::experimental::property::queue::enable_fusion, queue> |
| 105 | + : std::true_type {}; |
| 106 | + |
| 107 | +} // __SYCL_INLINE_VER_NAMESPACE(_V1) |
| 108 | +} // namespace sycl |
0 commit comments