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

Function getScalar

src/backend/oneapi/copy.cpp:220–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219template<typename T>
220T getScalar(const Array<T> &in) {
221 T retVal{};
222
223 auto in_get = in.get();
224 getQueue()
225 .submit([&](sycl::handler &h) {
226 auto acc_in =
227 in_get->template get_access<sycl::access::mode::read>(
228 h, sycl::range{1},
229 sycl::id{static_cast<uintl>(in.getOffset())});
230 h.copy(acc_in, &retVal);
231 })
232 .wait();
233
234 return retVal;
235}
236
237#define INSTANTIATE_GETSCALAR(T) template T getScalar(const Array<T> &in);
238

Callers

nothing calls this directly

Calls 5

getQueueFunction · 0.50
getMethod · 0.45
waitMethod · 0.45
getOffsetMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected