numba_dpex.core.utils.kernel_flattened_args_builder¶
Provides helpers to populate the list of kernel arguments that will be passed to a DPCTLQueue_Submit function call by a KernelLaunchIRBuilder object.
Overview¶
Stores the llvm IR value and the dpctl typeid for a kernel argument. |
|
Helper to generate the flattened list of kernel arguments to be |
Classes¶
- class KernelArg¶
Bases:
NamedTuple
Stores the llvm IR value and the dpctl typeid for a kernel argument.
Overview
Members
- llvm_val: llvmlite.ir.Instruction¶
- typeid: int¶
- class KernelFlattenedArgsBuilder(context: numba.core.cpu.CPUContext, builder: llvmlite.ir.IRBuilder, kernel_dmm)¶
Helper to generate the flattened list of kernel arguments to be passed to a DPCTLQueue_Submit function.
Note Two separate data models are used when building a flattened kernel argument for the following reason:
Different numba-dpex targets can use different data models for the same data type that may have different number of attributes and a different type for each attribute.
In the case the DpnpNdArray type, two separate data models are used for the CPUTarget and for the SPIRVTarget. The SPIRVTarget does not have the
parent
,meminfo
andsycl_queue
attributes that are present in the data model used by the CPUTarget. The SPIRVTarget’s data model for DpnpNdArray also requires an explicit address space qualifier for thedata
attribute.When generating the LLVM IR for the host-side control code for executing a SPIR-V kernel, the kernel arguments are represented using the CPUTarget’s data model for each argument’s type. However, the actual kernel function generated as a SPIR-V binary by the SPIRVTarget uses its own data model manager to build the flattened kernel function argument list. For this reason, when building the flattened argument list for a kernel launch call the host data model is used to extract the required attributes and then the kernel data model is used to get the correct type for the attribute.
Overview
¶ add_argument
(arg_type, arg_packed_llvm_val)Add flattened representation of a kernel argument.
Returns a list of KernelArg objects representing a flattened kernel
Prints out the kernel argument list in a human readable format.
Members
- add_argument(arg_type, arg_packed_llvm_val)¶
Add flattened representation of a kernel argument.