← OpenFluke

Chapter 8

tiling — SC/MC & workgroups

github.com/openfluke/welvet/tiling


Why it exists

MatVec throughput depends on tile size and when to go multi-core vs GPU workgroups. Centralizing caps keeps Dense and friends consistent.

What it is

DefaultCPUTile, DefaultGPUWG, CPUTile, PreferMultiCore, GPUWorkgroupsX.

Go example

examples/08-tiling/main.go

Run:cd welvet/examples/08-tiling && source ../env.sh && go run .
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)
}

Output

exit 0 · last run via go run .

32 true 16