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
- Variables
- func AcquireSME() (clusterID int, useSME bool, isEfficiencyCore bool)
- func AcquireSMEWithLimit(_, _ int32) (clusterID int, useSME bool, isEfficiencyCore bool)
- func AcquireSMEWithSpin(_, _ int32, _ int) (clusterID int, useSME bool, isEfficiencyCore bool)
- func ActiveSMEWorkers() int32
- func CurrentSMECluster() (clusterID int, cpuID int, isEfficiencyCore bool)
- func IsFastSMEIdle() bool
- func ReadTPIDR_EL0() uint64
- func ReleaseSME(_ int)
Constants ¶
const MaxSMEUnits = 16
MaxSMEUnits is the maximum number of L2-attached SME coprocessor units supported.
Variables ¶
var ( // IsAVX512Allowed returns false on non-amd64 architectures or when SIMD is disabled. IsAVX512Allowed = false // IsAVX2Allowed returns false on non-amd64 architectures or when SIMD is disabled. IsAVX2Allowed = 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 )
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 ¶
AcquireSME is a no-op stub on non-darwin/arm64 platforms.
func AcquireSMEWithLimit ¶
AcquireSMEWithLimit is a no-op stub on non-darwin/arm64 platforms.
func AcquireSMEWithSpin ¶
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 ¶
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.
Types ¶
This section is empty.