Skip to content

Commit db09873

Browse files
authored
[SYCL] Add Property interface to 4 runtime classes (#12801)
This PR adds the property interface functions get_property and has_property to host_sampled_image_accessor, host_unsampled_image_accessor, sampled_image_accessor and unsampled_image_accessor runtime classes.
1 parent 03318d5 commit db09873

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

sycl/include/sycl/accessor.hpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,20 @@ class __SYCL_EBO unsampled_image_accessor :
37613761
}
37623762

37633763
/* -- property interface members -- */
3764+
template <typename Property> bool has_property() const noexcept {
3765+
#ifndef __SYCL_DEVICE_ONLY__
3766+
return getPropList().template has_property<Property>();
3767+
#else
3768+
return false;
3769+
#endif
3770+
}
3771+
template <typename Property> Property get_property() const {
3772+
#ifndef __SYCL_DEVICE_ONLY__
3773+
return getPropList().template get_property<Property>();
3774+
#else
3775+
return Property();
3776+
#endif
3777+
}
37643778

37653779
size_t size() const noexcept {
37663780
#ifdef __SYCL_DEVICE_ONLY__
@@ -3886,6 +3900,20 @@ class __SYCL_EBO host_unsampled_image_accessor
38863900
}
38873901

38883902
/* -- property interface members -- */
3903+
template <typename Property> bool has_property() const noexcept {
3904+
#ifndef __SYCL_DEVICE_ONLY__
3905+
return getPropList().template has_property<Property>();
3906+
#else
3907+
return false;
3908+
#endif
3909+
}
3910+
template <typename Property> Property get_property() const {
3911+
#ifndef __SYCL_DEVICE_ONLY__
3912+
return getPropList().template get_property<Property>();
3913+
#else
3914+
return Property();
3915+
#endif
3916+
}
38893917

38903918
size_t size() const noexcept { return base_class::getSize().size(); }
38913919

@@ -4032,6 +4060,20 @@ class __SYCL_EBO sampled_image_accessor :
40324060
}
40334061

40344062
/* -- property interface members -- */
4063+
template <typename Property> bool has_property() const noexcept {
4064+
#ifndef __SYCL_DEVICE_ONLY__
4065+
return getPropList().template has_property<Property>();
4066+
#else
4067+
return false;
4068+
#endif
4069+
}
4070+
template <typename Property> Property get_property() const {
4071+
#ifndef __SYCL_DEVICE_ONLY__
4072+
return getPropList().template get_property<Property>();
4073+
#else
4074+
return Property();
4075+
#endif
4076+
}
40354077

40364078
size_t size() const noexcept {
40374079
#ifdef __SYCL_DEVICE_ONLY__
@@ -4132,6 +4174,20 @@ class __SYCL_EBO host_sampled_image_accessor
41324174
}
41334175

41344176
/* -- property interface members -- */
4177+
template <typename Property> bool has_property() const noexcept {
4178+
#ifndef __SYCL_DEVICE_ONLY__
4179+
return getPropList().template has_property<Property>();
4180+
#else
4181+
return false;
4182+
#endif
4183+
}
4184+
template <typename Property> Property get_property() const {
4185+
#ifndef __SYCL_DEVICE_ONLY__
4186+
return getPropList().template get_property<Property>();
4187+
#else
4188+
return Property();
4189+
#endif
4190+
}
41354191

41364192
size_t size() const noexcept { return base_class::getSize().size(); }
41374193

0 commit comments

Comments
 (0)