- ak.to_kernels(array, kernels, highlevel=True, behavior=None)¶
array – Data to convert to a specified
"cuda") – If
"cpu", the array structure is recursively copied (if need be) to main memory for use with the default
"cuda", the structure is copied to the GPU(s) for use with
highlevel (bool) – If True, return an
ak.Array; otherwise, return a low-level
behavior (None or dict) – Custom
ak.behaviorfor the output array, if high-level.
Converts an array from
"mixed" kernels to
An array is
"mixed" if some components are set to use
"cpu" kernels and
others are set to use
"cuda" kernels. Mixed arrays can’t be used in any
operations, and two arrays set to different kernels can’t be used in the
Any components that are already in the desired kernels library are viewed, rather than copied, so this operation can be an inexpensive way to ensure that an array is ready for a particular library.
"cuda", the package
be installed, either by
pip install awkward-cuda-kernels
or as an optional dependency with
pip install awkward[cuda] --upgrade
It is only available for Linux as a binary wheel, and only supports Nvidia GPUs (it is written in CUDA).