cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::rtc::compilation_output_base_t< Kind > Class Template Reference

The result of the compilation of an {rtc::program_t}, whether successful or failed, with any related byproducts. More...

#include <compilation_output.hpp>

Public Types

using handle_type = program::handle_t< source_kind >
 
using status_type = status_t< source_kind >
 

Public Member Functions

bool succeeded () const
 
bool failed () const
 
 operator bool () const
 
const ::std::string & program_name () const
 
handle_type program_handle () const
 
span< char > log (span< char > buffer) const
 Write a copy of the program compilation log into a user-provided buffer. More...
 
unique_span< char > log () const
 Obtain a copy of the compilation log. More...
 
 compilation_output_base_t (compilation_output_base_t &&other) noexcept
 
compilation_output_base_toperator= (const compilation_output_base_t &other)=delete
 
compilation_output_base_toperator= (compilation_output_base_t &&other)=delete
 

Static Public Attributes

static constexpr const source_kind_t source_kind { Kind }
 

Detailed Description

template<source_kind_t Kind>
class cuda::rtc::compilation_output_base_t< Kind >

The result of the compilation of an {rtc::program_t}, whether successful or failed, with any related byproducts.

Note
This class may own a low-level program handle.
If compilation failed due to apriori-invalid arguments - an exception will have been thrown. A failure indication in this class indicates a program whose compilation actually took place and ended with a failure.

Member Function Documentation

◆ failed()

template<source_kind_t Kind>
bool cuda::rtc::compilation_output_base_t< Kind >::failed ( ) const
inline
Returns
true if the compilation resulting in this output had failed

◆ log() [1/2]

template<source_kind_t Kind>
span<char> cuda::rtc::compilation_output_base_t< Kind >::log ( span< char >  buffer) const
inline

Write a copy of the program compilation log into a user-provided buffer.

Parameters
[in,out]bufferA writable buffer large enough to contain the compilation log
Returns
the buffer passed in (which has now been overwritten with the log)
Note
This will fail if the program has never been compiled, or if the buffer is not large enough to hold the complete log (plus nul character).

◆ log() [2/2]

template<source_kind_t Kind>
unique_span<char> cuda::rtc::compilation_output_base_t< Kind >::log ( ) const
inline

Obtain a copy of the compilation log.

Returns
an owning container with a nul-terminated copy of the log
Note
This will fail if the program has never been compiled.

◆ operator bool()

template<source_kind_t Kind>
cuda::rtc::compilation_output_base_t< Kind >::operator bool ( ) const
inline
Returns
true if the compilation resulting in this output had succeeded, false otherwise

◆ succeeded()

template<source_kind_t Kind>
bool cuda::rtc::compilation_output_base_t< Kind >::succeeded ( ) const
inline
Returns
true if the compilation resulting in this output had succeeded

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