Skip to content

Commit

Permalink
doc: add interlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
awadell1 committed Jun 6, 2024
1 parent 3ceeb6e commit 62d8ef7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
Example = "4b09cd0b-9172-4840-a79f-b48550c7f881"
PkgJogger = "10150987-6cc1-4b76-abee-b1c1cbd91c01"
Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"

[compat]
Documenter = "1.4"

[preferences.CUDA_Runtime_jll]
local = true
18 changes: 16 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Pkg.instantiate()

# Load Code
using Documenter
using Documenter.Remotes: GitHub
using DocumenterInterLinks
using PkgJogger
using CUDA
using Example
@jog Example

Expand All @@ -31,10 +34,20 @@ EditURL = "$readme_md"
write(io, read(readme_md, String))
end

# Interproject Links
links = InterLinks(
"Julia" => "https://docs.julialang.org/en/v1/",
"CUDA" => "https://cuda.juliagpu.org/stable/",
)

makedocs(;
modules=[PkgJogger, JogExample],
modules=[
PkgJogger,
JogExample,
Base.get_extension(PkgJogger, :PkgJoggerCUDAExt),
],
authors="Alexius Wadell <awadell@gmail.com> and contributors",
repo="https://github.com/awadell1/PkgJogger.jl/blob/{commit}{path}#{line}",
repo=GitHub("awadell1", "PkgJogger.jl"),
sitename="PkgJogger.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
Expand All @@ -50,6 +63,7 @@ makedocs(;
"Profiling" => "profiling.md",
"Reference" => "reference.md",
],
plugins=[links],
checkdocs=:all,
)

Expand Down
5 changes: 2 additions & 3 deletions docs/src/profiling.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Profiling Benchmarks

PkgJogger has support for profiling existing benchmarks using one of the [Supported Profilers](#supported-profilers),
support for profiling is currently limited. Notably:
PkgJogger has support for profiling existing benchmarks using one of the [Supported Profilers](#supported-profilers).
Profiling support is currently limited; notably:

1. Only a single benchmark can be profiled at a time
2. Automated saving or loading of profile results is not supported

## Supported Profilers


### CPU
```@docs
PkgJogger.profile(::Val{:cpu}, ::Any, ::PkgJogger.BenchmarkTools.Benchmark)
Expand Down
4 changes: 2 additions & 2 deletions ext/PkgJoggerCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ using NVTX
"""
profiler=:cuda
Profiles the benchmark using [`CUDA.@profile`](@ref).
Profiles the benchmark using [`CUDA.@profile`](@extref).
!!! warning
This only activates the CUDA profiler, you need to launch the profiler externally.
See [CUDA Profiling](https://cuda.juliagpu.org/stable/development/profiling/) for documentation.
See [CUDA Profiling](@extref CUDA development/profiling) for documentation.
"""
function PkgJogger.profile(::Val{Symbol(:cuda)}, id, b::PkgJogger.BenchmarkTools.Benchmark; verbose)
Expand Down
7 changes: 4 additions & 3 deletions src/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ end
"""
profiler=:cpu
Profiles the benchmark using [`Profile.@profile`](@ref)
Profiles the benchmark using Julia's built-in profiler: [`Profile.@profile`](@extref)
"""
function profile(::Val{Symbol(:cpu)}, id, b::BenchmarkTools.Benchmark; verbose)
Profile.clear()
Expand All @@ -47,10 +48,10 @@ if isdefined(Profile, :Allocs)
@doc """
profiler=:allocs
Profiles memory allocations using the built-in [`Profile.Allocs.@profile`](@ref)
Profiles memory allocations using the built-in [`Profile.Allocs.@profile`](@extref)
Accepts `sample_rate` as a kwarg to control the rate of recordings. A rate of 1.0 will
record everything; 0.0 will record nothing. See [`Profile.Allocs.@profile`](@ref) for more.
record everything; 0.0 will record nothing. See [`Profile.Allocs.@profile`](@extref) for more.
!!! compat "Julia 1.8"
The allocation profiler was added in Julia 1.8
Expand Down

0 comments on commit 62d8ef7

Please sign in to comment.