nabu.cuda.processing module

class nabu.cuda.processing.CudaProcessing(device_id=None, ctx=None, stream=None, cleanup_at_exit=True)[source]

Bases: ProcessingBase

Initialie a CudaProcessing instance.

CudaProcessing is a base class for all CUDA-based processings. This class provides utilities for context/device management, and arrays allocation.

Parameters:
  • device_id (int, optional) – ID of the cuda device to use (those of the nvidia-smi command). Ignored if ctx is not None.

  • ctx (pycuda.driver.Context, optional) – Existing context to use. If provided, do not create a new context.

  • stream (pycudacuda.driver.Stream, optional) – Cuda stream. If not provided, will use the default stream

  • cleanup_at_exit (bool, optional) – Whether to clean-up the context at exit. Ignored if ctx is not None.

array_class

alias of GPUArray

dtype_to_ctype(with_fp_tex_hack=False)
push_context()[source]
pop_context()[source]
kernel(kernel_name, filename=None, src=None, signature=None, texrefs=None, automation_params=None, **build_kwargs)[source]