Documentation
¶
Overview ¶
Package envutil provides utility functions for working with environment variables.
Index ¶
Constants ¶
const ( GoBackendSIMD_AVX512 = "GOMLX_GO_SIMD_AVX512" GoBackendSIMD_AVX2 = "GOMLX_GO_SIMD_AVX2" GoBackendFusion = "GOMLX_GO_FUSION" GoBackendDotMatmul = "GOMLX_GO_DOT_MATMUL" GoBackendAVX512_ASM = "GOMLX_GO_AVX512_ASM" GoBackendAVX512_KC = "GOMLX_GO_AVX512_KC" GoBackendAVX512_MC = "GOMLX_GO_AVX512_MC" GoBackendAVX512_NC = "GOMLX_GO_AVX512_NC" GoBackendAVX2_ASM = "GOMLX_GO_AVX2_ASM" GoBackendAVX2_KC = "GOMLX_GO_AVX2_KC" GoBackendAVX2_MC = "GOMLX_GO_AVX2_MC" GoBackendAVX2_NC = "GOMLX_GO_AVX2_NC" GoBackendNoSIMD_KC = "GOMLX_GO_NOSIMD_KC" GoBackendNoSIMD_MC = "GOMLX_GO_NOSIMD_MC" GoBackendNoSIMD_NC = "GOMLX_GO_NOSIMD_NC" )
Environment variables used by the Go backend: mostly SIMD instructions and optimizations. By default it uses whatever the CPU supports, but this allows one to disable them in case of issues. Note that GOMLX_GO_SIMD_AVX512 and GOMLX_GO_SIMD_AVX2 only control AVX512/AVX2-specific implementations (e.g. specialized matmul and activations), while generic portable SIMD code will still use available vector instructions.
Variables ¶
var ( FalseValues = sets.MakeWith("0", "false", "f", "no", "off", "disabled") TrueValues = sets.MakeWith("1", "true", "t", "yes", "on", "enabled") )
Functions ¶
func MustReadBool ¶
MustReadBool reads the boolean value of the environment variable with the given name. If not set, it returns the defaultValue.
It panics with an informative error if the value is set but it is not able to parse a valid boolean value.
func MustReadInt ¶ added in v0.1.8
MustReadInt reads the integer value of the environment variable with the given name. If not set, it returns the defaultValue.
It panics with an informative error if the value is set but it is not able to parse a valid integer value.
Types ¶
This section is empty.