WisdomKernel

struct WisdomKernel

An instance of a CUDA kernel where the configuration is loaded from a wisdom file using the provided WisdomSettings.

Public Functions

inline WisdomKernel(KernelBuilder builder, Compiler compiler = default_compiler(), WisdomSettings settings = default_wisdom_settings())

Initialize this kernel. This will not directly compile the kernel. Compilation of the kernel happens on the first call to launch or to compile.

Parameters:
  • builder – The kernel’s specifications.

  • compiler – The compiler to use for compilation.

  • settings – The wisdom settings to use load configurations.

void compile(ProblemSize problem_size, std::vector<TypeInfo> param_types, CudaContextHandle context = CudaContextHandle::current())

Explicitly compile this kernel for the given problem size and parameter types.

Parameters:
  • problem_size – Use to find the configuration from the wisdom file.

  • param_types – Types of kernel parameters.

  • context – CUDA context to use for compilation.

void compile(std::vector<KernelArg> args, CudaContextHandle context = CudaContextHandle::current())

Explicitly compile this kernel for the given problem size and parameter types.

Parameters:
  • problem_size – Use to find the configuration from the wisdom file.

  • param_types – Types of kernel parameters.

  • context – CUDA context to use for compilation.

void capture_next_launch(int skip_launches = 0)

Sets an internal flag that enables the next launch of this kernel to be captured.

Parameters:

skip – Optionally set the number of kernel launches to skip_launches before capturing a kernel launch. For example, if skip_launches=5 then the next 6th kernel launch will be captured.

void clear()

Delete this kernel and reset its contents.

template<typename ...Args>
inline void launch(cudaStream_t stream, Args&&... args)

Launch this kernel onto the given stream with the given arguments. This will compile the kernel if it has not yet been compiled.

template<typename ...Args>
inline void launch(Args&&... args)

Launch this kernel with the given arguments on the default CUDA stream. This will compile the kernel if it has not yet been compiled.