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

Function GPUDeviceName

tensorflow/core/common_runtime/direct_session_test.cc:2178–2187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2176}
2177
2178string GPUDeviceName(Session* session) {
2179 std::vector<DeviceAttributes> devices;
2180 TF_CHECK_OK(session->ListDevices(&devices));
2181 for (const DeviceAttributes& d : devices) {
2182 if (d.device_type() == "GPU" || d.device_type() == "gpu") {
2183 return d.name();
2184 }
2185 }
2186 return "";
2187}
2188
2189TEST(DirectSessionTest, FeedAndFetchTensorsInDeviceMemory) {
2190 std::unique_ptr<Session> session(NewSession(SessionOptions()));

Calls 3

nameMethod · 0.65
ListDevicesMethod · 0.45
device_typeMethod · 0.45

Tested by

no test coverage detected