22
33precompile_test_harness (" Inference caching" ) do load_path
44 # Write out the Native test setup as a micro package
5- create_standalone (load_path, " TestCompiler " , " native.jl" )
5+ create_standalone (load_path, " NativeCompiler " , " native.jl" )
66
7- write (joinpath (load_path, " InferenceCaching.jl" ), :(module InferenceCaching
8- import TestCompiler
7+ write (joinpath (load_path, " NativeBackend.jl" ), :(
8+ module NativeBackend
9+ import NativeCompiler
910 using PrecompileTools
1011
1112 function kernel (A, x)
@@ -14,36 +15,36 @@ precompile_test_harness("Inference caching") do load_path
1415 end
1516
1617 let
17- job, _ = TestCompiler . Native. create_job (kernel, (Vector{Int}, Int))
18+ job, _ = NativeCompiler . Native. create_job (kernel, (Vector{Int}, Int))
1819 precompile (job)
1920 end
2021
2122 # identity is foreign
2223 @setup_workload begin
23- job, _ = TestCompiler . Native. create_job (identity, (Int,))
24+ job, _ = NativeCompiler . Native. create_job (identity, (Int,))
2425 @compile_workload begin
2526 precompile (job)
2627 end
2728 end
2829 end ) |> string)
2930
30- Base. compilecache (Base. PkgId (" InferenceCaching " ))
31+ Base. compilecache (Base. PkgId (" NativeBackend " ))
3132 @eval let
32- import TestCompiler
33+ import NativeCompiler
3334
3435 # Check that no cached entry is present
3536 identity_mi = GPUCompiler. methodinstance (typeof (identity), Tuple{Int})
3637
3738 token = let
38- job, _ = TestCompiler . Native. create_job (identity, (Int,))
39+ job, _ = NativeCompiler . Native. create_job (identity, (Int,))
3940 GPUCompiler. ci_cache_token (job)
4041 end
4142 @test ! check_presence (identity_mi, token)
4243
43- using InferenceCaching
44+ using NativeBackend
4445
4546 # Check that kernel survived
46- kernel_mi = GPUCompiler. methodinstance (typeof (InferenceCaching . kernel), Tuple{Vector{Int}, Int})
47+ kernel_mi = GPUCompiler. methodinstance (typeof (NativeBackend . kernel), Tuple{Vector{Int}, Int})
4748 @test check_presence (kernel_mi, token)
4849
4950 # check that identity survived
@@ -55,15 +56,15 @@ precompile_test_harness("Inference caching") do load_path
5556 GPUCompiler. enable_disk_cache! ()
5657 @test GPUCompiler. disk_cache_enabled () == true
5758
58- job, _ = TestCompiler . Native. create_job (InferenceCaching . kernel, (Vector{Int}, Int))
59+ job, _ = NativeCompiler . Native. create_job (NativeBackend . kernel, (Vector{Int}, Int))
5960 @assert job. source == kernel_mi
6061 ci = GPUCompiler. ci_cache_lookup (GPUCompiler. ci_cache (job), job. source, job. world, job. world)
6162 @assert ci != = nothing
6263 @assert ci. inferred != = nothing
6364 path = GPUCompiler. cache_file (ci, job. config)
6465 @test path != = nothing
6566 @test ! ispath (path)
66- TestCompiler . Native. cached_execution (InferenceCaching . kernel, (Vector{Int}, Int))
67+ NativeCompiler . Native. cached_execution (NativeBackend . kernel, (Vector{Int}, Int))
6768 @test ispath (path)
6869 GPUCompiler. clear_disk_cache! ()
6970 @test ! ispath (path)
0 commit comments