GPUCounts returns all valid GPU counts for a given GPU type, sorted.
(gpuType string)
| 117 | |
| 118 | // GPUCounts returns all valid GPU counts for a given GPU type, sorted. |
| 119 | func (s *SpecStore) GPUCounts(gpuType string) []int { |
| 120 | var counts []int |
| 121 | for gpuCount := 1; gpuCount <= 8; gpuCount++ { |
| 122 | if s.Lookup(gpuType, gpuCount) != nil { |
| 123 | counts = append(counts, gpuCount) |
| 124 | } |
| 125 | } |
| 126 | return counts |
| 127 | } |
| 128 | |
| 129 | // IsGPUTypeAvailable reports whether any count for this GPU type is available. |
| 130 | func (s *SpecStore) IsGPUTypeAvailable(gpuType string) bool { |