af_err af_release_array(af_array arr) { af_backend curr = unified::AFSymbolManager::getInstance().getActiveBackend(); af_backend other = curr; af_err err = af_get_backend_id(&other, arr); if (err != AF_SUCCESS) return err; unified::AFSymbolManager::getInstance().setBackend(other); err = CALL(arr); unified::AFSymbolManager::getInstance().setBackend(curr); return err; }
af::Backend getBackendId(const array &in) { af::Backend result = (af::Backend)0; AF_THROW(af_get_backend_id(&result, in.get())); return result; }