cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
Classes | Namespaces | Macros | Typedefs | Functions
texture_view.hpp File Reference

Contains a "texture view" class, for hardware-accelerated access to CUDA arrays, and some related standalone functions and definitions. More...

#include "array.hpp"
#include "error.hpp"
#include "memory.hpp"
Include dependency graph for texture_view.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cuda::texture::descriptor_t
 A simplifying rudimentary wrapper wrapper for the CUDA runtime API's internal "texture descriptor" object, allowing the creating of such descriptors without having to give it too much thought. More...
 
class  cuda::texture_view
 Use texture memory for optimized read only cache access. More...
 

Namespaces

 cuda
 All definitions and functionality wrapping the CUDA Runtime API.
 

Typedefs

using cuda::texture::raw_handle_t = CUtexObject
 

Functions

texture_view cuda::texture::wrap (context::handle_t context_handle_, texture::raw_handle_t handle, bool take_ownership) noexcept
 Obtain a proxy object for an already-existing CUDA texture view. More...
 
bool cuda::operator== (const texture_view &lhs, const texture_view &rhs) noexcept
 
bool cuda::operator!= (const texture_view &lhs, const texture_view &rhs) noexcept
 

Detailed Description

Contains a "texture view" class, for hardware-accelerated access to CUDA arrays, and some related standalone functions and definitions.

Function Documentation

◆ wrap()

texture_view cuda::texture::wrap ( context::handle_t  context_handle_,
texture::raw_handle_t  handle,
bool  take_ownership 
)
inlinenoexcept

Obtain a proxy object for an already-existing CUDA texture view.

Note
This is a named constructor idiom, existing of direct access to the ctor of the same signature, to emphasize that a new texture view is not created.
Parameters
iddevice on which the texture is located
context_handlehandle of the context in which the texture_view was created
handleraw CUDA API handle for the texture view
take_ownershipwhen true, the wrapper will have the CUDA Runtime API destroy the texture view when it destructs (making an "owning" texture view wrapper; otherwise, it is assume that some other code "owns" the texture view and will destroy it when necessary (and not while the wrapper is being used!)
Returns
a wrapper object associated with the specified texture view