detector

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectAllJSON

func DetectAllJSON() (string, error)

func DetectJSON

func DetectJSON() (string, error)

func SelectAdapterByKey

func SelectAdapterByKey(key string) (*wgpu.Adapter, error)

SelectAdapterByKey re-requests an adapter matching a Report.Key.

Types

type Limits

type Limits struct {
	MaxComputeInvocationsPerWorkgroup uint32 `json:"max_compute_invocations_per_workgroup"`
	MaxComputeWorkgroupSizeX          uint32 `json:"max_compute_workgroup_size_x"`
	MaxComputeWorkgroupSizeY          uint32 `json:"max_compute_workgroup_size_y"`
	MaxComputeWorkgroupSizeZ          uint32 `json:"max_compute_workgroup_size_z"`
	MaxComputeWorkgroupsPerDimension  uint32 `json:"max_compute_workgroups_per_dimension"`
	MaxComputeWorkgroupStorageSize    uint32 `json:"max_compute_workgroup_storage_size"`
	MaxStorageBufferBindingSize       uint64 `json:"max_storage_buffer_binding_size"`
	MaxBufferSize                     uint64 `json:"max_buffer_size"`
}

type Recommendations

type Recommendations struct {
	WorkgroupX  uint32 `json:"workgroup_x"`
	WorkgroupY  uint32 `json:"workgroup_y"`
	WorkgroupZ  uint32 `json:"workgroup_z"`
	TileX       uint32 `json:"tile_x"`
	TileY       uint32 `json:"tile_y"`
	BudgetBytes uint64 `json:"budget_bytes"`
}

type Report

type Report struct {
	Key         string            `json:"key"` // stable selection key: backend/vendor/device/name
	WhenISO     string            `json:"when_iso"`
	Runtime     string            `json:"runtime"` // "native" or "wasm" (best-effort)
	Backend     string            `json:"backend"`
	AdapterType string            `json:"adapter_type"`
	VendorID    string            `json:"vendor_id_hex"`
	DeviceID    string            `json:"device_id_hex"`
	Name        string            `json:"name"`
	Driver      string            `json:"driver"`
	Recommended Recommendations   `json:"recommended"`
	Limits      Limits            `json:"limits"`
	Features    []string          `json:"features"`
	Env         map[string]string `json:"env,omitempty"`
}

func Detect

func Detect() (*Report, error)

Detect returns one adapter report according to LOOM_GPU policy (default: discrete/auto).

func DetectAll

func DetectAll() ([]Report, error)

DetectAll scans HighPerformance, LowPower (and optional fallback) and returns unique adapters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL