| 67 | } |
| 68 | |
| 69 | int64 AvailableGPUMemory(int gpu_id) { |
| 70 | #if GOOGLE_CUDA |
| 71 | // Look up the device, to see its attributes. |
| 72 | se::Platform* gpu_platform = GPUMachineManager(); |
| 73 | CHECK_LT(gpu_id, gpu_platform->VisibleDeviceCount()); |
| 74 | se::StreamExecutor* se = gpu_platform->ExecutorForDevice(gpu_id).ValueOrDie(); |
| 75 | int64 total_memory, available_memory; |
| 76 | CHECK(se->DeviceMemoryUsage(&available_memory, &total_memory)); |
| 77 | |
| 78 | return available_memory; |
| 79 | #else |
| 80 | return 0; |
| 81 | #endif |
| 82 | } |
| 83 | |
| 84 | int GetNumAvailableLogicalCPUCores() { return port::NumSchedulableCPUs(); } |
| 85 |
nothing calls this directly
no test coverage detected