cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::link_t Class Reference

Wrapper class for a CUDA link (a process of linking compiled code together into an executable binary, using CUDA, at run-time) More...

#include <link.hpp>

Public Member Functions

device::id_t device_id () const noexcept
 The raw CUDA ID for the device w.r.t. which the link is defined.
 
context::handle_t context_handle () const noexcept
 The raw CUDA handle for the context in which the represented stream is defined.
 
bool is_owning () const noexcept
 True if this wrapper is responsible for telling CUDA to destroy the link upon the wrapper's own destruction.
 
device_t device () const
 The device w.r.t. which the link is defined.
 
context_t context () const
 The context in which this stream was defined.
 
memory::region_t complete () const
 Complete a linking process, producing a completely-linked cubin image (for loading into modules). More...
 
void add (link::input::image_t image, const link::options_t &ptx_compilation_options={}) const
 Add another linkable image, from memory, to this linking-process. More...
 
 link_t (const link_t &)=delete
 
 link_t (link_t &&other) noexcept
 
link_toperator= (const link_t &)=delete
 
link_toperator= (link_t &&other) noexcept
 
void add_file (link::input::file_t file_input, const link::options_t &options={}) const
 Add another linkable image, from a file, to this linking-process. More...
 
void add_file (const char *path, link::input_kind_t file_contents_type, const link::options_t &options={}) const
 

Friends

link_t link::wrap (device::id_t, context::handle_t, link::handle_t, const link::options_t &, bool) noexcept
 

Detailed Description

Wrapper class for a CUDA link (a process of linking compiled code together into an executable binary, using CUDA, at run-time)

Note
This class is a "reference type", not a "value type". Therefore, making changes to the link is a const-respecting operation on this class.

Member Function Documentation

◆ add()

void cuda::link_t::add ( link::input::image_t  image,
const link::options_t ptx_compilation_options = {} 
) const
inline

Add another linkable image, from memory, to this linking-process.

Parameters
[in]imageMemory region containing the image
[in]ptx_compilation_optionsOptions for compiling PTX code to cubin, if necessary, before linking.
Note
some types of linkable images are not, in fact, even compiled - but can be compiled by the driver with the specified options.

◆ add_file()

void cuda::link_t::add_file ( link::input::file_t  file_input,
const link::options_t options = {} 
) const
inline

Add another linkable image, from a file, to this linking-process.

Parameters
[in]file_inputPath of the image file to be added
[in]ptx_compilation_optionsOptions for compiling PTX code to cubin, if necessary, before linking.
Note
some types of linkable images are not, in fact, even compiled - but can be compiled by the driver with the specified options.

◆ complete()

memory::region_t cuda::link_t::complete ( ) const
inline

Complete a linking process, producing a completely-linked cubin image (for loading into modules).

Returns
The completely-linked cubin image, in a sized memory range. This memory is owned by the link object, and must not be freed/deleted.

The documentation for this class was generated from the following file: