cuda.core.Kernel#
- class cuda.core.Kernel(*args, **kwargs)#
Represent a compiled kernel that had been loaded onto the device.
Kernel instances can execution when passed directly into the
launch()function.Directly creating a
Kernelis not supported, and they should instead be created through aObjectCodeobject.Methods
- __init__(*args, **kwargs)#
- static from_handle(
- handle,
- ObjectCode mod: ObjectCode = None,
Creates a new
Kernelobject from a kernel handle.- Parameters:
handle (int) – Kernel handle representing the address of a foreign kernel object (CUkernel).
mod (
ObjectCode, optional) – The ObjectCode object associated with this kernel. Provides library lifetime for foreign kernels not created by cuda.core.
Attributes
- arguments_info#
list[ParamInfo]
list[ParamInfo]: (offset, size) for each argument of this function
- Type:
Kernel.arguments_info
- attributes#
KernelAttributes
Get the read-only attributes of this kernel.
- Type:
Kernel.attributes
- handle#
Return the underlying kernel handle object.
Caution
This handle is a Python object. To get the memory address of the underlying C handle, call
int(Kernel.handle).
- num_arguments#
int
int : The number of arguments of this function
- Type:
Kernel.num_arguments
- occupancy#
KernelOccupancy
Get the occupancy information for launching this kernel.
- Type:
Kernel.occupancy