Fix darwin intel build

This commit is contained in:
Daniel Hiltgen 2023-12-19 13:32:24 -08:00
parent 54dbfa4c4a
commit 6558f94ed0
4 changed files with 21 additions and 26 deletions

View file

@ -4,6 +4,8 @@ package gpu
import "C"
import (
"runtime"
"github.com/jmorganca/ollama/api"
)
@ -25,8 +27,12 @@ func GetGPUInfo() GpuInfo {
}
func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
// default to enable metal on macOS
return 1
if runtime.GOARCH == "arm64" {
return 1
}
// metal only supported on arm64
return 0
}
func nativeInit() error {