Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ makedocs(
"Storage requirements" => "storage.md",
"Preconditioners" => "preconditioners.md",
"GPU support" => "gpu.md",
"Multi-GPU support" => "multi-gpu.md",
"Warm-start" => "warm-start.md",
"Matrix-free operators" => "matrix_free.md",
"Callbacks" => "callbacks.md",
Expand Down
25 changes: 25 additions & 0 deletions docs/src/multi-gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# [Multi-GPU support](@id multi-gpu)

Krylov.jl has an experimental support for executing on multi-GPU systems through the [BLAS package of XK.jl](https://github.com/anlsys/xk.jl).
Multi-GPU interfaces are analogous to single-GPU's --- relying on Julia's types dispatcher on `XKVector` and `XKMatrix` to target multi-GPUs.
XK.jl handles work distribution and communications automatically and lazily.

```julia
using Krylov, XK

# CPU Arrays
A_cpu, y_cpu = symmetric_definite(n)

# XK.jl Arrays
A_xk = XKMatrix(A_cpu)
y_xk = XKVector(y_cpu)

# Run a conjugate gradient
(x_cpu, stats) = cg(A_xk, b_xk)

# At this point of the execution, 'x' may be distributed across multiple memories.
# The next line triggers and wait for copies (e.g., D2H transfers) required so `x_cpu` holds a coherent replica on the host memory.
XK.memory_coherent_sync(x_cpu)
```

See [XK.jl repository](https://github.com/anlsys/XK.jl/tree/main/examples/Krylov) for examples.
Loading