openclutil

OpenCL utilities.

This module implements utilities for using OpenCL.

class openclutil.CLKernel(filename: str, dir: Path = None, context: Context = None, queue: CommandQueue = None, loader: Callable[[Path], bytes] = None)

Helper to load a OpenCL kernel from a file.

copy_array_to_image(arr: ndarray, image: Image) None

Copy an numpy array to an OpenCL image.

copy_image_to_array(image: Image, arr: ndarray) None

Copy an OpenCL image to a numpy array.

openclutil.select_device(verbose: bool = True) Device

Select the last device or use environment variable XFOPENCL to select a device by name.