Skip to content

Commit 48ffa5c

Browse files
committed
[SYCL][COMPAT] Add a free function version of has_capability_or_fail
Signed-off-by: Jiang, Zhiwei <[email protected]>
1 parent 9402bd3 commit 48ffa5c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sycl/doc/syclcompat/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,10 @@ static inline unsigned int get_device_id(const sycl::device &dev);
10481048
// Util function to get the number of available devices
10491049
static inline unsigned int device_count();
10501050
1051+
// Util function to check whether a device supports some kinds of sycl::aspect.
1052+
static inline void
1053+
has_capability_or_fail(const sycl::device &dev,
1054+
const std::initializer_list<sycl::aspect> &props);
10511055
} // syclcompat
10521056
```
10531057

sycl/include/syclcompat/device.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,4 +959,10 @@ static inline unsigned int get_device_id(const sycl::device &dev) {
959959
static inline unsigned int device_count() {
960960
return detail::dev_mgr::instance().device_count();
961961
}
962+
963+
static inline void
964+
has_capability_or_fail(const sycl::device &dev,
965+
const std::initializer_list<sycl::aspect> &props) {
966+
get_device(get_device_id(dev)).has_capability_or_fail(props);
967+
}
962968
} // namespace syclcompat

0 commit comments

Comments
 (0)