Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess committed Oct 1, 2024
1 parent a57b004 commit d817415
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/src/concepts/architectures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Backend Selection & Architecture Initialization

Chmy.jl supports CPUs, as well as CUDA and ROC backends for Nvidia and AMD GPUs through a thin wrapper around the [`KernelAbstractions.jl`](https://github.com/JuliaGPU/KernelAbstractions.jl) for users to select desirable backends.
Chmy.jl supports CPUs, as well as CUDA, ROC and Metal backends for Nvidia, AMD and Apple M-serie GPUs through a thin wrapper around the [`KernelAbstractions.jl`](https://github.com/JuliaGPU/KernelAbstractions.jl) for users to select desirable backends.

Check warning on line 5 in docs/src/concepts/architectures.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"serie" should be "series".

```julia
# Default with CPU
Expand All @@ -21,6 +21,12 @@ using AMDGPU
arch = Arch(ROCBackend())
```

```julia
using Metal

arch = Arch(MetalBackend())
```

At the beginning of program, one may specify the backend and initialize the architecture they desire to use. The initialized `arch` variable will be required explicitly at creation of some objects such as grids and kernel launchers.

## Specifying the device ID and stream priority
Expand Down
3 changes: 3 additions & 0 deletions docs/src/concepts/grids.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ grid = UniformGrid(arch;
dims=(nx, ny, nz))
```

!!! warning "Metal backend"
If using the Metal backend, ensure to initialise the grid using `Float32` (`f0`) values in the `origin` and `extent` tuples.

!!! info "Interactive Grid Visualization"
- [grids_2d.jl](https://github.com/PTsolvers/Chmy.jl/blob/main/examples/grids_2d.jl): Visualization of a 2D `StructuredGrid`
- [grids_3d.jl](https://github.com/PTsolvers/Chmy.jl/blob/main/examples/grids_3d.jl): Visualization of a 3D `StructuredGrid`
Expand Down
6 changes: 5 additions & 1 deletion docs/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ using KernelAbstractions # for backend-agnostic kernels
using Printf, CairoMakie # for I/O and plotting
# using CUDA
# using AMDGPU
# using Metal
```

In this introductory tutorial, we will use the CPU backend for simplicity:
Expand All @@ -56,7 +57,10 @@ backend = CPU()
arch = Arch(backend)
```

If a different backend is desired, one needs to load the relevant package accordingly. For example, if Nvidia or AMD GPUs are available, one can comment out `using CUDA` or `using AMDGPU` and make sure to use `arch = Arch(CUDABackend())` or `arch = Arch(ROCBackend())`, respectively, when selecting the architecture. For further information about executing on a single-device or multi-device architecture, see the documentation section for [Architectures](./concepts/architectures.md)
If a different backend is desired, one needs to load the relevant package accordingly. For example, if Nvidia or AMD GPUs are available, one can comment out `using CUDA`, `using AMDGPU` or `using Metal` and make sure to use `arch = Arch(CUDABackend())`, `arch = Arch(ROCBackend())` or `arch = Arch(MetalBackend())`, respectively, when selecting the architecture. For further information about executing on a single-device or multi-device architecture, see the documentation section for [Architectures](./concepts/architectures.md)

!!! warning "Metal backend"
Metal backend restricts floating point arithmetic precision of computations to `Float32` or lower. In Chmy, this can be achieved by initialising the grid object using `Float32` (`f0`) elements in the `origin` and `extent` tuples.

## Writing & Launch Compute Kernels

Expand Down
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Chmy.jl provides a comprehensive framework for handling complex computational ta

A general list of the features is:

- Backend-agnostic implementation relying on [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl)
- Distributed computing support with [MPI.jl](https://github.com/JuliaParallel/MPI.jl)
- Multi-dimensional, parameterizable discrete and continuous fields on structured grids
- High-level interface for specifying boundary conditions with automatic batching for performance
Expand Down

0 comments on commit d817415

Please sign in to comment.