An open API service indexing awesome lists of open source software.

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

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()
```