| 268 | |
| 269 | template<typename outT> |
| 270 | sycl::buffer<outT> getBufferWithOffset(dim_t offset = -1) const { |
| 271 | offset = (offset == -1) ? getOffset() : offset; |
| 272 | dim_t sz_remaining = data_dims.elements() - offset; |
| 273 | if constexpr (std::is_same_v<outT, T>) { |
| 274 | if (offset == 0) { return *get(); } |
| 275 | return sycl::buffer<outT, 1>(*get(), sycl::id<1>(offset), |
| 276 | sycl::range<1>(sz_remaining)); |
| 277 | } else { |
| 278 | if (offset == 0) { return get()->template reinterpret<outT, 1>(); } |
| 279 | return sycl::buffer<T, 1>(*get(), sycl::id<1>(offset), |
| 280 | sycl::range<1>(sz_remaining)) |
| 281 | .template reinterpret<outT, 1>(); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | int useCount() const { return data.use_count(); } |
| 286 | |