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