cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
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
 Definitions and functionality wrapping CUDA APIs.
 

Typedefs

using cuda::texture::raw_handle_t = CUtexObject
 The CUDA driver's raw, opaque handle for texture objects.
 

Functions

texture_view cuda::texture::wrap (device::id_t device_id, 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...
 

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 ( device::id_t  device_id,
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
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 proxy object associated with the specified texture view