# \donttest{
if (ggml_vulkan_available() && ggml_vulkan_device_count() >= 2) {
W <- matrix(rnorm(8 * 4), nrow = 8) # 8 output features x 4 inputs
X <- matrix(rnorm(3 * 4), nrow = 3) # 3 samples x 4 inputs
Y <- ggml_vulkan_split_mul_mat(W, X, n_devices = 2)
max(abs(Y - X %*% t(W))) # ~1e-3 (GPU f16 accumulation)
}
# }
Run the code above in your browser using DataLab