cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::link Namespace Reference

Definitions related to CUDA linking-processes, captured by the link_t wrapper class. More...

Namespaces

 

Classes

struct  options_t
 A convenience class for holding, setting and inspecting options for a CUDA binary code linking process - which may also involve PTX compilation. More...
 

Typedefs

using handle_t = CUlinkState
 A raw CUDA driver handle for a linking-process.
 

Enumerations

enum  input_kind_t {
  cubin,
  input_kind_t::ptx,
  input_kind_t::fatbin,
  input_kind_t::object,
  input_kind_t::library
}
 Kinds of images which can be used by the linker (some may require driver compilation work) More...
 
enum  fallback_strategy_for_binary_code_t {
  prefer_compiling_ptx = 0,
  prefer_using_compatible_binary = 1
}
 Possible strategies for obtaining fully-compiled binary code for a target device when it is not immediately available. More...
 

Functions

link_t wrap (device::id_t device_id, context::handle_t context_handle, link::handle_t handle, const link::options_t &options, bool take_ownership=false) noexcept
 Wrap an existing CUDA link-process in a link_t wrapper class instance. More...
 
link_t create (const void *image, const link::options_t &options)
 
link_t create (const link::options_t &options=link::options_t{})
 Create a new link-process (before adding any compiled images or or image-files)
 

Detailed Description

Definitions related to CUDA linking-processes, captured by the link_t wrapper class.

Enumeration Type Documentation

◆ fallback_strategy_for_binary_code_t

Possible strategies for obtaining fully-compiled binary code for a target device when it is not immediately available.

Enumerator
prefer_compiling_ptx 

Prefer compiling available PTX code to produce fully-compiled binary code.

prefer_using_compatible_binary 

Prefer using existing fully-compiled (binary) code, for a compatible but not identical target device.

◆ input_kind_t

Kinds of images which can be used by the linker (some may require driver compilation work)

Enumerator
ptx 

Compiled device-class-specific device code.

fatbin 

PTX (microarchitecture-inspecific intermediate representation)

object 

A bundle of multiple cubin and/or PTX inputs; typically.

library 

A host-side binary object with embedded device code; a .o file.

Function Documentation

◆ wrap()

link_t cuda::link::wrap ( device::id_t  device_id,
context::handle_t  context_handle,
link::handle_t  handle,
const link::options_t options,
bool  take_ownership = false 
)
inlinenoexcept

Wrap an existing CUDA link-process in a link_t wrapper class instance.

Todo:
: Consider checking if the linking has already been completed!