43ed358f9a
Now that we call the GPU discovery routines many times to update memory, this splits initial discovery from free memory updating.
20 lines
304 B
Go
20 lines
304 B
Go
package gpu
|
|
|
|
import (
|
|
"golang.org/x/sys/cpu"
|
|
)
|
|
|
|
func GetCPUVariant() string {
|
|
return getCPUCapability().ToVariant()
|
|
}
|
|
|
|
func getCPUCapability() CPUCapability {
|
|
if cpu.X86.HasAVX2 {
|
|
return CPUCapabilityAVX2
|
|
}
|
|
if cpu.X86.HasAVX {
|
|
return CPUCapabilityAVX
|
|
}
|
|
// else LCD
|
|
return CPUCapabilityBase
|
|
}
|