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

Function bufferAlloc

src/backend/opencl/memory.cpp:99–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99cl::Buffer *bufferAlloc(const size_t &bytes) {
100 dim4 dims(bytes);
101 if (bytes) {
102 void *ptr = memoryManager().alloc(false, 1, dims.get(), 1);
103 cl_mem mem = static_cast<cl_mem>(ptr);
104 cl::Buffer *buf = new cl::Buffer(mem, true);
105 return buf;
106 } else {
107 return nullptr;
108 }
109}
110
111void bufferFree(cl::Buffer *buf) {
112 if (buf) {

Callers 15

magma_mallocFunction · 0.85
sortByKeyBatchedFunction · 0.85
convSepFunction · 0.85
meanFirstFunction · 0.85
csr2cooFunction · 0.85
regionsFunction · 0.85
orbFunction · 0.85
scanFirstByKeyFunction · 0.85
scanDimFunction · 0.85
whereFunction · 0.85
scanFirstFunction · 0.85
fastFunction · 0.85

Calls 2

allocMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected