Document all public symbols [skip tests]#653
Conversation
0c3e037 to
17f44cc
Compare
|
LGTM, but I'll let @kshyatt go over the sparse array bits here. |
|
@kshyatt gentle bump? |
christiangnrd
left a comment
There was a problem hiding this comment.
This is probably a scary looking review, but most of the comments are suggestions to replace "Shortcut" with "Alias" since I find when one change is needed in many places and it's not marked in all the places some instances usually get missed.
If @kshyatt doesn't have time to review the sparse arrays stuff, maybe this PR could be split up so the rest can get merged?
| - uses: julia-actions/setup-julia@v2 | ||
| with: | ||
| version: '1.10' | ||
| version: '1.11' |
There was a problem hiding this comment.
Could it work on 1.12 now?
| version: '1.11' | |
| version: '1.12' |
| !!! warning | ||
| Work in progress. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
I see that this was just moved over from a different file but have you checked that these still work?
| """ | ||
| AbstractGPUVector{T} | ||
|
|
||
| Shortcut for `AbstractGPUArray{T, 1}`. |
There was a problem hiding this comment.
Nit but "alias" seems to be more commonly used in this context
| Shortcut for `AbstractGPUArray{T, 1}`. | |
| Alias for `AbstractGPUArray{T, 1}`. |
| """ | ||
| AbstractGPUMatrixT} | ||
|
|
||
| Shortcut for `AbstractGPUArray{T, 2}`. |
There was a problem hiding this comment.
| Shortcut for `AbstractGPUArray{T, 2}`. | |
| Alias for `AbstractGPUArray{T, 2}`. |
| """ | ||
| StridedJLMatrix{T} | ||
|
|
||
| Shortcut for `StridedJLArray{T,2}`. |
There was a problem hiding this comment.
| Shortcut for `StridedJLArray{T,2}`. | |
| Alias for `StridedJLArray{T,2}`. |
| """ | ||
| AnyJLVector{T} | ||
|
|
||
| Shortcut for `AnyJLArray{T,1}`. |
There was a problem hiding this comment.
| Shortcut for `AnyJLArray{T,1}`. | |
| Alias for `AnyJLArray{T,1}`. |
| """ | ||
| AnyJLMatrix{T} | ||
|
|
||
| Shortcut for `AnyJLArray{T,2}`. |
There was a problem hiding this comment.
| Shortcut for `AnyJLArray{T,2}`. | |
| Alias for `AnyJLArray{T,2}`. |
| """ | ||
| AnyJLVecOrMat{T} | ||
|
|
||
| Shortcut for `Union{AnyJLVector{T}, AnyJLMatrix{T}}`. |
There was a problem hiding this comment.
| Shortcut for `Union{AnyJLVector{T}, AnyJLMatrix{T}}`. | |
| Alias for `Union{AnyJLVector{T}, AnyJLMatrix{T}}`. |
|
|
||
| A helper class to manage the storage of an array. | ||
|
|
||
| There's multiple reasons we don't just put the data directly in a `GPUArray` struct: |
There was a problem hiding this comment.
| There's multiple reasons we don't just put the data directly in a `GPUArray` struct: | |
| There are multiple reasons we don't just put the data directly in a `GPUArray` struct: |
17f44cc to
3c8dc10
Compare
Supersedes #647
The main question remains: how much do we want to document?