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

Function releaseHandle

src/api/c/handle.cpp:146–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145template<typename T>
146void releaseHandle(const af_array arr) {
147 auto &info = getInfo(arr);
148 int old_device = detail::getActiveDeviceId();
149 int array_id = info.getDevId();
150 if (array_id != old_device) {
151 detail::setDevice(array_id);
152 detail::destroyArray(static_cast<detail::Array<T> *>(arr));
153 detail::setDevice(old_device);
154 } else {
155 detail::destroyArray(static_cast<detail::Array<T> *>(arr));
156 }
157}
158
159template<typename T>
160detail::Array<T> &getCopyOnWriteArray(const af_array &arr) {

Callers

nothing calls this directly

Calls 4

getDevIdMethod · 0.80
getActiveDeviceIdFunction · 0.50
setDeviceFunction · 0.50
destroyArrayFunction · 0.50

Tested by

no test coverage detected