mirror of
https://github.com/luxgpu/gpu.git
synced 2026-10-30 20:46:40 +00:00
Provides Go bindings for GPU-accelerated array operations: - Metal backend for Apple Silicon (M1/M2/M3/M4) - CUDA backend for NVIDIA GPUs - CPU fallback with SIMD optimizations - ONNX Runtime fallback for Windows C++ backend: github.com/luxcpp/gpu (Apple MLX fork)
22 lines
441 B
Go
22 lines
441 B
Go
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/luxfi/gpu"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("=== GPU Memory Detection Test ===")
|
|
|
|
backend := gpu.GetBackend()
|
|
device := gpu.GetDevice()
|
|
|
|
fmt.Printf("Backend: %s\n", backend)
|
|
fmt.Printf("Device: %s\n", device.Name)
|
|
fmt.Printf("Memory: %.1f GB\n", float64(device.Memory)/(1024*1024*1024))
|
|
|
|
// Show info
|
|
fmt.Printf("\nFull Info: %s\n", gpu.Info())
|
|
} |