Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pxl-th committed Dec 18, 2024
1 parent 5cd4b70 commit 14345c6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 137 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Manifest.toml
build
site
135 changes: 0 additions & 135 deletions docs/Manifest.toml

This file was deleted.

1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function main()
"Test suite" => "testsuite.md",
],
doctest = true,
warnonly=[:missing_docs],
)

deploydocs(
Expand Down
12 changes: 10 additions & 2 deletions docs/src/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Device functionality is then handled by [KernelAbstractions.jl](https://github.c

You should provide an array type that builds on the `AbstractGPUArray` supertype, such as:

```
```julia
mutable struct CustomArray{T, N} <: AbstractGPUArray{T, N}
data::DataRef{Vector{UInt8}}
offset::Int
Expand All @@ -23,10 +23,18 @@ end
This will allow your defined type (in this case `JLArray`) to use the GPUArrays interface where available.
To be able to actually use the functionality that is defined for `AbstractGPUArray`s, you need to define the backend, like so:

```
```julia
import KernelAbstractions: Backend
struct CustomBackend <: KernelAbstractions.GPU
KernelAbstractions.get_backend(a::CA) where CA <: CustomArray = CustomBackend()
```

There are numerous examples of potential interfaces for GPUArrays, such as with [JLArrays](https://github.com/JuliaGPU/GPUArrays.jl/blob/master/lib/JLArrays/src/JLArrays.jl), [CuArrays](https://github.com/JuliaGPU/CUDA.jl/blob/master/src/gpuarrays.jl), and [ROCArrays](https://github.com/JuliaGPU/AMDGPU.jl/blob/master/src/gpuarrays.jl).

## Caching Allocator

```@docs
GPUArrays.@cache_scope
GPUArrays.@no_cache_scope
GPUArrays.invalidate_cache_allocator!
```

0 comments on commit 14345c6

Please sign in to comment.