66# `(MethodInstance, sm_arch, opt_level, num_ctas, occupancy, num_worker_warps, bytecode_version)`.
77
88using CUDACore: CUDACore, CuArray, CuModule, CuFunction, cudacall, device, capability,
9- AbstractBackend, AbstractKernel, kernel_convert, kernel_compile, PerDevice
9+ deviceid, AbstractBackend, AbstractKernel, kernel_convert, kernel_compile
1010using CUDA_Compiler_jll
11+ using GPUToolbox: @memoize
1112using Preferences: @load_preference
1213
1314using Adapt: Adapt, adapt
@@ -176,8 +177,6 @@ function run_and_collect(cmd)
176177 return proc, log
177178end
178179
179- const tile_ir_support = PerDevice {Union{Nothing, VersionNumber}} ()
180-
181180const toolkit_version_cache =
182181 Base. Lockable (Base. RefValue{Union{Nothing, Some{Union{Nothing, String}}}}(nothing ))
183182
@@ -339,7 +338,7 @@ function check_tile_ir_support()
339338 end
340339
341340 dev = device ()
342- ver = get! (tile_ir_support, dev) do
341+ ver = @memoize index = deviceid ( dev)+ 1 begin
343342 ver = bytecode_version ()
344343
345344 cap = capability (dev)
@@ -356,7 +355,7 @@ function check_tile_ir_support()
356355 end
357356
358357 return ver
359- end
358+ end :: Union{Nothing, VersionNumber}
360359
361360 if ver === nothing
362361 error (" CUDA Tile is not supported on the current device" )
0 commit comments