rocPRIM
Public Types | Public Member Functions | Friends | List of all members
texture_cache_iterator< T, Difference > Class Template Reference

A random-access input (read-only) iterator adaptor for dereferencing array values through texture cache. More...

#include <texture_cache_iterator.hpp>

Public Types

using value_type = typename std::remove_const< T >::type
 The type of the value that can be obtained by dereferencing the iterator.
 
using reference = const value_type &
 A reference type of the type iterated over (value_type).
 
using pointer = const value_type *
 A pointer type of the type iterated over (value_type).
 
using difference_type = Difference
 A type used for identify distance between iterators.
 
using iterator_category = std::random_access_iterator_tag
 The category of the iterator.
 
using self_type = texture_cache_iterator
 

Public Member Functions

template<class Qualified >
hipError_t bind_texture (Qualified *ptr, size_t bytes=size_t(-1), size_t texture_offset=0)
 Creates a hipTextureObject_t and binds this iterator to it. More...
 
hipError_t unbind_texture ()
 Destroys the texture object that this iterator points at.
 
ROCPRIM_HOST_DEVICE texture_cache_iteratoroperator++ ()
 
ROCPRIM_HOST_DEVICE texture_cache_iterator operator++ (int)
 
ROCPRIM_HOST_DEVICE value_type operator* () const
 
ROCPRIM_HOST_DEVICE pointer operator-> () const
 
ROCPRIM_HOST_DEVICE texture_cache_iterator operator+ (difference_type distance) const
 
ROCPRIM_HOST_DEVICE texture_cache_iteratoroperator+= (difference_type distance)
 
ROCPRIM_HOST_DEVICE texture_cache_iterator operator- (difference_type distance) const
 
ROCPRIM_HOST_DEVICE texture_cache_iteratoroperator-= (difference_type distance)
 
ROCPRIM_HOST_DEVICE difference_type operator- (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE value_type operator[] (difference_type distance) const
 
ROCPRIM_HOST_DEVICE bool operator== (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE bool operator!= (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE bool operator< (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE bool operator<= (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE bool operator> (texture_cache_iterator other) const
 
ROCPRIM_HOST_DEVICE bool operator>= (texture_cache_iterator other) const
 

Friends

std::ostream & operator<< (std::ostream &os, const texture_cache_iterator &)
 

Detailed Description

template<class T, class Difference = std::ptrdiff_t>
class texture_cache_iterator< T, Difference >

A random-access input (read-only) iterator adaptor for dereferencing array values through texture cache.

This iterator is not functional on gfx94x architectures.

Overview
  • A texture_cache_iterator wraps a device pointer of type T, where values are obtained by dereferencing through texture cache.
  • Can be exchanged and manipulated within and between host and device functions.
  • Can only be constructed within host functions, and can only be dereferenced within device functions.
  • Accepts any data type from memory, and loads through texture cache.
  • This iterator is not functional on gfx94x architectures, as native texture fetch functions are not supported in gfx94x.
Template Parameters
T- type of value that can be obtained by dereferencing the iterator.
Difference- a type used for identify distance between iterators.

Member Function Documentation

◆ bind_texture()

template<class T, class Difference = std::ptrdiff_t>
template<class Qualified >
hipError_t texture_cache_iterator< T, Difference >::bind_texture ( Qualified *  ptr,
size_t  bytes = size_t(-1),
size_t  texture_offset = 0 
)
inline

Creates a hipTextureObject_t and binds this iterator to it.

Template Parameters
Texturedata pointer type
Parameters
ptr- pointer to the texture data on the device
bytes- size of the texture data (in bytes)
texture_offset- an offset from ptr to load texture data from (Defaults to 0)

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