mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-09 10:30:25 +08:00
feat: add all other needs
This commit is contained in:
24
examples/quick_start/main.go
Normal file
24
examples/quick_start/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fumiama/gozel/ze"
|
||||
)
|
||||
|
||||
func main() {
|
||||
gpus, err := ze.InitGPUDrivers()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Found %d GPU driver(s)\n", len(gpus))
|
||||
|
||||
devs, _ := gpus[0].DeviceGet()
|
||||
for _, d := range devs {
|
||||
prop, _ := d.DeviceGetProperties()
|
||||
fmt.Printf(" Device: %s\n", string(prop.Name[:]))
|
||||
}
|
||||
|
||||
// Found 1 GPU driver(s)
|
||||
// Device: Graphics
|
||||
}
|
||||
Reference in New Issue
Block a user