simdarch

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package simdarch provides CPU SIMD architecture detection, feature flags, assembly toggle switches, and hardware SME cluster topology and locking for the Go backend.

Index

Constants

View Source
const MaxSMEUnits = 16

MaxSMEUnits is the maximum number of L2-attached SME coprocessor units supported.

Variables

View Source
var (
	// IsAVX512Allowed returns false on non-amd64 architectures or when SIMD is disabled.
	IsAVX512Allowed = false

	// IsAVX512VNNIAllowed returns false on non-amd64 architectures or when SIMD is disabled.
	IsAVX512VNNIAllowed = false

	// IsAVX512BF16Allowed returns false on non-amd64 architectures or when SIMD is disabled.
	IsAVX512BF16Allowed = false

	// IsAVX2Allowed returns false on non-amd64 architectures or when SIMD is disabled.
	IsAVX2Allowed = false

	// IsAVXVNNIAllowed returns false on non-amd64 architectures or when SIMD is disabled.
	IsAVXVNNIAllowed = false

	// ARM64 SIMD flags return false on non-arm64 architectures or when SIMD is disabled.
	IsNEONAllowed         = false
	IsARM64FP16Allowed    = false
	IsARM64BF16Allowed    = false
	IsARM64DotProdAllowed = false
	IsARM64I8MMAllowed    = false
	IsSVEAllowed          = false
	IsSMEAllowed          = false
)
View Source
var (
	// ActiveArchitectures lists the active OS/architecture and enabled SIMD architectures.
	ActiveArchitectures = []string{runtime.GOOS + "/" + runtime.GOARCH}

	// AVX2UseAsm enables handwritten Plan9 AMD64 assembly kernels for AVX2.
	// Set GOMLX_GO_AVX2_ASM=false to disable and use pure-Go archsimd kernels.
	AVX2UseAsm = envutil.MustReadBool(envutil.GoBackendAVX2_ASM, true)

	// AVX512UseAsm enables handwritten Plan9 AMD64 assembly kernels for AVX-512.
	// Set GOMLX_GO_AVX512_ASM=false to disable and use pure-Go archsimd kernels.
	AVX512UseAsm = envutil.MustReadBool(envutil.GoBackendAVX512_ASM, true)

	// NEONUseAsm enables handwritten Plan9 ARM64 assembly kernels for NEON and SME.
	// Set GOMLX_GO_NEON_ASM=false to disable and use pure-Go archsimd kernels.
	NEONUseAsm = envutil.MustReadBool(envutil.GoBackendNEON_ASM, true)

	// SMEUseHybridNEON enables global per-L2-cluster SME locking with per-core NEON co-execution
	// on workers whose cluster SME unit is already occupied.
	SMEUseHybridNEON = true

	// SMEWorkersPerCluster is the default maximum number of concurrent SME workers per L2 cluster.
	SMEWorkersPerCluster int32 = 1

	// NumSMEUnits is the total number of physical L2-attached SME coprocessor units detected on the host.
	NumSMEUnits int

	// NumHighPerfSMEUnits is the number of high-performance (Super / Performance) L2-attached SME units.
	NumHighPerfSMEUnits int

	// NumEfficiencySMEUnits is the number of efficiency (E-core) L2-attached SME units.
	NumEfficiencySMEUnits int
)

Functions

func AcquireSME

func AcquireSME() (clusterID int, useSME bool, isEfficiencyCore bool)

AcquireSME is a no-op stub on non-darwin/arm64 platforms.

func AcquireSMEWithLimit

func AcquireSMEWithLimit(_, _ int32) (clusterID int, useSME bool, isEfficiencyCore bool)

AcquireSMEWithLimit is a no-op stub on non-darwin/arm64 platforms.

func AcquireSMEWithSpin

func AcquireSMEWithSpin(_, _ int32, _ int) (clusterID int, useSME bool, isEfficiencyCore bool)

AcquireSMEWithSpin is a no-op stub on non-darwin/arm64 platforms.

func ActiveSMEWorkers

func ActiveSMEWorkers() int32

ActiveSMEWorkers returns 0 on non-darwin/arm64 platforms.

func CurrentSMECluster

func CurrentSMECluster() (clusterID int, cpuID int, isEfficiencyCore bool)

CurrentSMECluster returns (0, 0, false) on non-darwin/arm64 platforms.

func IsFastSMEIdle

func IsFastSMEIdle() bool

IsFastSMEIdle returns false on non-darwin/arm64 platforms.

func ReadTPIDR_EL0

func ReadTPIDR_EL0() uint64

ReadTPIDR_EL0 returns 0 on non-darwin/arm64 platforms.

func ReleaseSME

func ReleaseSME(_ int)

ReleaseSME is a no-op stub on non-darwin/arm64 platforms.

Types

This section is empty.

Jump to

Keyboard shortcuts

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