| 144 | |
| 145 | template<typename T> |
| 146 | void 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 | |
| 159 | template<typename T> |
| 160 | detail::Array<T> &getCopyOnWriteArray(const af_array &arr) { |
nothing calls this directly
no test coverage detected