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

Method device

src/backend/opencl/api.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace af {
15template<>
16AFAPI cl_mem *array::device() const {
17 auto *mem_ptr = new cl_mem;
18 void *dptr = nullptr;
19 af_err err = af_get_device_ptr(&dptr, get());
20 memcpy(mem_ptr, &dptr, sizeof(void *));
21 if (err != AF_SUCCESS) {
22 throw af::exception("Failed to get cl_mem from array object");
23 }
24 return mem_ptr;
25}
26} // namespace af

Callers

nothing calls this directly

Calls 2

af_get_device_ptrFunction · 0.50
getFunction · 0.50

Tested by

no test coverage detected