diff --git a/sycl/include/CL/sycl/accessor.hpp b/sycl/include/CL/sycl/accessor.hpp index fe04af92ad7f2..1f1adf77ec7da 100755 --- a/sycl/include/CL/sycl/accessor.hpp +++ b/sycl/include/CL/sycl/accessor.hpp @@ -1856,6 +1856,18 @@ class accessor> + accessor(handler &, const property_list &propList) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(range{1}) { + (void)propList; + } +#else + : LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT)) { + (void)propList; + } +#endif + template 0)>> accessor(range AllocationSize, handler &) #ifdef __SYCL_DEVICE_ONLY__ @@ -1867,6 +1879,20 @@ class accessor 0)>> + accessor(range AllocationSize, handler &, + const property_list &propList) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(AllocationSize) { + (void)propList; + } +#else + : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize), + AdjustedDim, sizeof(DataT)) { + (void)propList; + } +#endif + size_t get_size() const { return getSize().size() * sizeof(DataT); } size_t get_count() const { return getSize().size(); } @@ -1954,6 +1980,20 @@ class accessor + accessor(cl::sycl::image &Image, + handler &CommandGroupHandler, const property_list &propList) + : detail::image_accessor( + Image, CommandGroupHandler, + (detail::getSyclObjImpl(Image))->getElementSize()) { + (void)propList; +#ifndef __SYCL_DEVICE_ONLY__ + detail::associateWithHandler(CommandGroupHandler, this, + access::target::image); #endif } #ifdef __SYCL_DEVICE_ONLY__ @@ -1994,6 +2034,15 @@ class accessor( Image, (detail::getSyclObjImpl(Image))->getElementSize()) {} + + template + accessor(cl::sycl::image &Image, + const property_list &propList) + : detail::image_accessor( + Image, (detail::getSyclObjImpl(Image))->getElementSize()) { + (void)propList; + } }; /// Image array accessor. @@ -2041,6 +2090,20 @@ class accessor + accessor(cl::sycl::image &Image, + handler &CommandGroupHandler, const property_list &propList) + : detail::image_accessor( + Image, CommandGroupHandler, + (detail::getSyclObjImpl(Image))->getElementSize()) { + (void)propList; +#ifndef __SYCL_DEVICE_ONLY__ + detail::associateWithHandler(CommandGroupHandler, this, + access::target::image_array); +#endif + } + detail::__image_array_slice__ operator[](size_t Index) const { return detail::__image_array_slice__