WGPUCompute

Documentation for WGPUCompute.

WGPUCompute.castMethod
cast(S::DataType, x::WgpuArray{T, N}) where {T, N}

This is a wrapper function for cast_kernel kernel function. This is meant for users to cast from regular julia functions.

source
WGPUCompute.cast_kernelMethod
cast_kernel(x::WgpuArray{T, N}, out::WgpuArray{S, N}) where {T, S, N}

This is a compute kernel which casts the x array of eltype T to eltype S. Users are not supposed to use this function call from julia. This instead needs to be wrapped with an additional function which uses @wgpukernel macro call to convert the julia function definition to a equivalent WGPU kernel function.

source
WGPUCompute.clampMethod
clamp(x::WgpuArray{T, N}, minValue::T, maxValue::T) where {T, N}

This is a clamp operator which takes WgpuArray as an input along with lower bound and upper bound clamp values to clamp the input array to these bounds

source
WGPUCompute.matmulMethod
matmul(x::WgpuArray{T, N}, y::WgpuArray{T, N}) where {T, N}

This is wrapper function for end users which uses naive implementation of matrix multiplication naive_matmul_kernel kernel for matrix computation.

source
WGPUCompute.matmul_heuristicsMethod
matmul_heuristics(x, y)

This function computes workgroup size and workgroup count heuristics for a given input. This is used by naive_matmul_kernel.

source
WGPUCompute.naive_matmul_kernelMethod
naive_matmul_kernel(x::WgpuArray{T, N}, y::WgpuArray{T, N}, out::WgpuArray{T, N}) where {T, N}

This is naive matrix multiplication implementation kernel. This is not supposed to be used as a regular julia function. This needs to be passed to @wgpukernel to under transformations to WGSL compatible shader code.

source
WGPUCompute.tiled_matmulMethod
tiled_matmul(x::WgpuArray{T, N}, y::WgpuArray{T, N}) where {T, N}

This is user end matrix multiplication function which carries out tiled matrix multiplication of input WgpuArray arguments.

source
WGPUCompute.tiled_matmul_heuristicsMethod
tiled_matmul_heuristics(x::WgpuArray{T, N}, y::WgpuArray{T, N}) where {T, N}

This function computes workgroup size and workgroup count for a given input for tiled_matmul_heuristics kernel function.

source
WGPUCompute.tiled_matmul_kernelMethod
tiled_matmul_kernel(x::WgpuArray{T, N}, y::WgpuArray{T, N}, out::WgpuArray{T, N}) where {T, N}

This is compute kernel which carries out tiled matrix multiplication of input WgpuArrays. This is not supposed to be used as a regular julia function. This instead needs to be passed to @wgpukernel macro inside a wrapper function.

source