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

Use texture memory for optimized read only cache access. More...

#include <texture_view.hpp>

Public Member Functions

 texture_view (const texture_view &other)=delete
 
 texture_view (texture_view &&other) noexcept
 
template<typename T , dimensionality_t NumDimensions>
 texture_view (const cuda::array_t< T, NumDimensions > &arr, texture::descriptor_t descriptor=texture::descriptor_t())
 
texture_viewoperator= (const texture_view &other)=delete
 
texture_viewoperator= (texture_view &other)=delete
 
context_t context () const
 
device_t device () const
 
device::id_t device_id () const noexcept
 Getters for this object's raw fields.
 
context::handle_t context_handle () const noexcept
 
raw_handle_type raw_handle () const noexcept
 
bool is_owning () const noexcept
 

Friends

texture_view texture::wrap (device::id_t, context::handle_t, raw_handle_type, bool) noexcept
 

Detailed Description

Use texture memory for optimized read only cache access.

This represents a view on the memory owned by a CUDA array. Thus you can first create a CUDA array (cuda::array_t) and subsequently create a texture_view from it. In CUDA kernels elements of the array can be accessed with e.g. float val = tex3D<float>(tex_obj, x, y, z);, where tex_obj can be obtained by the member function get() of this class.

See also the following sections in the CUDA programming guide:

Note
texture_view's are essentially owning - the view is a resource the CUDA runtime creates for you, which then needs to be freed.

Member Function Documentation

◆ context()

context_t cuda::texture_view::context ( ) const
inline
Returns
A non-owning proxy object for the CUDA context in which this texture is defined

◆ device()

device_t cuda::texture_view::device ( ) const
inline
Returns
A non-owning proxy object for the CUDA device on which this texture is defined

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