Skip to content

Commit

Permalink
progress...
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Oct 20, 2023
1 parent 3967c31 commit 48066fc
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions numba_dpex/experimental/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ def _create_kernel_launcher_body(
builder: llvmir.IRBuilder,
kernel_argtys: tuple[types.Type, ...],
kernel_bc: llvmir.Constant,
args: [llvmir.Instruction, ...],
):
klbuilder = kl.KernelLaunchIRBuilder(kernel_targetctx, builder)

if config.DEBUG_KERNEL_LAUNCHER:
cgutils.printf(
builder, "DPEX-DEBUG: Inside the kernel launcher function"
builder, "DPEX-DEBUG: Inside the kernel launcher function\n"
)

num_flattened_kernel_args = _get_num_flattened_kernel_args(
Expand All @@ -78,18 +79,18 @@ def _create_kernel_launcher_body(
num_flattened_kernel_args
)

cgutils.create_struct_proxy(kernel_argtys[0])(codegen_targetctx, builder)
# breakpoint()

breakpoint()
# callargs = []

# Populate the args_list and the args_ty_list LLVM arrays
klbuilder.populate_kernel_args_and_args_ty_arrays(
callargs_ptrs=callargs_ptrs,
kernel_argtys=kernel_argtys,
args_list=args_list,
args_ty_list=args_ty_list,
datamodel_mgr=kernel_targetctx.data_model_manager,
)
# # Populate the args_list and the args_ty_list LLVM arrays
# klbuilder.populate_kernel_args_and_args_ty_arrays(
# callargs_ptrs=callargs_ptrs,
# kernel_argtys=kernel_argtys,
# args_list=args_list,
# args_ty_list=args_ty_list,
# datamodel_mgr=kernel_targetctx.data_model_manager,
# )


@intrinsic
Expand All @@ -108,9 +109,14 @@ def codegen(cgctx, builder, sig, llargs):
# kernel_work_details = <get that thing above>
# # now generate the call to the driver to launch the kernel
# builder.call(<driver function>, kernel_work_details, llargs)
kernel_args = kernel_sig.args
kernel_argtys = kernel_sig.args
_create_kernel_launcher_body(
cgctx, kernel_targetctx, builder, kernel_args, kernel_bitcode
cgctx,
kernel_targetctx,
builder,
kernel_argtys,
kernel_bitcode,
llargs,
)

return sig, codegen
Expand Down

0 comments on commit 48066fc

Please sign in to comment.