From c0c9ab7d2604c44dfb90a99332ba3eadad3679d7 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Thu, 29 Jun 2023 15:11:34 +0200 Subject: [PATCH] Version the compilecache. (#481) --- Project.toml | 2 +- src/GPUCompiler.jl | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 975db911..79109614 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GPUCompiler" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" authors = ["Tim Besard "] -version = "0.21.2" +version = "0.21.3" [deps] ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04" diff --git a/src/GPUCompiler.jl b/src/GPUCompiler.jl index b221928b..02301ade 100644 --- a/src/GPUCompiler.jl +++ b/src/GPUCompiler.jl @@ -52,7 +52,16 @@ compile_cache = "" # defined in __init__() function __init__() STDERR_HAS_COLOR[] = get(stderr, :color, false) - global compile_cache = @get_scratch!("compiled") + dir = @get_scratch!("compiled") + ## add the Julia version + dir = joinpath(dir, "v$(VERSION.major).$(VERSION.minor)") + if VERSION > v"1.9" + ## also add the package version + pkgver = Base.pkgversion(GPUCompiler) + dir = joinpath(dir, "v$(pkgver.major).$(pkgver.minor)") + end + mkpath(dir) + global compile_cache = dir end end # module