Welvet examples
8. tiling — SC/MC & workgroups
Part: II · Foundation
Package: github.com/openfluke/welvet/tiling
Status: ok — ✅
When
You need the tiling foundation package.
Where
import "github.com/openfluke/welvet/tiling"
cd 08-tiling && source ../env.sh && go run .
Why
MatVec throughput depends on tile size and when to go multi-core vs GPU workgroups. Centralizing caps keeps Dense and friends consistent.
What
DefaultCPUTile, DefaultGPUWG, CPUTile, PreferMultiCore, GPUWorkgroupsX.
Sample output (captured)
32 true 16
Live capture from go run ./cmd/runall on local ../../welvet (exit 0).
Source
Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/08-tiling).
main.go
Download source ↓package main
import (
"fmt"
"github.com/openfluke/welvet/tiling"
)
func main() {
tile := tiling.CPUTile(0) // default 32
mc := tiling.PreferMultiCore(8, 256, tile)
wg := tiling.GPUWorkgroupsX(1024, 0)
fmt.Println(tile, mc, wg)
}