WGPUCompute
Documentation for WGPUCompute.
WGPUCompute.cast
WGPUCompute.cast_kernel
WGPUCompute.clamp
WGPUCompute.matmul
WGPUCompute.matmul_heuristics
WGPUCompute.naive_matmul_kernel
WGPUCompute.tiled_matmul
WGPUCompute.tiled_matmul_heuristics
WGPUCompute.tiled_matmul_kernel
WGPUCompute.cast
— Methodcast(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.
WGPUCompute.cast_kernel
— Methodcast_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.
WGPUCompute.clamp
— Methodclamp(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
WGPUCompute.matmul
— Methodmatmul(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.
WGPUCompute.matmul_heuristics
— Methodmatmul_heuristics(x, y)
This function computes workgroup size and workgroup count heuristics for a given input. This is used by naive_matmul_kernel
.
WGPUCompute.naive_matmul_kernel
— Methodnaive_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.
WGPUCompute.tiled_matmul
— Methodtiled_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.
WGPUCompute.tiled_matmul_heuristics
— Methodtiled_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.
WGPUCompute.tiled_matmul_kernel
— Methodtiled_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.