Skip to content

Commit c0c9ab7

Browse files
authored
Version the compilecache. (#481)
1 parent 4821e59 commit c0c9ab7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GPUCompiler"
22
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
33
authors = ["Tim Besard <[email protected]>"]
4-
version = "0.21.2"
4+
version = "0.21.3"
55

66
[deps]
77
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"

src/GPUCompiler.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ compile_cache = "" # defined in __init__()
5252
function __init__()
5353
STDERR_HAS_COLOR[] = get(stderr, :color, false)
5454

55-
global compile_cache = @get_scratch!("compiled")
55+
dir = @get_scratch!("compiled")
56+
## add the Julia version
57+
dir = joinpath(dir, "v$(VERSION.major).$(VERSION.minor)")
58+
if VERSION > v"1.9"
59+
## also add the package version
60+
pkgver = Base.pkgversion(GPUCompiler)
61+
dir = joinpath(dir, "v$(pkgver.major).$(pkgver.minor)")
62+
end
63+
mkpath(dir)
64+
global compile_cache = dir
5665
end
5766

5867
end # module

0 commit comments

Comments
 (0)