MCPcopy Create free account
hub / github.com/apache/arrow / Instance

Method Instance

cpp/src/arrow/gpu/cuda_context.cc:600–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598std::unique_ptr<CudaDeviceManager> CudaDeviceManager::instance_ = nullptr;
599
600Result<CudaDeviceManager*> CudaDeviceManager::Instance() {
601 static std::mutex mutex;
602 static std::atomic<bool> init_end(false);
603
604 if (!init_end) {
605 std::lock_guard<std::mutex> lock(mutex);
606 if (!init_end) {
607 instance_.reset(new CudaDeviceManager());
608 RETURN_NOT_OK(instance_->impl_->Init());
609 init_end = true;
610 }
611 }
612 return instance_.get();
613}
614
615Result<std::shared_ptr<CudaDevice>> CudaDeviceManager::GetDevice(int device_number) {
616 return impl_->GetDevice(device_number);

Callers

nothing calls this directly

Calls 3

resetMethod · 0.45
InitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected