Skip to content

Commit e35dd53

Browse files
committed
insert annotation in annotated_ptr::get()
1 parent 8ab4907 commit e35dd53

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sycl/include/sycl/ext/oneapi/experimental/annotated_ptr/annotated_ptr.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,15 @@ __SYCL_TYPE(annotated_ptr) annotated_ptr<T, detail::properties_t<Props...>> {
408408

409409
operator T *() const noexcept = delete;
410410

411-
T *get() const noexcept { return m_Ptr; }
411+
inline T *get() const noexcept {
412+
#ifdef __SYCL_DEVICE_ONLY__
413+
return __builtin_intel_sycl_ptr_annotation(
414+
m_Ptr, detail::PropertyMetaInfo<Props>::name...,
415+
detail::PropertyMetaInfo<Props>::value...);
416+
#else
417+
return m_Ptr;
418+
#endif
419+
}
412420

413421
annotated_ptr &operator++() noexcept {
414422
m_Ptr += 1;

0 commit comments

Comments
 (0)