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

Method getMappedPtr

src/backend/opencl/Array.hpp:290–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289 public:
290 mapped_ptr<T> getMappedPtr(cl_map_flags map_flags = CL_MAP_READ |
291 CL_MAP_WRITE) const {
292 if (!isReady()) eval();
293 auto func = [data = data](void *ptr) {
294 if (ptr != nullptr) {
295 cl_int err = getQueue().enqueueUnmapMemObject(*data, ptr);
296 UNUSED(err);
297 ptr = nullptr;
298 }
299 };
300
301 T *ptr = (T *)getQueue().enqueueMapBuffer(
302 *static_cast<const cl::Buffer *>(get()), CL_TRUE, map_flags,
303 getOffset() * sizeof(T), elements() * sizeof(T), nullptr, nullptr,
304 nullptr);
305
306 return mapped_ptr<T>(ptr, func);
307 }
308
309 friend void evalMultiple<T>(std::vector<Array<T> *> arrays);
310

Callers 15

qrFunction · 0.45
qr_inplaceFunction · 0.45
matmulFunction · 0.45
mvFunction · 0.45
mtvFunction · 0.45
mmFunction · 0.45
mtmFunction · 0.45
gemmFunction · 0.45
svdInPlaceFunction · 0.45
choleskyFunction · 0.45
cholesky_inplaceFunction · 0.45
solveLUFunction · 0.45

Calls 4

evalClass · 0.70
getQueueFunction · 0.50
getFunction · 0.50
getOffsetFunction · 0.50

Tested by

no test coverage detected