ImageWrapper is a non-owning wrapper for roccv::Tensors with a NHWC/NCHW/HWC layout. It provides methods for accessing the underlying data within HIP kernels.
More...
#include <image_wrapper.hpp>
|
__device__ __host__ T & | at (int64_t n, int64_t h, int64_t w, int64_t c) |
| Returns a reference to data given coordinates within an image tensor. More...
|
|
__device__ __host__ const T | at (int64_t n, int64_t h, int64_t w, int64_t c) const |
|
__device__ __host__ int64_t | batches () const |
| Retrieves the number of batches in the image tensor. More...
|
|
__device__ __host__ int64_t | channels () const |
| Retries the number of channels in the image. More...
|
|
__device__ __host__ int64_t | height () const |
| Retrives the height of the images. More...
|
|
| ImageWrapper (const Tensor &tensor) |
| Creates an ImageWrapper from a Tensor. More...
|
|
| ImageWrapper (std::vector< BaseType > &input, int32_t batchSize, int32_t width, int32_t height) |
| Creates an ImageWrapper from a vector. More...
|
|
| ImageWrapper (void *input, int32_t batchSize, int32_t width, int32_t height) |
| Creates an ImageWrapper from a pointer. More...
|
|
__device__ __host__ int64_t | width () const |
| Retrieves the width of the image. More...
|
|
template<typename T>
class roccv::ImageWrapper< T >
ImageWrapper is a non-owning wrapper for roccv::Tensors with a NHWC/NCHW/HWC layout. It provides methods for accessing the underlying data within HIP kernels.
- Template Parameters
-
T | The datatype of the underlying tensor data. |
◆ BaseType
◆ ValueType
◆ ImageWrapper() [1/3]
◆ ImageWrapper() [2/3]
Creates an ImageWrapper from a vector.
- Parameters
-
input | The input vector to wrap. |
batchSize | The number of images within the batch. |
width | The width of each image within the batch. |
height | The height of each image within the batch. |
◆ ImageWrapper() [3/3]
Creates an ImageWrapper from a pointer.
- Parameters
-
input | The input pointer to wrap. |
batchSize | The number of images within the batch. |
width | The width of each image within the batch. |
height | The height of each image within the batch. |
◆ at() [1/2]
template<typename T >
__device__ __host__ T& roccv::ImageWrapper< T >::at |
( |
int64_t |
n, |
|
|
int64_t |
h, |
|
|
int64_t |
w, |
|
|
int64_t |
c |
|
) |
| |
|
inline |
Returns a reference to data given coordinates within an image tensor.
- Parameters
-
n | Batch coordinates. |
h | Height coordinates. |
w | Width coordinates. |
c | Channel coordinates. |
- Returns
- A reference to the underlying data at given coordinates.
◆ at() [2/2]
template<typename T >
__device__ __host__ const T roccv::ImageWrapper< T >::at |
( |
int64_t |
n, |
|
|
int64_t |
h, |
|
|
int64_t |
w, |
|
|
int64_t |
c |
|
) |
| const |
|
inline |
◆ batches()
Retrieves the number of batches in the image tensor.
- Returns
- Number of batches.
◆ channels()
Retries the number of channels in the image.
- Returns
- Image channels.
◆ height()
Retrives the height of the images.
- Returns
- Image height.
◆ width()
Retrieves the width of the image.
- Returns
- Image width.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/wrappers/image_wrapper.hpp