MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Initialize

Method Initialize

tensorflow/core/kernels/cuda_sparse.cc:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151Status CudaSparse::Initialize() {
152 HandleMap* handle_map = GetHandleMapSingleton();
153 DCHECK(handle_map);
154 mutex_lock lock(handle_map_mutex);
155 auto it = handle_map->find(cuda_stream_);
156 if (it == handle_map->end()) {
157 LOG(INFO) << "Creating CudaSparse handles for stream " << cuda_stream_;
158 // Previously unseen Cuda stream. Initialize a set of Cuda sparse library
159 // handles for it.
160 CudaSparseHandles new_handles(cuda_stream_);
161 TF_RETURN_IF_ERROR(new_handles.Initialize());
162 it =
163 handle_map->insert(std::make_pair(cuda_stream_, std::move(new_handles)))
164 .first;
165 }
166 cusparse_handle_ = &it->second.handle();
167 initialized_ = true;
168 return Status::OK();
169}
170
171// Macro that specializes a sparse method for all 4 standard
172// numeric types.

Callers

nothing calls this directly

Calls 5

GetHandleMapSingletonFunction · 0.70
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected