From c50c2099d81ce9241a76609a6f846faf740e5186 Mon Sep 17 00:00:00 2001 From: Vitor Cantarella <39842600+vcantarella@users.noreply.github.com> Date: Fri, 24 Oct 2025 11:24:23 +0200 Subject: [PATCH 1/3] Update quickstart.md to include MetalBackend Added syntax for using the Metal backend in kernel launching section. --- docs/src/quickstart.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/src/quickstart.md b/docs/src/quickstart.md index e5e5fdb74..0d0e6de38 100644 --- a/docs/src/quickstart.md +++ b/docs/src/quickstart.md @@ -45,7 +45,7 @@ The [`synchronize`](@ref) blocks the *host* until the kernel has completed on th ## Launching kernel on the backend -To launch the kernel on a backend-supported backend `isa(backend, KA.GPU)` (e.g., `CUDABackend()`, `ROCBackend()`, `oneAPIBackend()`), we generate the kernel +To launch the kernel on a backend-supported backend `isa(backend, KA.GPU)` (e.g., `CUDABackend()`, `ROCBackend()`, `oneAPIBackend()`, `MetalBackend()`), we generate the kernel for this backend. First, we initialize the array using the Array constructor of the chosen backend with @@ -64,12 +64,17 @@ A = ROCArray(ones(1024, 1024)) using oneAPI: oneArray A = oneArray(ones(1024, 1024)) ``` + +```julia +using Metal: MtlArray +A = MtlArray(Float32.(ones(1024, 1024))) +``` The kernel generation and execution are then ```julia backend = get_backend(A) mul2_kernel(backend, 64)(A, ndrange=size(A)) synchronize(backend) -all(A .== 2.0) +all(A .== 2.0) # For Metal use: all(A .== 2.0f0) : only float32 are supported ``` ## Synchronization From f09b2cf45c96525e5962549c0bb0ab18a82d4095 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Fri, 2 Jan 2026 13:09:27 -0400 Subject: [PATCH 2/3] Update docs/src/quickstart.md --- docs/src/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/quickstart.md b/docs/src/quickstart.md index 0d0e6de38..17f81982d 100644 --- a/docs/src/quickstart.md +++ b/docs/src/quickstart.md @@ -67,7 +67,7 @@ A = oneArray(ones(1024, 1024)) ```julia using Metal: MtlArray -A = MtlArray(Float32.(ones(1024, 1024))) +A = MtlArray(ones(Float32, 1024, 1024)) ``` The kernel generation and execution are then ```julia From 0d64a8f8ee5e76b2b4601eb70444132a6db351f2 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Fri, 2 Jan 2026 13:09:34 -0400 Subject: [PATCH 3/3] Update docs/src/quickstart.md --- docs/src/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/quickstart.md b/docs/src/quickstart.md index 17f81982d..82bc0f600 100644 --- a/docs/src/quickstart.md +++ b/docs/src/quickstart.md @@ -74,7 +74,7 @@ The kernel generation and execution are then backend = get_backend(A) mul2_kernel(backend, 64)(A, ndrange=size(A)) synchronize(backend) -all(A .== 2.0) # For Metal use: all(A .== 2.0f0) : only float32 are supported +all(A .== 2) ``` ## Synchronization