Skip to content

Commit 417b5a2

Browse files
[SYCL][ABI-Break] Add noexcept to has_property (#6539)
SYCL 2020 adds noexcept to has_property on SYCL objects that take property_list arguments. This changes adjust the existing implementation accordingly. Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
1 parent af18341 commit 417b5a2

15 files changed

+20
-17
lines changed

sycl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set(SYCL_MINOR_VERSION 7)
3030
set(SYCL_PATCH_VERSION 0)
3131
# Don't forget to re-enable sycl_symbols_windows.dump once we leave ABI-breaking
3232
# window!
33-
set(SYCL_DEV_ABI_VERSION 6)
33+
set(SYCL_DEV_ABI_VERSION 7)
3434
if (SYCL_ADD_DEV_VERSION_POSTFIX)
3535
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
3636
endif()

sycl/include/sycl/buffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class buffer {
523523
impl, range<1>{sz / sizeof(ReinterpretT)}, OffsetInBytes, IsSubBuffer);
524524
}
525525

526-
template <typename propertyT> bool has_property() const {
526+
template <typename propertyT> bool has_property() const noexcept {
527527
return impl->template has_property<propertyT>();
528528
}
529529

sycl/include/sycl/context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class __SYCL_EXPORT context {
178178
/// Checks if this context has a property of type propertyT.
179179
///
180180
/// \return true if this context has a property of type propertyT.
181-
template <typename propertyT> bool has_property() const;
181+
template <typename propertyT> bool has_property() const noexcept;
182182

183183
/// Gets the specified property of this context.
184184
///

sycl/include/sycl/detail/property_list_base.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class PropertyListBase {
6060
template <typename PropT>
6161
typename detail::enable_if_t<
6262
std::is_base_of<DataLessPropertyBase, PropT>::value, bool>
63-
has_property_helper() const {
63+
has_property_helper() const noexcept {
6464
const int PropKind = static_cast<int>(PropT::getKind());
6565
if (PropKind > detail::DataLessPropKind::LastKnownDataLessPropKind)
6666
return false;
@@ -70,7 +70,7 @@ class PropertyListBase {
7070
template <typename PropT>
7171
typename detail::enable_if_t<
7272
std::is_base_of<PropertyWithDataBase, PropT>::value, bool>
73-
has_property_helper() const {
73+
has_property_helper() const noexcept {
7474
const int PropKind = static_cast<int>(PropT::getKind());
7575
for (const std::shared_ptr<PropertyWithDataBase> &Prop : MPropsWithData)
7676
if (Prop->isSame(PropKind))

sycl/include/sycl/detail/sycl_mem_obj_t.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI {
9494
return (getSize() + AllocatorValueSize - 1) / AllocatorValueSize;
9595
}
9696

97-
template <typename propertyT> __SYCL_DLL_LOCAL bool has_property() const {
97+
template <typename propertyT>
98+
__SYCL_DLL_LOCAL bool has_property() const noexcept {
9899
return MProps.has_property<propertyT>();
99100
}
100101

sycl/include/sycl/image.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class image {
247247
bool operator!=(const image &rhs) const { return !(*this == rhs); }
248248

249249
/* -- property interface members -- */
250-
template <typename propertyT> bool has_property() const {
250+
template <typename propertyT> bool has_property() const noexcept {
251251
return impl->template has_property<propertyT>();
252252
}
253253

sycl/include/sycl/property_list.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class property_list : protected detail::PropertyListBase {
4747
return get_property_helper<PropT>();
4848
}
4949

50-
template <typename PropT> bool has_property() const {
50+
template <typename PropT> bool has_property() const noexcept {
5151
return has_property_helper<PropT>();
5252
}
5353

sycl/include/sycl/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class __SYCL_EXPORT queue {
462462

463463
/// \return true if the queue was constructed with property specified by
464464
/// PropertyT.
465-
template <typename PropertyT> bool has_property() const;
465+
template <typename PropertyT> bool has_property() const noexcept;
466466

467467
/// \return a copy of the property of type PropertyT that the queue was
468468
/// constructed with. If the queue was not constructed with the PropertyT

sycl/include/sycl/sampler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class __SYCL_EXPORT __SYCL_SPECIAL_CLASS sampler {
8888
/// Checks if this sampler has a property of type propertyT.
8989
///
9090
/// \return true if this sampler has a property of type propertyT.
91-
template <typename propertyT> bool has_property() const;
91+
template <typename propertyT> bool has_property() const noexcept;
9292

9393
/// Gets the specified property of this sampler.
9494
///

sycl/source/context.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ context::get_info() const {
103103
#undef __SYCL_PARAM_TRAITS_SPEC
104104

105105
#define __SYCL_PARAM_TRAITS_SPEC(param_type) \
106-
template <> __SYCL_EXPORT bool context::has_property<param_type>() const { \
106+
template <> \
107+
__SYCL_EXPORT bool context::has_property<param_type>() const noexcept { \
107108
return impl->has_property<param_type>(); \
108109
}
109110
#include <sycl/detail/properties_traits.def>

0 commit comments

Comments
 (0)