2024-01-09 20:29:58 -08:00
|
|
|
package gpu
|
|
|
|
|
|
|
|
import (
|
|
|
|
"golang.org/x/sys/cpu"
|
|
|
|
)
|
|
|
|
|
2024-06-05 12:07:20 -07:00
|
|
|
func GetCPUCapability() CPUCapability {
|
2024-01-09 20:29:58 -08:00
|
|
|
if cpu.X86.HasAVX2 {
|
2024-05-15 15:13:16 -07:00
|
|
|
return CPUCapabilityAVX2
|
2024-01-09 20:29:58 -08:00
|
|
|
}
|
|
|
|
if cpu.X86.HasAVX {
|
2024-05-15 15:13:16 -07:00
|
|
|
return CPUCapabilityAVX
|
2024-01-09 20:29:58 -08:00
|
|
|
}
|
|
|
|
// else LCD
|
2024-06-05 12:07:20 -07:00
|
|
|
return CPUCapabilityNone
|
2024-01-09 20:29:58 -08:00
|
|
|
}
|