improve case
This commit is contained in:
parent
d5a2462c8e
commit
cafdb5c0d6
|
|
@ -70,8 +70,8 @@ func EnumerateGPUs() []ml.DeviceID {
|
|||
device := C.ggml_backend_dev_get(i)
|
||||
|
||||
switch C.ggml_backend_dev_type(device) {
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU,
|
||||
C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
var props C.struct_ggml_backend_dev_props
|
||||
C.ggml_backend_dev_get_props(device, &props)
|
||||
ids = append(ids, ml.DeviceID{
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ var initDevices = sync.OnceFunc(func() {
|
|||
}
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_ACCEL:
|
||||
accels = append(accels, d)
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU,
|
||||
C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
gpus = append(gpus, d)
|
||||
}
|
||||
|
||||
|
|
@ -472,8 +472,8 @@ func (b *Backend) Load(ctx context.Context, progress func(float32)) error {
|
|||
gpuLayers := 0
|
||||
for layer := range maps.Values(b.layers) {
|
||||
switch C.ggml_backend_dev_type(layer.d) {
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU,
|
||||
C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
gpuLayers++
|
||||
}
|
||||
}
|
||||
|
|
@ -482,8 +482,8 @@ func (b *Backend) Load(ctx context.Context, progress func(float32)) error {
|
|||
switch C.ggml_backend_dev_type(b.output) {
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_CPU:
|
||||
slog.Info("offloading output layer to CPU")
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_GPU,
|
||||
C.GGML_BACKEND_DEVICE_TYPE_IGPU:
|
||||
slog.Info("offloading output layer to GPU")
|
||||
gpuLayers++
|
||||
case C.GGML_BACKEND_DEVICE_TYPE_ACCEL:
|
||||
|
|
|
|||
Loading…
Reference in New Issue