Skip to content

nabu.cuda.kernel

source module nabu.cuda.kernel

Classes

  • CudaKernel Helper class that wraps CUDA kernel through cupy SourceModule.

Functions

  • patch_sourcecode_add_externC Patch a source code to surround the relevant parts with 'extern C {}' directive The NVCC compiler needs this to avoid name mangling.

source class CudaKernel(kernel_name, filename=None, src=None, automation_params=None, silent_compilation_warnings=False, extern_c=True, **sourcemodule_kwargs)

Bases : KernelBase

Helper class that wraps CUDA kernel through cupy SourceModule.

Parameters

  • kernel_name : str Name of the CUDA kernel.

  • filename : str, optional Path to the file name containing kernels definitions

  • src : str, optional Source code of kernels definitions

  • automation_params : dict, optional Automation parameters, see below

  • sourcemodule_kwargs : optional Extra arguments to provide to cupy.RawModule(),

Methods

source method CudaKernel.compile_kernel_source(kernel_name, sourcemodule_kwargs)

source method CudaKernel.follow_device_arr(args)

source method CudaKernel.call(*args, **kwargs)

source patch_sourcecode_add_externC(src_code, filename=None)

Patch a source code to surround the relevant parts with 'extern C {}' directive The NVCC compiler needs this to avoid name mangling.

Raises

  • ValueError