-
Notifications
You must be signed in to change notification settings - Fork 103
Document all public symbols [skip tests] #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| [deps] | ||
| Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
| GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" | ||
| GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" | ||
| JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" | ||
|
|
||
| [compact] | ||
| Documenter = "1.8" | ||
|
|
||
| [sources] | ||
| GPUArrays = {path = ".."} | ||
| GPUArraysCore = {path = "../lib/GPUArraysCore"} | ||
| JLArrays = {path = "../lib/JLArrays"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # API Reference | ||
|
|
||
| ## GPUArrays | ||
|
|
||
| ### Public | ||
|
|
||
| ```@autodocs | ||
| Modules = [GPUArrays] | ||
| Private = false | ||
| ``` | ||
|
|
||
| ### Internals | ||
|
|
||
| ```@autodocs | ||
| Modules = [GPUArrays] | ||
| Public = false | ||
| ``` | ||
|
|
||
| ## GPUArraysCore | ||
|
|
||
| ### Public | ||
|
|
||
| ```@autodocs | ||
| Modules = [GPUArraysCore] | ||
| Private = false | ||
| ``` | ||
|
|
||
| ### Internals | ||
|
|
||
| ```@autodocs | ||
| Modules = [GPUArraysCore] | ||
| Public = false | ||
| ``` | ||
|
|
||
| ## JLArrays | ||
|
|
||
| ### Public | ||
|
|
||
| ```@autodocs | ||
| Modules = [JLArrays] | ||
| Private = false | ||
| ``` | ||
|
|
||
| ### Internals | ||
|
|
||
| ```@autodocs | ||
| Modules = [JLArrays] | ||
| Public = false | ||
| ``` |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Interface | ||
|
|
||
| To extend the above functionality to a new array type, you should use the types and | ||
| To extend the GPUArrays functionality to a new array type, you should use the types and | ||
| implement the interfaces listed on this page. GPUArrays is designed around having two | ||
| different array types to represent a GPU array: one that exists only on the host, and | ||
| one that actually can be instantiated on the device (i.e. in kernels). | ||
|
|
@@ -31,9 +31,45 @@ 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/main/lib/JLArrays/src/JLArrays.jl), [CuArrays](https://github.com/JuliaGPU/CUDA.jl/blob/main/src/gpuarrays.jl), and [ROCArrays](https://github.com/JuliaGPU/AMDGPU.jl/blob/main/src/gpuarrays.jl). | ||
|
|
||
| ## Caching Allocator | ||
| ## Device abstractions | ||
|
|
||
| ```@docs | ||
| GPUArrays.@cached | ||
| GPUArrays.@uncached | ||
| !!! warning | ||
| Work in progress. | ||
|
Comment on lines
+36
to
+37
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this trying to say that the docs are a work in progress or the device abstractions? |
||
|
|
||
| ## Test suite | ||
|
|
||
| GPUArrays provides an extensive test suite that covers all of the functionality that should | ||
| be available after implementing the required interfaces. This test suite is part of this | ||
| package, but for dependency reasons it is not available when importing the package. Instead, | ||
| you should include the code from your `runtests.jl` as follows: | ||
|
|
||
| ```julia | ||
| import GPUArrays | ||
| gpuarrays = pathof(GPUArrays) | ||
| gpuarrays_root = dirname(dirname(gpuarrays)) | ||
| include(joinpath(gpuarrays_root, "test", "testsuite.jl")) | ||
| ``` | ||
|
|
||
| With this set-up, you can run the test suite like this: | ||
|
|
||
| ```julia | ||
| TestSuite.test(MyGPUArrayType) | ||
| ``` | ||
|
|
||
| If you don't want to run the whole suite, you can also run parts of it: | ||
|
|
||
| ```julia | ||
| T = JLArray | ||
| GPUArrays.allowscalar(false) # fail tests when slow indexing path into Array type is used. | ||
|
|
||
| TestSuite.test_gpuinterface(T) # interface functions like gpu_call, threadidx, etc | ||
| TestSuite.test_base(T) # basic functionality like launching a kernel on the GPU and Base operations | ||
| TestSuite.test_blas(T) # tests the blas interface | ||
| TestSuite.test_broadcasting(T) # tests the broadcasting implementation | ||
| TestSuite.test_construction(T) # tests all kinds of different ways of constructing the array | ||
| TestSuite.test_linalg(T) # linalg function tests | ||
| TestSuite.test_mapreduce(T) # mapreduce sum, etc | ||
| TestSuite.test_indexing(T) # indexing tests | ||
| TestSuite.test_random(T) # randomly constructed arrays | ||
| TestSuite.test_io(T) | ||
|
Comment on lines
+39
to
+74
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that this was just moved over from a different file but have you checked that these still work? |
||
| ``` | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,26 +13,69 @@ export AbstractGPUArray, AbstractGPUVector, AbstractGPUMatrix, AbstractGPUVecOrM | |||||
| AbstractGPUArray{T, N} <: DenseArray{T, N} | ||||||
|
|
||||||
| Supertype for `N`-dimensional GPU arrays (or array-like types) with elements of type `T`. | ||||||
| Instances of this type are expected to live on the host, see [`AbstractDeviceArray`](@ref) | ||||||
| Instances of this type are expected to live on the host, see `AbstractDeviceArray` | ||||||
| for device-side objects. | ||||||
| """ | ||||||
| abstract type AbstractGPUArray{T, N} <: DenseArray{T, N} end | ||||||
|
|
||||||
| """ | ||||||
| AbstractGPUVector{T} | ||||||
|
|
||||||
| Shortcut for `AbstractGPUArray{T, 1}`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit but "alias" seems to be more commonly used in this context
Suggested change
|
||||||
| """ | ||||||
| const AbstractGPUVector{T} = AbstractGPUArray{T, 1} | ||||||
|
|
||||||
| """ | ||||||
| AbstractGPUMatrixT} | ||||||
|
|
||||||
| Shortcut for `AbstractGPUArray{T, 2}`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| const AbstractGPUMatrix{T} = AbstractGPUArray{T, 2} | ||||||
|
|
||||||
| """ | ||||||
| AbstractGPUVecOrMat{T} | ||||||
|
|
||||||
| Shortcut for `Union{AbstractGPUArray{T, 1}, AbstractGPUArray{T, 2}}`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| const AbstractGPUVecOrMat{T} = Union{AbstractGPUArray{T, 1}, AbstractGPUArray{T, 2}} | ||||||
|
|
||||||
| # convenience aliases for working with wrapped arrays | ||||||
|
|
||||||
| """ | ||||||
| WrappedGPUArray{T, N} | ||||||
|
|
||||||
| Convenience alias for working with wrapped arrays from [Adapt.jl](https://github.com/JuliaGPU/Adapt.jl). | ||||||
| """ | ||||||
| const WrappedGPUArray{T,N} = WrappedArray{T,N,AbstractGPUArray,AbstractGPUArray{T,N}} | ||||||
|
|
||||||
| """ | ||||||
| AnyGPUArray{T, N} | ||||||
|
|
||||||
| Shortcut for `Union{AbstractGPUArray{T,N}, WrappedGPUArray{T,N}}`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| const AnyGPUArray{T,N} = Union{AbstractGPUArray{T,N}, WrappedGPUArray{T,N}} | ||||||
|
|
||||||
| """ | ||||||
| AnyGPUVector{T} | ||||||
|
|
||||||
| Shortcut for `AnyGPUArray{T, 1}`. | ||||||
| """ | ||||||
| const AnyGPUVector{T} = AnyGPUArray{T, 1} | ||||||
|
|
||||||
| """ | ||||||
| AnyGPUMatrix{T} | ||||||
|
|
||||||
| Shortcut for `AnyGPUArray{T, 2}`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| const AnyGPUMatrix{T} = AnyGPUArray{T, 2} | ||||||
|
|
||||||
|
|
||||||
| ## broadcasting | ||||||
|
|
||||||
| """ | ||||||
| Abstract supertype for GPU array styles. The `N` parameter is the dimensionality. | ||||||
| AbstractGPUArrayStyle{N} <: Base.Broadcast.AbstractArrayStyle{N} | ||||||
|
|
||||||
| Abstract supertype for GPU array broadcasting styles. The `N` parameter is the dimensionality. | ||||||
|
|
||||||
| Downstream implementations should provide a concrete array style type that inherits from | ||||||
| this supertype. | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it work on 1.12 now?