gogpu.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
gogpu.go
@@ -23,6 +23,21 @@ return int(C.get_idle_gpu(C.int(memSize))) } // SatisfyGPU satisfy unit "M" func SatisfyGPU(index, memSize, reserve int) bool { info, err := Info() if err != nil || info.Count >= index { fmt.Println("SatisfyGPU no gpu or index ilegal: ", index, " gpu count : ", info.Count) return false } var M1 int64 = 1024 * 1024 if info.Info[index].GpuMemoryFree-int64(memSize)*M1 > int64(reserve)*M1 { return true } return false } // GPURank sort type GPURank []GpuUnitInfo