https://github.com/juliagpu/roctx.jl
Julia bindings for ROC-TX
https://github.com/juliagpu/roctx.jl
Last synced: 4 months ago
JSON representation
Julia bindings for ROC-TX
- Host: GitHub
- URL: https://github.com/juliagpu/roctx.jl
- Owner: JuliaGPU
- License: mit
- Created: 2023-07-31T14:12:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-23T07:05:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-10T19:49:55.435Z (over 1 year ago)
- Language: Julia
- Size: 22.5 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ROCTX.jl
Julia bindings for [ROC-TX](https://github.com/ROCm-Developer-Tools/roctracer)
## Example (no macros)
```julia
using AMDGPU
using ROCTX
kernel() = nothing
function main()
# Not in a roctx range.
@roc groupsize=1 gridsize=1 kernel()
ret = ROCTX.range_push("NestedRangeA")
# In a simple first level roctx range.
@roc groupsize=1 gridsize=1 kernel()
if ROCTX.range_pop() != ret
error("ROCTX.range_pop() != ret")
end
ROCTX.range_push("NestedRangeB")
ROCTX.range_push("NestedRangeC")
id = ROCTX.range_start("StartStopRangeA")
# In a nested roctx range.
@roc groupsize=1 gridsize=1 kernel()
ROCTX.range_pop()
ROCTX.range_pop()
@sync Threads.@spawn ROCTX.roctxRangeStop(id)
ROCTX.range_push("NestedRangeD")
ROCTX.range_push("NestedRangeE")
ROCTX.range_pop()
# In a first level roctx range, but after a nested range.
@roc groupsize=1 gridsize=1 kernel()
if ROCTX.range_pop() != 0
error("ROCTX.range_pop() != 0")
end
AMDGPU.synchronize()
return nothing
end
main()
```