Skip to content

Commit 03d4ab7

Browse files
Update quickstart.md to include MetalBackend (docs) (#648)
--------- Co-authored-by: Christian Guinard <28689358+christiangnrd@users.noreply.github.com>
1 parent a5d0ce5 commit 03d4ab7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/src/quickstart.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The [`synchronize`](@ref) blocks the *host* until the kernel has completed on th
4545

4646
## Launching kernel on the backend
4747

48-
To launch the kernel on a backend-supported backend `isa(backend, KA.GPU)` (e.g., `CUDABackend()`, `ROCBackend()`, `oneAPIBackend()`), we generate the kernel
48+
To launch the kernel on a backend-supported backend `isa(backend, KA.GPU)` (e.g., `CUDABackend()`, `ROCBackend()`, `oneAPIBackend()`, `MetalBackend()`), we generate the kernel
4949
for this backend.
5050

5151
First, we initialize the array using the Array constructor of the chosen backend with
@@ -64,12 +64,17 @@ A = ROCArray(ones(1024, 1024))
6464
using oneAPI: oneArray
6565
A = oneArray(ones(1024, 1024))
6666
```
67+
68+
```julia
69+
using Metal: MtlArray
70+
A = MtlArray(ones(Float32, 1024, 1024))
71+
```
6772
The kernel generation and execution are then
6873
```julia
6974
backend = get_backend(A)
7075
mul2_kernel(backend, 64)(A, ndrange=size(A))
7176
synchronize(backend)
72-
all(A .== 2.0)
77+
all(A .== 2)
7378
```
7479

7580
## Synchronization

0 commit comments

Comments
 (0)