"cmd/dtk-ctk/dcu-tracker/dcu-tracker.go" did not exist on "6b8eb612db93d17a694c233e09feee7c773842e2"
gpu_oneapi.go 513 Bytes
Newer Older
wangkx1's avatar
init  
wangkx1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//go:build linux || windows

package gpu

import (
	"log/slog"
	"strings"
)

func oneapiGetVisibleDevicesEnv(gpuInfo []GpuInfo) (string, string) {
	ids := []string{}
	for _, info := range gpuInfo {
		if info.Library != "oneapi" {
			// TODO shouldn't happen if things are wired correctly...
			slog.Debug("oneapiGetVisibleDevicesEnv skipping over non-sycl device", "library", info.Library)
			continue
		}
		ids = append(ids, info.ID)
	}
	return "ONEAPI_DEVICE_SELECTOR", "level_zero:" + strings.Join(ids, ",")
}