@@ -5,31 +5,35 @@ using GPUCompiler
55
66# create a native test compiler, and generate reflection methods for it
77
8- include (" runtime.jl" )
8+ # include("runtime.jl")
99
1010# local method table for device functions
1111Base. Experimental. @MethodTable (test_method_table)
1212
1313struct CompilerParams <: AbstractCompilerParams
1414 entry_safepoint:: Bool
15+ use_jlplt:: Bool
1516 method_table
1617
17- CompilerParams (entry_safepoint:: Bool = false , method_table= test_method_table) =
18- new (entry_safepoint, method_table)
18+ CompilerParams (entry_safepoint:: Bool = false , use_jlplt :: Bool = true , method_table= test_method_table) =
19+ new (entry_safepoint, use_jlplt, method_table)
1920end
2021
2122NativeCompilerJob = CompilerJob{NativeCompilerTarget,CompilerParams}
2223GPUCompiler. runtime_module (:: NativeCompilerJob ) = TestRuntime
2324
2425GPUCompiler. method_table (@nospecialize (job:: NativeCompilerJob )) = job. config. params. method_table
2526GPUCompiler. can_safepoint (@nospecialize (job:: NativeCompilerJob )) = job. config. params. entry_safepoint
27+ @static if VERSION > v " 1.11.0-DEV.398"
28+ GPUCompiler. codegen_params (@nospecialize (job:: NativeCompilerJob )) = (;use_jlplt= job. config. params. use_jlplt)
29+ end
2630
2731function create_job (@nospecialize (func), @nospecialize (types); kernel:: Bool = false ,
28- entry_abi= :specfunc , entry_safepoint:: Bool = false , always_inline= false ,
32+ entry_abi= :specfunc , entry_safepoint:: Bool = false , use_jlplt :: Bool = true , always_inline= false ,
2933 method_table= test_method_table, kwargs... )
3034 source = methodinstance (typeof (func), Base. to_tuple_type (types), Base. get_world_counter ())
3135 target = NativeCompilerTarget ()
32- params = CompilerParams (entry_safepoint, method_table)
36+ params = CompilerParams (entry_safepoint, use_jlplt, method_table)
3337 config = CompilerConfig (target, params; kernel, entry_abi, always_inline)
3438 CompilerJob (source, config), kwargs
3539end
0 commit comments