Skip to content

[SYCL][ABI-Break] Add noexcept to has_property #6539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(SYCL_MINOR_VERSION 7)
set(SYCL_PATCH_VERSION 0)
# Don't forget to re-enable sycl_symbols_windows.dump once we leave ABI-breaking
# window!
set(SYCL_DEV_ABI_VERSION 6)
set(SYCL_DEV_ABI_VERSION 7)
if (SYCL_ADD_DEV_VERSION_POSTFIX)
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ class buffer {
impl, range<1>{sz / sizeof(ReinterpretT)}, OffsetInBytes, IsSubBuffer);
}

template <typename propertyT> bool has_property() const {
template <typename propertyT> bool has_property() const noexcept {
return impl->template has_property<propertyT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class __SYCL_EXPORT context {
/// Checks if this context has a property of type propertyT.
///
/// \return true if this context has a property of type propertyT.
template <typename propertyT> bool has_property() const;
template <typename propertyT> bool has_property() const noexcept;

/// Gets the specified property of this context.
///
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/sycl/detail/property_list_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PropertyListBase {
template <typename PropT>
typename detail::enable_if_t<
std::is_base_of<DataLessPropertyBase, PropT>::value, bool>
has_property_helper() const {
has_property_helper() const noexcept {
const int PropKind = static_cast<int>(PropT::getKind());
if (PropKind > detail::DataLessPropKind::LastKnownDataLessPropKind)
return false;
Expand All @@ -70,7 +70,7 @@ class PropertyListBase {
template <typename PropT>
typename detail::enable_if_t<
std::is_base_of<PropertyWithDataBase, PropT>::value, bool>
has_property_helper() const {
has_property_helper() const noexcept {
const int PropKind = static_cast<int>(PropT::getKind());
for (const std::shared_ptr<PropertyWithDataBase> &Prop : MPropsWithData)
if (Prop->isSame(PropKind))
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/detail/sycl_mem_obj_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI {
return (getSize() + AllocatorValueSize - 1) / AllocatorValueSize;
}

template <typename propertyT> __SYCL_DLL_LOCAL bool has_property() const {
template <typename propertyT>
__SYCL_DLL_LOCAL bool has_property() const noexcept {
return MProps.has_property<propertyT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class image {
bool operator!=(const image &rhs) const { return !(*this == rhs); }

/* -- property interface members -- */
template <typename propertyT> bool has_property() const {
template <typename propertyT> bool has_property() const noexcept {
return impl->template has_property<propertyT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/property_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class property_list : protected detail::PropertyListBase {
return get_property_helper<PropT>();
}

template <typename PropT> bool has_property() const {
template <typename PropT> bool has_property() const noexcept {
return has_property_helper<PropT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class __SYCL_EXPORT queue {

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

/// \return a copy of the property of type PropertyT that the queue was
/// constructed with. If the queue was not constructed with the PropertyT
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/sampler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class __SYCL_EXPORT __SYCL_SPECIAL_CLASS sampler {
/// Checks if this sampler has a property of type propertyT.
///
/// \return true if this sampler has a property of type propertyT.
template <typename propertyT> bool has_property() const;
template <typename propertyT> bool has_property() const noexcept;

/// Gets the specified property of this sampler.
///
Expand Down
3 changes: 2 additions & 1 deletion sycl/source/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ context::get_info() const {
#undef __SYCL_PARAM_TRAITS_SPEC

#define __SYCL_PARAM_TRAITS_SPEC(param_type) \
template <> __SYCL_EXPORT bool context::has_property<param_type>() const { \
template <> \
__SYCL_EXPORT bool context::has_property<param_type>() const noexcept { \
return impl->has_property<param_type>(); \
}
#include <sycl/detail/properties_traits.def>
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/context_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class context_impl {
/// Checks if this context_impl has a property of type propertyT.
///
/// \return true if this context_impl has a property of type propertyT.
template <typename propertyT> bool has_property() const {
template <typename propertyT> bool has_property() const noexcept {
return MPropList.has_property<propertyT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class queue_impl {

/// \return true if the queue was constructed with property specified by
/// PropertyT.
template <typename propertyT> bool has_property() const {
template <typename propertyT> bool has_property() const noexcept {
return MPropList.has_property<propertyT>();
}

Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/sampler_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class __SYCL_EXPORT sampler_impl {
/// Checks if this sampler_impl has a property of type propertyT.
///
/// \return true if this sampler_impl has a property of type propertyT.
template <typename propertyT> bool has_property() const {
template <typename propertyT> bool has_property() const noexcept {
return MPropList.has_property<propertyT>();
}

Expand Down
4 changes: 2 additions & 2 deletions sycl/source/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ queue::get_info() const {

#undef __SYCL_PARAM_TRAITS_SPEC

template <typename PropertyT> bool queue::has_property() const {
template <typename PropertyT> bool queue::has_property() const noexcept {
return impl->has_property<PropertyT>();
}

Expand All @@ -184,7 +184,7 @@ template <typename PropertyT> PropertyT queue::get_property() const {
}

template __SYCL_EXPORT bool
queue::has_property<property::queue::enable_profiling>() const;
queue::has_property<property::queue::enable_profiling>() const noexcept;
template __SYCL_EXPORT property::queue::enable_profiling
queue::get_property<property::queue::enable_profiling>() const;

Expand Down
3 changes: 2 additions & 1 deletion sycl/source/sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ bool sampler::operator!=(const sampler &rhs) const {
}

#define __SYCL_PARAM_TRAITS_SPEC(param_type) \
template <> __SYCL_EXPORT bool sampler::has_property<param_type>() const { \
template <> \
__SYCL_EXPORT bool sampler::has_property<param_type>() const noexcept { \
return impl->has_property<param_type>(); \
}
#include <sycl/detail/properties_traits.def>
Expand Down