|
18 | 18 |
|
19 | 19 | namespace sycl { |
20 | 20 | inline namespace _V1 { |
21 | | -namespace property::image { |
22 | | -class use_host_ptr : public detail::DataLessProperty<detail::ImageUseHostPtr> { |
23 | | -}; |
| 21 | +#define __SYCL_DATA_LESS_PROP(NS_QUALIFIER, PROP_NAME, ENUM_VAL) \ |
| 22 | + namespace NS_QUALIFIER { \ |
| 23 | + class PROP_NAME \ |
| 24 | + : public sycl::detail::DataLessProperty<sycl::detail::ENUM_VAL> {}; \ |
| 25 | + } |
| 26 | +#include <sycl/properties/image_properties.def> |
24 | 27 |
|
| 28 | +namespace property::image { |
25 | 29 | class use_mutex : public detail::PropertyWithData<detail::ImageUseMutex> { |
26 | 30 | public: |
27 | 31 | use_mutex(std::mutex &MutexRef) : MMutex(MutexRef) {} |
@@ -50,41 +54,32 @@ template <int Dimensions, typename AllocatorT> class sampled_image; |
50 | 54 | template <int Dimensions, typename AllocatorT> class unsampled_image; |
51 | 55 |
|
52 | 56 | // SYCL 1.2.1 image property trait specializations |
53 | | -template <int Dimensions, typename AllocatorT> |
54 | | -struct is_property_of<property::image::use_host_ptr, |
55 | | - image<Dimensions, AllocatorT>> : std::true_type {}; |
56 | | -template <int Dimensions, typename AllocatorT> |
57 | | -struct is_property_of<property::image::use_mutex, image<Dimensions, AllocatorT>> |
58 | | - : std::true_type {}; |
59 | | -template <int Dimensions, typename AllocatorT> |
60 | | -struct is_property_of<property::image::context_bound, |
61 | | - image<Dimensions, AllocatorT>> : std::true_type {}; |
| 57 | +#define __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) \ |
| 58 | + template <int Dimensions, typename AllocatorT> \ |
| 59 | + struct is_property_of<NS_QUALIFIER::PROP_NAME, \ |
| 60 | + image<Dimensions, AllocatorT>> : std::true_type {}; |
| 61 | +#define __SYCL_DATA_LESS_PROP(NS_QUALIFIER, PROP_NAME, ENUM_VAL) \ |
| 62 | + __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) |
| 63 | +#include <sycl/properties/image_properties.def> |
62 | 64 |
|
63 | 65 | // SYCL 2020 image property trait specializations |
64 | | -template <int Dimensions, typename AllocatorT> |
65 | | -struct is_property_of<property::image::use_host_ptr, |
66 | | - sampled_image<Dimensions, AllocatorT>> : std::true_type { |
67 | | -}; |
68 | | -template <int Dimensions, typename AllocatorT> |
69 | | -struct is_property_of<property::image::use_mutex, |
70 | | - sampled_image<Dimensions, AllocatorT>> : std::true_type { |
71 | | -}; |
72 | | -template <int Dimensions, typename AllocatorT> |
73 | | -struct is_property_of<property::image::context_bound, |
74 | | - sampled_image<Dimensions, AllocatorT>> : std::true_type { |
75 | | -}; |
76 | | -template <int Dimensions, typename AllocatorT> |
77 | | -struct is_property_of<property::image::use_host_ptr, |
78 | | - unsampled_image<Dimensions, AllocatorT>> |
79 | | - : std::true_type {}; |
80 | | -template <int Dimensions, typename AllocatorT> |
81 | | -struct is_property_of<property::image::use_mutex, |
82 | | - unsampled_image<Dimensions, AllocatorT>> |
83 | | - : std::true_type {}; |
84 | | -template <int Dimensions, typename AllocatorT> |
85 | | -struct is_property_of<property::image::context_bound, |
86 | | - unsampled_image<Dimensions, AllocatorT>> |
87 | | - : std::true_type {}; |
| 66 | +#define __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) \ |
| 67 | + template <int Dimensions, typename AllocatorT> \ |
| 68 | + struct is_property_of<NS_QUALIFIER::PROP_NAME, \ |
| 69 | + sampled_image<Dimensions, AllocatorT>> \ |
| 70 | + : std::true_type {}; |
| 71 | +#define __SYCL_DATA_LESS_PROP(NS_QUALIFIER, PROP_NAME, ENUM_VAL) \ |
| 72 | + __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) |
| 73 | +#include <sycl/properties/image_properties.def> |
| 74 | + |
| 75 | +#define __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) \ |
| 76 | + template <int Dimensions, typename AllocatorT> \ |
| 77 | + struct is_property_of<NS_QUALIFIER::PROP_NAME, \ |
| 78 | + unsampled_image<Dimensions, AllocatorT>> \ |
| 79 | + : std::true_type {}; |
| 80 | +#define __SYCL_DATA_LESS_PROP(NS_QUALIFIER, PROP_NAME, ENUM_VAL) \ |
| 81 | + __SYCL_MANUALLY_DEFINED_PROP(NS_QUALIFIER, PROP_NAME) |
| 82 | +#include <sycl/properties/image_properties.def> |
88 | 83 |
|
89 | 84 | } // namespace _V1 |
90 | 85 | } // namespace sycl |
0 commit comments