HIP: Heterogenous-computing Interface for Portability
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
hip_texture.h File Reference

HIP C++ Texture API for hcc compiler. More...

#include <limits.h>

Go to the source code of this file.

Classes

struct  hipChannelFormatDesc
 
struct  textureReference
 
struct  hipArray
 

Macros

#define hipTextureType1D   1
 
#define tex1Dfetch(_tex, _addr)   (_tex._dataPtr[_addr])
 
#define tex2D(_tex, _dx, _dy)   _tex._dataPtr[(unsigned int)_dx + (unsigned int)_dy*(_tex.width)]
 

Typedefs

typedef struct hipChannelFormatDesc hipChannelFormatDesc
 
typedef enum hipTextureReadMode hipTextureReadMode
 
typedef enum hipTextureFilterMode hipTextureFilterMode
 

Enumerations

enum  hipChannelFormatKind { hipChannelFormatKindSigned = 0, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat, hipChannelFormatKindNone }
 
enum  hipTextureReadMode { hipReadModeElementType }
 
enum  hipTextureFilterMode { hipFilterModePoint }
 

Functions

hipError_t hipMallocArray (hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height=0, unsigned int flags=0)
 Allocate an array on the device. More...
 
hipError_t hipFreeArray (hipArray *array)
 Frees an array on the device. More...
 
hipError_t hipMemcpy2D (void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
 Copies data between host and device. More...
 
hipError_t hipMemcpy2DToArray (hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
 Copies data between host and device. More...
 
hipError_t hipMemcpyToArray (hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)
 Copies data between host and device. More...
 
hipChannelFormatDesc hipCreateChannelDesc (int x, int y, int z, int w, hipChannelFormatKind f)
 Returns a channel descriptor using the specified format. More...
 
template<typename T >
hipChannelFormatDesc hipCreateChannelDesc ()
 
template<>
hipChannelFormatDesc hipCreateChannelDesc< int > ()
 
template<>
hipChannelFormatDesc hipCreateChannelDesc< unsigned int > ()
 
template<>
hipChannelFormatDesc hipCreateChannelDesc< long > ()
 
template<>
hipChannelFormatDesc hipCreateChannelDesc< unsigned long > ()
 
template<>
hipChannelFormatDesc hipCreateChannelDesc< float > ()
 
template<class T , int dim, enum hipTextureReadMode readMode>
hipError_t hipBindTexture (size_t *offset, struct texture< T, dim, readMode > &tex, const void *devPtr, const struct hipChannelFormatDesc *desc, size_t size=UINT_MAX)
 
template<class T , int dim, enum hipTextureReadMode readMode>
hipError_t hipBindTexture (size_t *offset, struct texture< T, dim, readMode > &tex, const void *devPtr, size_t size=UINT_MAX)
 
template<class T , int dim, enum hipTextureReadMode readMode>
hipError_t hipBindTextureToArray (struct texture< T, dim, readMode > &tex, hipArray *array)
 
template<class T , int dim, enum hipTextureReadMode readMode>
hipError_t hipUnbindTexture (struct texture< T, dim, readMode > &tex)
 

Detailed Description

HIP C++ Texture API for hcc compiler.

Enumeration Type Documentation

Enumerator
hipFilterModePoint 

Point filter mode.

Enumerator
hipReadModeElementType 

Read texture as specified element type

Function Documentation

hipError_t hipFreeArray ( hipArray array)

Frees an array on the device.

Parameters
[in]arrayPointer to array to free
Returns
hipSuccess, hipErrorInvalidValue, hipErrorInitializationError
See Also
hipMalloc, hipMallocPitch, hipFree, hipMallocArray, hipHostMalloc, hipHostFree
hipError_t hipMallocArray ( hipArray **  array,
const hipChannelFormatDesc desc,
size_t  width,
size_t  height = 0,
unsigned int  flags = 0 
)

Allocate an array on the device.

Parameters
[out]arrayPointer to allocated array in device memory
[in]descRequested channel format
[in]widthRequested array allocation width
[in]heightRequested array allocation height
[in]flagsRequested properties of allocated array
Returns
hipSuccess, hipErrorMemoryAllocation
See Also
hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree
hipError_t hipMemcpy2D ( void *  dst,
size_t  dpitch,
const void *  src,
size_t  spitch,
size_t  width,
size_t  height,
hipMemcpyKind  kind 
)

Copies data between host and device.

Parameters
[in]dstDestination memory address
[in]dpitchPitch of destination memory
[in]srcSource memory address
[in]spitchPitch of source memory
[in]widthWidth of matrix transfer (columns in bytes)
[in]heightHeight of matrix transfer (rows)
[in]kindType of transfer
Returns
hipSuccess, hipErrorInvalidValue, #hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
See Also
hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync
hipError_t hipMemcpy2DToArray ( hipArray dst,
size_t  wOffset,
size_t  hOffset,
const void *  src,
size_t  spitch,
size_t  width,
size_t  height,
hipMemcpyKind  kind 
)

Copies data between host and device.

Parameters
[in]dstDestination memory address
[in]dpitchPitch of destination memory
[in]srcSource memory address
[in]spitchPitch of source memory
[in]widthWidth of matrix transfer (columns in bytes)
[in]heightHeight of matrix transfer (rows)
[in]kindType of transfer
Returns
hipSuccess, hipErrorInvalidValue, #hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
See Also
hipMemcpy, hipMemcpyToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync
hipError_t hipMemcpyToArray ( hipArray dst,
size_t  wOffset,
size_t  hOffset,
const void *  src,
size_t  count,
hipMemcpyKind  kind 
)

Copies data between host and device.

Parameters
[in]dstDestination memory address
[in]dpitchPitch of destination memory
[in]srcSource memory address
[in]spitchPitch of source memory
[in]widthWidth of matrix transfer (columns in bytes)
[in]heightHeight of matrix transfer (rows)
[in]kindType of transfer
Returns
hipSuccess, hipErrorInvalidValue, #hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
See Also
hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync