All Classes Namespaces Functions Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
kvikio::CUFileHandleWrapper Class Reference

Class that provides RAII for the cuFile handle. More...

#include <file_utils.hpp>

Public Member Functions

 CUFileHandleWrapper (CUFileHandleWrapper const &)=delete
 
CUFileHandleWrapperoperator= (CUFileHandleWrapper const &)=delete
 
 CUFileHandleWrapper (CUFileHandleWrapper &&o) noexcept
 
CUFileHandleWrapperoperator= (CUFileHandleWrapper &&o) noexcept
 
std::optional< CUfileError_tregister_handle (int fd) noexcept
 Register the file handle given the file descriptor. More...
 
bool registered () const noexcept
 Check if the handle has been registered. More...
 
CUfileHandle_t handle () const noexcept
 Return the cuFile handle. More...
 
void unregister_handle () noexcept
 Unregister the handle if it has been registered; do nothing otherwise.
 

Detailed Description

Class that provides RAII for the cuFile handle.

Definition at line 86 of file file_utils.hpp.

Member Function Documentation

◆ handle()

CUfileHandle_t kvikio::CUFileHandleWrapper::handle ( ) const
noexcept

Return the cuFile handle.

Returns
The cuFile handle.

◆ register_handle()

std::optional<CUfileError_t> kvikio::CUFileHandleWrapper::register_handle ( int  fd)
noexcept

Register the file handle given the file descriptor.

Parameters
fdFile descriptor.
Returns
Return the cuFile error code from handle register. If the handle has already been registered by calling register_handle(), return std::nullopt.

◆ registered()

bool kvikio::CUFileHandleWrapper::registered ( ) const
noexcept

Check if the handle has been registered.

Returns
A boolean answer indicating if the handle has been registered.

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