Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for external GPUCompiler uses to opt-out of disk cache #592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
11 changes: 6 additions & 5 deletions src/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,9 @@ end
ondisk_hit = false
@static if VERSION >= v"1.11.0-"
# Don't try to hit the disk cache if we are for a *compile* hook
# TODO:
# - Sould we hit disk cache if Base.generating_output()
# - Should we allow backend to opt out?
if ci !== nothing && obj === nothing && disk_cache_enabled()
if ci !== nothing && obj === nothing &&
disk_cache_enabled() && supports_disk_cache(cfg.params)

path = cache_file(ci, cfg)
@debug "Looking for on-disk cache" job path
if path !== nothing && isfile(path)
Expand Down Expand Up @@ -242,7 +241,9 @@ end
end

@static if VERSION >= v"1.11.0-"
if !ondisk_hit && path !== nothing && disk_cache_enabled()
if !ondisk_hit && path !== nothing &&
disk_cache_enabled() && supports_disk_cache(cfg.params)

@debug "Writing out on-disk cache" job path
tmppath, io = mktemp(;cleanup=false)
entry = DiskCacheEntry(src.specTypes, cfg, asm)
Expand Down
2 changes: 2 additions & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export AbstractCompilerParams

abstract type AbstractCompilerParams end

# whether the external user supports the disk cache
supports_disk_cache(@nospecialize(::AbstractCompilerParams)) = true

## config

Expand Down