MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / GPUOptions

Method GPUOptions

utils/spec_store.go:90–116  ·  view source on GitHub ↗

GPUOptions returns the GPU type identifiers available in any size, ordered by gpuDisplayOrder. Out-of-stock types are preserved in the list but pushed to the bottom.

()

Source from the content-addressed store, hash-verified

88// ordered by gpuDisplayOrder. Out-of-stock types are preserved in the list but
89// pushed to the bottom.
90func (s *SpecStore) GPUOptions() []string {
91 seen := map[string]bool{}
92 for key := range s.specs {
93 gpuType := strings.Split(key, "_x")[0]
94 seen[gpuType] = true
95 }
96 var ordered []string
97 for _, gpu := range gpuDisplayOrder {
98 if seen[gpu] {
99 ordered = append(ordered, gpu)
100 }
101 }
102 for gpuType := range seen {
103 if !slices.Contains(gpuDisplayOrder, gpuType) {
104 ordered = append(ordered, gpuType)
105 }
106 }
107 var available, unavailable []string
108 for _, gpu := range ordered {
109 if s.IsGPUTypeAvailable(gpu) {
110 available = append(available, gpu)
111 } else {
112 unavailable = append(unavailable, gpu)
113 }
114 }
115 return append(available, unavailable...)
116}
117
118// GPUCounts returns all valid GPU counts for a given GPU type, sorted.
119func (s *SpecStore) GPUCounts(gpuType string) []int {

Callers 12

NormalizeGPUTypeMethod · 0.95
TestGPUOptionsFunction · 0.80
handleEnterMethod · 0.80
getMaxCursorMethod · 0.80
computePreviewPriceMethod · 0.80
renderGPUStepMethod · 0.80
getGPUOptionsMethod · 0.80
computePreviewPriceMethod · 0.80
validateCreateConfigFunction · 0.80

Calls 1

IsGPUTypeAvailableMethod · 0.95

Tested by 2

TestGPUOptionsFunction · 0.64