MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getBufferWithOffset

Method getBufferWithOffset

src/backend/oneapi/Array.hpp:270–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getOffsetFunction · 0.50
getFunction · 0.50
elementsMethod · 0.45

Tested by

no test coverage detected