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

Function cusparseManager

src/backend/cuda/platform.cpp:170–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170unique_handle<cusparseHandle_t> *cusparseManager(const int deviceId) {
171 thread_local unique_handle<cusparseHandle_t>
172 handles[DeviceManager::MAX_DEVICES];
173 thread_local once_flag initFlags[DeviceManager::MAX_DEVICES];
174 call_once(initFlags[deviceId], [&] {
175 auto &_ = getCusparsePlugin();
176 handles[deviceId].create();
177 // TODO(pradeep) When multiple streams per device
178 // is added to CUDA backend, move the cublasSetStream
179 // call outside of call_once scope.
180 CUSPARSE_CHECK(
181 _.cusparseSetStream(handles[deviceId], getStream(deviceId)));
182 });
183 return &handles[deviceId];
184}
185
186DeviceManager::~DeviceManager() {
187 try {

Callers 2

~DeviceManagerMethod · 0.85
sparseHandleFunction · 0.85

Calls 2

getStreamFunction · 0.70
createMethod · 0.45

Tested by

no test coverage detected