Skip to content

Commit b396174

Browse files
committed
Simple documentation
1 parent 42a896e commit b396174

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414

1515
[codecov-img]: https://codecov.io/gh/JuliaGPU/GPUToolbox.jl/branch/master/graph/badge.svg
1616
[codecov-url]: https://codecov.io/gh/JuliaGPU/GPUToolbox.jl
17+
18+
## Functionality
19+
20+
This package currently exports the following:
21+
- `SimpleVersion`: a GPU-compatible version number
22+
- `@sv_str`: constructs a SimpleVersion from a string
23+
- `@checked`: Add to a function definition to generate an unchecked and a checked version.
24+
- `@debug_ccall`: like `ccall` but prints the ccall, its arguments, and its return value
25+
- `@gcsafe_ccall`: like `@ccall` but marking it safe for the GC to run.
26+
27+
For more details, check out the docstrings using the Julia REPL.

src/ccalls.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ macro checked(ex)
4545
end
4646

4747
## version of ccall that prints the ccall, its arguments and its return value
48+
"""
49+
@debug_ccall ...
4850
51+
A version of `ccall`` that prints the ccall, its arguments, and its return value.
52+
"""
4953
macro debug_ccall(ex)
5054
@assert Meta.isexpr(ex, :(::))
5155
call, ret = ex.args

src/simpleversion.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
## a GPU-compatible version number
2-
31
export SimpleVersion, @sv_str
42

3+
"""
4+
SimpleVersion(major, [minor])
5+
SimpleVersion(v::AbstractString)
6+
7+
A GPU-compatible version number.
8+
"""
59
struct SimpleVersion
610
major::UInt32
711
minor::UInt32
@@ -37,6 +41,11 @@ SimpleVersion(v::AbstractString) = parse(SimpleVersion, v)
3741
return false
3842
end
3943

44+
"""
45+
sv"str"
46+
47+
Construct a `SimpleVersion` from `str`.
48+
"""
4049
macro sv_str(str)
4150
return SimpleVersion(str)
4251
end

0 commit comments

Comments
 (0)