Skip to content

Commit e574aa7

Browse files
committed
Add indeterminate constructor to work group memory interface
1 parent dc181bb commit e574aa7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class work_group_memory_impl {
3636
} // namespace detail
3737
namespace ext::oneapi::experimental {
3838

39+
struct indeterminate_t {};
40+
inline constexpr indeterminate_t indeterminate;
41+
3942
template <typename DataT, typename PropertyListT = empty_properties_t>
4043
class __SYCL_SPECIAL_CLASS __SYCL_TYPE(work_group_memory) work_group_memory
4144
: sycl::detail::work_group_memory_impl {
@@ -47,7 +50,13 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(work_group_memory) work_group_memory
4750
value_type, access::address_space::local_space>::type *;
4851

4952
public:
50-
work_group_memory() = default;
53+
// Frontend requries special types to have a default constructor in device
54+
// compilation mode in order to have a uniform way of initializing an object of
55+
// special type to then call the __init method on it. This is purely an
56+
// implementation detail and not part of the spec.
57+
#ifdef __SYCL_DEVICE_ONLY__
58+
work_group_memory(const indeterminate_t &);
59+
#endif
5160
work_group_memory(const work_group_memory &rhs) = default;
5261
work_group_memory &operator=(const work_group_memory &rhs) = default;
5362
template <typename T = DataT,

0 commit comments

Comments
 (0)