Skip to content

JuliaGPU/ROCTX.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROCTX.jl

Julia bindings for ROC-TX

Example (no macros)

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

Releases

No releases published

Packages

No packages published

Languages