Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/GPUCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ compile_cache = "" # defined in __init__()

function __init__()
STDERR_HAS_COLOR[] = get(stderr, :color, false)
create_compile_cache()
end

function create_compile_cache()
dir = @get_scratch!("compiled")
## add the Julia version
dir = joinpath(dir, "v$(VERSION.major).$(VERSION.minor)")
Expand All @@ -64,4 +67,18 @@ function __init__()
global compile_cache = dir
end

# remove the existing cache
# NOTE: call this function from global scope, so any change triggers recompilation.
function reset_compile_cache()
dir = @get_scratch!("compiled")
lock(runtime_lock) do
rm(dir; force=true, recursive=true)
create_compile_cache()
end

return
end
# backwards compatibility
const reset_runtime = reset_compile_cache

end # module
10 changes: 0 additions & 10 deletions src/rtlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,3 @@ const runtime_lock = ReentrantLock()
return lib
end
end

# remove the existing cache
# NOTE: call this function from global scope, so any change triggers recompilation.
function reset_runtime()
lock(runtime_lock) do
rm(compile_cache; recursive=true, force=true)
end

return
end