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

Function pinnedAlloc

src/backend/oneapi/memory.cpp:130–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129template<typename T>
130T *pinnedAlloc(const size_t &elements) {
131 // TODO: make pinnedAlloc aware of array shapes
132 dim4 dims(elements);
133 void *ptr = pinnedMemoryManager().alloc(false, 1, dims.get(), sizeof(T));
134 return static_cast<T *>(ptr);
135}
136
137void pinnedFree(void *ptr) { pinnedMemoryManager().unlock(ptr, false); }
138

Callers

nothing calls this directly

Calls 2

allocMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected