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

Method DeviceFromContext

tensorflow/stream_executor/cuda/cuda_driver.cc:723–735  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

721}
722
723/* static */ port::StatusOr<CUdevice> GpuDriver::DeviceFromContext(
724 GpuContext* context) {
725 ScopedActivateContext activated{context};
726 CUdevice device = -1;
727 CUresult result = cuCtxGetDevice(&device);
728 if (result == CUDA_SUCCESS) {
729 return device;
730 }
731
732 return port::Status(
733 port::error::INTERNAL,
734 absl::StrCat("failed to get device for context: ", ToString(result)));
735}
736
737/* static */ bool GpuDriver::CreateStream(GpuContext* context,
738 CUstream* stream,

Callers

nothing calls this directly

Calls 3

ToStringFunction · 0.70
StatusEnum · 0.50
StrCatFunction · 0.50

Tested by

no test coverage detected