Skip to content

Commit 20bcec1

Browse files
[SYCL] Deprecate unintentionally public property_list APIs (#19789)
The implementation of SYCL property_list unintentionally exposed add_or_replace_accessor_properties and delete_accessor_property, despite the APIs not being part of the specification nor any extensions. This commite deprecates them and removes them under preview. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 241201f commit 20bcec1

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

sycl/include/sycl/property_list.hpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ template <typename... PropsT> class accessor_property_list;
2525
} // namespace ext::oneapi
2626
namespace detail {
2727
class PropertyValidator;
28+
class SYCLMemObjT;
2829
} // namespace detail
2930

3031
/// Objects of the property_list class are containers for the SYCL properties
@@ -58,15 +59,28 @@ class property_list : protected detail::PropertyListBase {
5859
return has_property_helper<PropT>();
5960
}
6061

62+
template <typename... T> operator ext::oneapi::accessor_property_list<T...>();
63+
64+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
65+
private:
66+
#endif
67+
68+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
69+
__SYCL_DEPRECATED("add_or_replace_accessor_properties() is not part of the "
70+
"SYCL API and will be removed in the future.")
71+
#endif
6172
void add_or_replace_accessor_properties(const property_list &PropertyList) {
6273
add_or_replace_accessor_properties_helper(PropertyList.MPropsWithData);
6374
}
75+
76+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
77+
__SYCL_DEPRECATED("delete_accessor_property() is not part of the SYCL API "
78+
"and will be removed in the future.")
79+
#endif
6480
void delete_accessor_property(const sycl::detail::PropWithDataKind &Kind) {
6581
delete_accessor_property_helper(Kind);
6682
}
6783

68-
template <typename... T> operator ext::oneapi::accessor_property_list<T...>();
69-
7084
private:
7185
property_list(
7286
std::bitset<detail::DataLessPropKind::DataLessPropKindSize> DataLessProps,
@@ -76,6 +90,7 @@ class property_list : protected detail::PropertyListBase {
7690
template <typename... PropsT>
7791
friend class ext::oneapi::accessor_property_list;
7892
friend class detail::PropertyValidator;
93+
friend class detail::SYCLMemObjT;
7994
};
8095

8196
namespace detail {

sycl/test/warnings/warnings_deprecated.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@ int main() {
1111
// expected-warning@+2{{'discard_events' is deprecated: use sycl_ext_oneapi_enqueue_functions instead}}
1212
sycl::property_list props{
1313
sycl::ext::oneapi::property::queue::discard_events{}};
14+
15+
// expected-warning@+1{{add_or_replace_accessor_properties() is not part of the SYCL API and will be removed in the future.}}
16+
props.add_or_replace_accessor_properties(props);
17+
18+
// expected-warning@+1{{delete_accessor_property() is not part of the SYCL API and will be removed in the future.}}
19+
props.delete_accessor_property(
20+
sycl::detail::PropWithDataKind::BufferUseMutex);
21+
1422
return 0;
1523
}

0 commit comments

Comments
 (0)