SWDEV-470698 - fix formatting, add format check workflow (#657)
Este commit está contenido en:
cometido por
GitHub
padre
5840940caa
commit
f7338717ae
@@ -33,7 +33,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/nvidia_detail/nvidia_channel_descriptor.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <device_functions.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||
#if __cplusplus
|
||||
#include <cstdlib>
|
||||
#else
|
||||
#include <stdlib.h> // size_t
|
||||
#include <stdlib.h> // size_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -48,20 +48,20 @@ typedef void* hipDeviceptr_t;
|
||||
* HIP channel format kinds
|
||||
*/
|
||||
typedef enum hipChannelFormatKind {
|
||||
hipChannelFormatKindSigned = 0, ///< Signed channel format
|
||||
hipChannelFormatKindUnsigned = 1, ///< Unsigned channel format
|
||||
hipChannelFormatKindFloat = 2, ///< Float channel format
|
||||
hipChannelFormatKindNone = 3 ///< No channel format
|
||||
hipChannelFormatKindSigned = 0, ///< Signed channel format
|
||||
hipChannelFormatKindUnsigned = 1, ///< Unsigned channel format
|
||||
hipChannelFormatKindFloat = 2, ///< Float channel format
|
||||
hipChannelFormatKindNone = 3 ///< No channel format
|
||||
} hipChannelFormatKind;
|
||||
/**
|
||||
* HIP channel format descriptor
|
||||
*/
|
||||
typedef struct hipChannelFormatDesc {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int w;
|
||||
enum hipChannelFormatKind f; ///< Channel format kind
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int w;
|
||||
enum hipChannelFormatKind f; ///< Channel format kind
|
||||
} hipChannelFormatDesc;
|
||||
/** @brief The hipTexRefSetArray function flags parameter override format value*/
|
||||
#define HIP_TRSA_OVERRIDE_FORMAT 0x01
|
||||
@@ -78,74 +78,74 @@ typedef const struct hipArray* hipArray_const_t;
|
||||
* HIP array format
|
||||
*/
|
||||
typedef enum hipArray_Format {
|
||||
HIP_AD_FORMAT_UNSIGNED_INT8 = 0x01, ///< Unsigned 8-bit array format
|
||||
HIP_AD_FORMAT_UNSIGNED_INT16 = 0x02, ///< Unsigned 16-bit array format
|
||||
HIP_AD_FORMAT_UNSIGNED_INT32 = 0x03, ///< Unsigned 32-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT8 = 0x08, ///< Signed 8-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT16 = 0x09, ///< Signed 16-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT32 = 0x0a, ///< Signed 32-bit array format
|
||||
HIP_AD_FORMAT_HALF = 0x10, ///< Half array format
|
||||
HIP_AD_FORMAT_FLOAT = 0x20 ///< Float array format
|
||||
HIP_AD_FORMAT_UNSIGNED_INT8 = 0x01, ///< Unsigned 8-bit array format
|
||||
HIP_AD_FORMAT_UNSIGNED_INT16 = 0x02, ///< Unsigned 16-bit array format
|
||||
HIP_AD_FORMAT_UNSIGNED_INT32 = 0x03, ///< Unsigned 32-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT8 = 0x08, ///< Signed 8-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT16 = 0x09, ///< Signed 16-bit array format
|
||||
HIP_AD_FORMAT_SIGNED_INT32 = 0x0a, ///< Signed 32-bit array format
|
||||
HIP_AD_FORMAT_HALF = 0x10, ///< Half array format
|
||||
HIP_AD_FORMAT_FLOAT = 0x20 ///< Float array format
|
||||
} hipArray_Format;
|
||||
/**
|
||||
* HIP array descriptor
|
||||
*/
|
||||
typedef struct HIP_ARRAY_DESCRIPTOR {
|
||||
size_t Width; ///< Width of the array
|
||||
size_t Height; ///< Height of the array
|
||||
enum hipArray_Format Format; ///< Format of the array
|
||||
unsigned int NumChannels; ///< Number of channels of the array
|
||||
size_t Width; ///< Width of the array
|
||||
size_t Height; ///< Height of the array
|
||||
enum hipArray_Format Format; ///< Format of the array
|
||||
unsigned int NumChannels; ///< Number of channels of the array
|
||||
} HIP_ARRAY_DESCRIPTOR;
|
||||
|
||||
/**
|
||||
* HIP 3D array descriptor
|
||||
*/
|
||||
typedef struct HIP_ARRAY3D_DESCRIPTOR {
|
||||
size_t Width; ///< Width of the array
|
||||
size_t Height; ///< Height of the array
|
||||
size_t Depth; ///< Depth of the array
|
||||
enum hipArray_Format Format; ///< Format of the array
|
||||
unsigned int NumChannels; ///< Number of channels of the array
|
||||
unsigned int Flags; ///< Flags of the array
|
||||
size_t Width; ///< Width of the array
|
||||
size_t Height; ///< Height of the array
|
||||
size_t Depth; ///< Depth of the array
|
||||
enum hipArray_Format Format; ///< Format of the array
|
||||
unsigned int NumChannels; ///< Number of channels of the array
|
||||
unsigned int Flags; ///< Flags of the array
|
||||
} HIP_ARRAY3D_DESCRIPTOR;
|
||||
#if !defined(__HIPCC_RTC__)
|
||||
/**
|
||||
* HIP 2D memory copy parameters
|
||||
*/
|
||||
typedef struct hip_Memcpy2D {
|
||||
size_t srcXInBytes; ///< Source width in bytes
|
||||
size_t srcY; ///< Source height
|
||||
hipMemoryType srcMemoryType; ///< Source memory type
|
||||
const void* srcHost; ///< Source pointer
|
||||
hipDeviceptr_t srcDevice; ///< Source device
|
||||
hipArray_t srcArray; ///< Source array
|
||||
size_t srcPitch; ///< Source pitch
|
||||
size_t dstXInBytes; ///< Destination width in bytes
|
||||
size_t dstY; ///< Destination height
|
||||
hipMemoryType dstMemoryType; ///< Destination memory type
|
||||
void* dstHost; ///< Destination pointer
|
||||
hipDeviceptr_t dstDevice; ///< Destination device
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
size_t dstPitch; ///< Destination pitch
|
||||
size_t WidthInBytes; ///< Width in bytes of the 2D memory copy
|
||||
size_t Height; ///< Height of the 2D memory copy
|
||||
size_t srcXInBytes; ///< Source width in bytes
|
||||
size_t srcY; ///< Source height
|
||||
hipMemoryType srcMemoryType; ///< Source memory type
|
||||
const void* srcHost; ///< Source pointer
|
||||
hipDeviceptr_t srcDevice; ///< Source device
|
||||
hipArray_t srcArray; ///< Source array
|
||||
size_t srcPitch; ///< Source pitch
|
||||
size_t dstXInBytes; ///< Destination width in bytes
|
||||
size_t dstY; ///< Destination height
|
||||
hipMemoryType dstMemoryType; ///< Destination memory type
|
||||
void* dstHost; ///< Destination pointer
|
||||
hipDeviceptr_t dstDevice; ///< Destination device
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
size_t dstPitch; ///< Destination pitch
|
||||
size_t WidthInBytes; ///< Width in bytes of the 2D memory copy
|
||||
size_t Height; ///< Height of the 2D memory copy
|
||||
} hip_Memcpy2D;
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
/**
|
||||
* HIP mipmapped array
|
||||
*/
|
||||
typedef struct hipMipmappedArray {
|
||||
void* data; ///< Data pointer of the mipmapped array
|
||||
struct hipChannelFormatDesc desc; ///< Description of the mipmapped array
|
||||
unsigned int type; ///< Type of the mipmapped array
|
||||
unsigned int width; ///< Width of the mipmapped array
|
||||
unsigned int height; ///< Height of the mipmapped array
|
||||
unsigned int depth; ///< Depth of the mipmapped array
|
||||
unsigned int min_mipmap_level; ///< Minimum level of the mipmapped array
|
||||
unsigned int max_mipmap_level; ///< Maximum level of the mipmapped array
|
||||
unsigned int flags; ///< Flags of the mipmapped array
|
||||
enum hipArray_Format format; ///< Format of the mipmapped array
|
||||
unsigned int num_channels; ///< Number of channels of the mipmapped array
|
||||
void* data; ///< Data pointer of the mipmapped array
|
||||
struct hipChannelFormatDesc desc; ///< Description of the mipmapped array
|
||||
unsigned int type; ///< Type of the mipmapped array
|
||||
unsigned int width; ///< Width of the mipmapped array
|
||||
unsigned int height; ///< Height of the mipmapped array
|
||||
unsigned int depth; ///< Depth of the mipmapped array
|
||||
unsigned int min_mipmap_level; ///< Minimum level of the mipmapped array
|
||||
unsigned int max_mipmap_level; ///< Maximum level of the mipmapped array
|
||||
unsigned int flags; ///< Flags of the mipmapped array
|
||||
enum hipArray_Format format; ///< Format of the mipmapped array
|
||||
unsigned int num_channels; ///< Number of channels of the mipmapped array
|
||||
} hipMipmappedArray;
|
||||
/**
|
||||
* HIP mipmapped array pointer
|
||||
@@ -157,304 +157,306 @@ typedef const struct hipMipmappedArray* hipMipmappedArray_const_t;
|
||||
* HIP resource types
|
||||
*/
|
||||
typedef enum hipResourceType {
|
||||
hipResourceTypeArray = 0x00, ///< Array resource
|
||||
hipResourceTypeMipmappedArray = 0x01, ///< Mipmapped array resource
|
||||
hipResourceTypeLinear = 0x02, ///< Linear resource
|
||||
hipResourceTypePitch2D = 0x03 ///< Pitch 2D resource
|
||||
hipResourceTypeArray = 0x00, ///< Array resource
|
||||
hipResourceTypeMipmappedArray = 0x01, ///< Mipmapped array resource
|
||||
hipResourceTypeLinear = 0x02, ///< Linear resource
|
||||
hipResourceTypePitch2D = 0x03 ///< Pitch 2D resource
|
||||
} hipResourceType;
|
||||
typedef enum HIPresourcetype_enum {
|
||||
HIP_RESOURCE_TYPE_ARRAY = 0x00, ///< Array resource
|
||||
HIP_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01, ///< Mipmapped array resource
|
||||
HIP_RESOURCE_TYPE_LINEAR = 0x02, ///< Linear resource
|
||||
HIP_RESOURCE_TYPE_PITCH2D = 0x03 ///< Pitch 2D resource
|
||||
} HIPresourcetype, hipResourcetype;
|
||||
HIP_RESOURCE_TYPE_ARRAY = 0x00, ///< Array resource
|
||||
HIP_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01, ///< Mipmapped array resource
|
||||
HIP_RESOURCE_TYPE_LINEAR = 0x02, ///< Linear resource
|
||||
HIP_RESOURCE_TYPE_PITCH2D = 0x03 ///< Pitch 2D resource
|
||||
} HIPresourcetype,
|
||||
hipResourcetype;
|
||||
/**
|
||||
* HIP texture address modes
|
||||
*/
|
||||
typedef enum HIPaddress_mode_enum {
|
||||
HIP_TR_ADDRESS_MODE_WRAP = 0, ///< Wrap address mode
|
||||
HIP_TR_ADDRESS_MODE_CLAMP = 1, ///< Clamp address mode
|
||||
HIP_TR_ADDRESS_MODE_MIRROR = 2, ///< Mirror address mode
|
||||
HIP_TR_ADDRESS_MODE_BORDER = 3 ///< Border address mode
|
||||
HIP_TR_ADDRESS_MODE_WRAP = 0, ///< Wrap address mode
|
||||
HIP_TR_ADDRESS_MODE_CLAMP = 1, ///< Clamp address mode
|
||||
HIP_TR_ADDRESS_MODE_MIRROR = 2, ///< Mirror address mode
|
||||
HIP_TR_ADDRESS_MODE_BORDER = 3 ///< Border address mode
|
||||
} HIPaddress_mode;
|
||||
/**
|
||||
* HIP filter modes
|
||||
*/
|
||||
typedef enum HIPfilter_mode_enum {
|
||||
HIP_TR_FILTER_MODE_POINT = 0, ///< Filter mode point
|
||||
HIP_TR_FILTER_MODE_LINEAR = 1 ///< Filter mode linear
|
||||
HIP_TR_FILTER_MODE_POINT = 0, ///< Filter mode point
|
||||
HIP_TR_FILTER_MODE_LINEAR = 1 ///< Filter mode linear
|
||||
} HIPfilter_mode;
|
||||
/**
|
||||
* HIP texture descriptor
|
||||
*/
|
||||
typedef struct HIP_TEXTURE_DESC_st {
|
||||
HIPaddress_mode addressMode[3]; ///< Address modes
|
||||
HIPfilter_mode filterMode; ///< Filter mode
|
||||
unsigned int flags; ///< Flags
|
||||
unsigned int maxAnisotropy; ///< Maximum anisotropy ratio
|
||||
HIPfilter_mode mipmapFilterMode; ///< Mipmap filter mode
|
||||
float mipmapLevelBias; ///< Mipmap level bias
|
||||
float minMipmapLevelClamp; ///< Mipmap minimum level clamp
|
||||
float maxMipmapLevelClamp; ///< Mipmap maximum level clamp
|
||||
float borderColor[4]; ///< Border Color
|
||||
int reserved[12];
|
||||
HIPaddress_mode addressMode[3]; ///< Address modes
|
||||
HIPfilter_mode filterMode; ///< Filter mode
|
||||
unsigned int flags; ///< Flags
|
||||
unsigned int maxAnisotropy; ///< Maximum anisotropy ratio
|
||||
HIPfilter_mode mipmapFilterMode; ///< Mipmap filter mode
|
||||
float mipmapLevelBias; ///< Mipmap level bias
|
||||
float minMipmapLevelClamp; ///< Mipmap minimum level clamp
|
||||
float maxMipmapLevelClamp; ///< Mipmap maximum level clamp
|
||||
float borderColor[4]; ///< Border Color
|
||||
int reserved[12];
|
||||
} HIP_TEXTURE_DESC;
|
||||
/**
|
||||
* HIP texture resource view formats
|
||||
*/
|
||||
typedef enum hipResourceViewFormat {
|
||||
hipResViewFormatNone = 0x00, ///< No resource view format (use underlying resource format)
|
||||
hipResViewFormatUnsignedChar1 = 0x01, ///< 1 channel, unsigned 8-bit integers
|
||||
hipResViewFormatUnsignedChar2 = 0x02, ///< 2 channels, unsigned 8-bit integers
|
||||
hipResViewFormatUnsignedChar4 = 0x03, ///< 4 channels, unsigned 8-bit integers
|
||||
hipResViewFormatSignedChar1 = 0x04, ///< 1 channel, signed 8-bit integers
|
||||
hipResViewFormatSignedChar2 = 0x05, ///< 2 channels, signed 8-bit integers
|
||||
hipResViewFormatSignedChar4 = 0x06, ///< 4 channels, signed 8-bit integers
|
||||
hipResViewFormatUnsignedShort1 = 0x07, ///< 1 channel, unsigned 16-bit integers
|
||||
hipResViewFormatUnsignedShort2 = 0x08, ///< 2 channels, unsigned 16-bit integers
|
||||
hipResViewFormatUnsignedShort4 = 0x09, ///< 4 channels, unsigned 16-bit integers
|
||||
hipResViewFormatSignedShort1 = 0x0a, ///< 1 channel, signed 16-bit integers
|
||||
hipResViewFormatSignedShort2 = 0x0b, ///< 2 channels, signed 16-bit integers
|
||||
hipResViewFormatSignedShort4 = 0x0c, ///< 4 channels, signed 16-bit integers
|
||||
hipResViewFormatUnsignedInt1 = 0x0d, ///< 1 channel, unsigned 32-bit integers
|
||||
hipResViewFormatUnsignedInt2 = 0x0e, ///< 2 channels, unsigned 32-bit integers
|
||||
hipResViewFormatUnsignedInt4 = 0x0f, ///< 4 channels, unsigned 32-bit integers
|
||||
hipResViewFormatSignedInt1 = 0x10, ///< 1 channel, signed 32-bit integers
|
||||
hipResViewFormatSignedInt2 = 0x11, ///< 2 channels, signed 32-bit integers
|
||||
hipResViewFormatSignedInt4 = 0x12, ///< 4 channels, signed 32-bit integers
|
||||
hipResViewFormatHalf1 = 0x13, ///< 1 channel, 16-bit floating point
|
||||
hipResViewFormatHalf2 = 0x14, ///< 2 channels, 16-bit floating point
|
||||
hipResViewFormatHalf4 = 0x15, ///< 4 channels, 16-bit floating point
|
||||
hipResViewFormatFloat1 = 0x16, ///< 1 channel, 32-bit floating point
|
||||
hipResViewFormatFloat2 = 0x17, ///< 2 channels, 32-bit floating point
|
||||
hipResViewFormatFloat4 = 0x18, ///< 4 channels, 32-bit floating point
|
||||
hipResViewFormatUnsignedBlockCompressed1 = 0x19, ///< Block-compressed 1
|
||||
hipResViewFormatUnsignedBlockCompressed2 = 0x1a, ///< Block-compressed 2
|
||||
hipResViewFormatUnsignedBlockCompressed3 = 0x1b, ///< Block-compressed 3
|
||||
hipResViewFormatUnsignedBlockCompressed4 = 0x1c, ///< Block-compressed 4 unsigned
|
||||
hipResViewFormatSignedBlockCompressed4 = 0x1d, ///< Block-compressed 4 signed
|
||||
hipResViewFormatUnsignedBlockCompressed5 = 0x1e, ///< Block-compressed 5 unsigned
|
||||
hipResViewFormatSignedBlockCompressed5 = 0x1f, ///< Block-compressed 5 signed
|
||||
hipResViewFormatUnsignedBlockCompressed6H = 0x20, ///< Block-compressed 6 unsigned half-float
|
||||
hipResViewFormatSignedBlockCompressed6H = 0x21, ///< Block-compressed 6 signed half-float
|
||||
hipResViewFormatUnsignedBlockCompressed7 = 0x22 ///< Block-compressed 7
|
||||
hipResViewFormatNone = 0x00, ///< No resource view format (use underlying resource format)
|
||||
hipResViewFormatUnsignedChar1 = 0x01, ///< 1 channel, unsigned 8-bit integers
|
||||
hipResViewFormatUnsignedChar2 = 0x02, ///< 2 channels, unsigned 8-bit integers
|
||||
hipResViewFormatUnsignedChar4 = 0x03, ///< 4 channels, unsigned 8-bit integers
|
||||
hipResViewFormatSignedChar1 = 0x04, ///< 1 channel, signed 8-bit integers
|
||||
hipResViewFormatSignedChar2 = 0x05, ///< 2 channels, signed 8-bit integers
|
||||
hipResViewFormatSignedChar4 = 0x06, ///< 4 channels, signed 8-bit integers
|
||||
hipResViewFormatUnsignedShort1 = 0x07, ///< 1 channel, unsigned 16-bit integers
|
||||
hipResViewFormatUnsignedShort2 = 0x08, ///< 2 channels, unsigned 16-bit integers
|
||||
hipResViewFormatUnsignedShort4 = 0x09, ///< 4 channels, unsigned 16-bit integers
|
||||
hipResViewFormatSignedShort1 = 0x0a, ///< 1 channel, signed 16-bit integers
|
||||
hipResViewFormatSignedShort2 = 0x0b, ///< 2 channels, signed 16-bit integers
|
||||
hipResViewFormatSignedShort4 = 0x0c, ///< 4 channels, signed 16-bit integers
|
||||
hipResViewFormatUnsignedInt1 = 0x0d, ///< 1 channel, unsigned 32-bit integers
|
||||
hipResViewFormatUnsignedInt2 = 0x0e, ///< 2 channels, unsigned 32-bit integers
|
||||
hipResViewFormatUnsignedInt4 = 0x0f, ///< 4 channels, unsigned 32-bit integers
|
||||
hipResViewFormatSignedInt1 = 0x10, ///< 1 channel, signed 32-bit integers
|
||||
hipResViewFormatSignedInt2 = 0x11, ///< 2 channels, signed 32-bit integers
|
||||
hipResViewFormatSignedInt4 = 0x12, ///< 4 channels, signed 32-bit integers
|
||||
hipResViewFormatHalf1 = 0x13, ///< 1 channel, 16-bit floating point
|
||||
hipResViewFormatHalf2 = 0x14, ///< 2 channels, 16-bit floating point
|
||||
hipResViewFormatHalf4 = 0x15, ///< 4 channels, 16-bit floating point
|
||||
hipResViewFormatFloat1 = 0x16, ///< 1 channel, 32-bit floating point
|
||||
hipResViewFormatFloat2 = 0x17, ///< 2 channels, 32-bit floating point
|
||||
hipResViewFormatFloat4 = 0x18, ///< 4 channels, 32-bit floating point
|
||||
hipResViewFormatUnsignedBlockCompressed1 = 0x19, ///< Block-compressed 1
|
||||
hipResViewFormatUnsignedBlockCompressed2 = 0x1a, ///< Block-compressed 2
|
||||
hipResViewFormatUnsignedBlockCompressed3 = 0x1b, ///< Block-compressed 3
|
||||
hipResViewFormatUnsignedBlockCompressed4 = 0x1c, ///< Block-compressed 4 unsigned
|
||||
hipResViewFormatSignedBlockCompressed4 = 0x1d, ///< Block-compressed 4 signed
|
||||
hipResViewFormatUnsignedBlockCompressed5 = 0x1e, ///< Block-compressed 5 unsigned
|
||||
hipResViewFormatSignedBlockCompressed5 = 0x1f, ///< Block-compressed 5 signed
|
||||
hipResViewFormatUnsignedBlockCompressed6H = 0x20, ///< Block-compressed 6 unsigned half-float
|
||||
hipResViewFormatSignedBlockCompressed6H = 0x21, ///< Block-compressed 6 signed half-float
|
||||
hipResViewFormatUnsignedBlockCompressed7 = 0x22 ///< Block-compressed 7
|
||||
} hipResourceViewFormat;
|
||||
/**
|
||||
* HIP texture resource view formats
|
||||
*/
|
||||
typedef enum HIPresourceViewFormat_enum {
|
||||
HIP_RES_VIEW_FORMAT_NONE = 0x00, ///< No resource view format (use underlying resource format)
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X8 = 0x01, ///< 1 channel, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X8 = 0x02, ///< 2 channels, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X8 = 0x03, ///< 4 channels, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X8 = 0x04, ///< 1 channel, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X8 = 0x05, ///< 2 channels, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X8 = 0x06, ///< 4 channels, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X16 = 0x07, ///< 1 channel, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X16 = 0x08, ///< 2 channels, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X16 = 0x09, ///< 4 channels, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X16 = 0x0a, ///< 1 channel, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X16 = 0x0b, ///< 2 channels, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X16 = 0x0c, ///< 4 channels, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X32 = 0x0d, ///< 1 channel, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X32 = 0x0e, ///< 2 channels, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X32 = 0x0f, ///< 4 channels, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X32 = 0x10, ///< 1 channel, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X32 = 0x11, ///< 2 channels, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X32 = 0x12, ///< 4 channels, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13, ///< 1 channel, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14, ///< 2 channels, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15, ///< 4 channels, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16, ///< 1 channel, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17, ///< 2 channels, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18, ///< 4 channels, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19, ///< Block-compressed 1
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a, ///< Block-compressed 2
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b, ///< Block-compressed 3
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c, ///< Block-compressed 4 unsigned
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d, ///< Block-compressed 4 signed
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e, ///< Block-compressed 5 unsigned
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f, ///< Block-compressed 5 signed
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20, ///< Block-compressed 6 unsigned half-float
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21, ///< Block-compressed 6 signed half-float
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22 ///< Block-compressed 7
|
||||
HIP_RES_VIEW_FORMAT_NONE = 0x00, ///< No resource view format (use underlying resource format)
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X8 = 0x01, ///< 1 channel, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X8 = 0x02, ///< 2 channels, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X8 = 0x03, ///< 4 channels, unsigned 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X8 = 0x04, ///< 1 channel, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X8 = 0x05, ///< 2 channels, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X8 = 0x06, ///< 4 channels, signed 8-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X16 = 0x07, ///< 1 channel, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X16 = 0x08, ///< 2 channels, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X16 = 0x09, ///< 4 channels, unsigned 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X16 = 0x0a, ///< 1 channel, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X16 = 0x0b, ///< 2 channels, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X16 = 0x0c, ///< 4 channels, signed 16-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_1X32 = 0x0d, ///< 1 channel, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_2X32 = 0x0e, ///< 2 channels, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_UINT_4X32 = 0x0f, ///< 4 channels, unsigned 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_1X32 = 0x10, ///< 1 channel, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_2X32 = 0x11, ///< 2 channels, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_SINT_4X32 = 0x12, ///< 4 channels, signed 32-bit integers
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13, ///< 1 channel, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14, ///< 2 channels, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15, ///< 4 channels, 16-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16, ///< 1 channel, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17, ///< 2 channels, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18, ///< 4 channels, 32-bit floating point
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19, ///< Block-compressed 1
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a, ///< Block-compressed 2
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b, ///< Block-compressed 3
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c, ///< Block-compressed 4 unsigned
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d, ///< Block-compressed 4 signed
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e, ///< Block-compressed 5 unsigned
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f, ///< Block-compressed 5 signed
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20, ///< Block-compressed 6 unsigned half-float
|
||||
HIP_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21, ///< Block-compressed 6 signed half-float
|
||||
HIP_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22 ///< Block-compressed 7
|
||||
} HIPresourceViewFormat;
|
||||
/**
|
||||
* HIP resource descriptor
|
||||
*/
|
||||
typedef struct hipResourceDesc {
|
||||
enum hipResourceType resType; ///< Resource type
|
||||
union {
|
||||
struct {
|
||||
hipArray_t array; ///< HIP array
|
||||
} array;
|
||||
struct {
|
||||
hipMipmappedArray_t mipmap; ///< HIP mipmapped array
|
||||
} mipmap;
|
||||
struct {
|
||||
void* devPtr; ///< Device pointer
|
||||
struct hipChannelFormatDesc desc; ///< Channel format description
|
||||
size_t sizeInBytes; ///< Size in bytes
|
||||
} linear;
|
||||
struct {
|
||||
void* devPtr; ///< Device pointer
|
||||
struct hipChannelFormatDesc desc; ///< Channel format description
|
||||
size_t width; ///< Width of the array in elements
|
||||
size_t height; ///< Height of the array in elements
|
||||
size_t pitchInBytes; ///< Pitch between two rows in bytes
|
||||
} pitch2D;
|
||||
} res;
|
||||
enum hipResourceType resType; ///< Resource type
|
||||
union {
|
||||
struct {
|
||||
hipArray_t array; ///< HIP array
|
||||
} array;
|
||||
struct {
|
||||
hipMipmappedArray_t mipmap; ///< HIP mipmapped array
|
||||
} mipmap;
|
||||
struct {
|
||||
void* devPtr; ///< Device pointer
|
||||
struct hipChannelFormatDesc desc; ///< Channel format description
|
||||
size_t sizeInBytes; ///< Size in bytes
|
||||
} linear;
|
||||
struct {
|
||||
void* devPtr; ///< Device pointer
|
||||
struct hipChannelFormatDesc desc; ///< Channel format description
|
||||
size_t width; ///< Width of the array in elements
|
||||
size_t height; ///< Height of the array in elements
|
||||
size_t pitchInBytes; ///< Pitch between two rows in bytes
|
||||
} pitch2D;
|
||||
} res;
|
||||
} hipResourceDesc;
|
||||
|
||||
/**
|
||||
* HIP resource view descriptor struct
|
||||
*/
|
||||
typedef struct HIP_RESOURCE_DESC_st {
|
||||
HIPresourcetype resType; ///< Resource type
|
||||
union {
|
||||
struct {
|
||||
hipArray_t hArray; ///< HIP array
|
||||
} array;
|
||||
struct {
|
||||
hipMipmappedArray_t hMipmappedArray; ///< HIP mipmapped array
|
||||
} mipmap;
|
||||
struct {
|
||||
hipDeviceptr_t devPtr; ///< Device pointer
|
||||
hipArray_Format format; ///< Array format
|
||||
unsigned int numChannels; ///< Channels per array element
|
||||
size_t sizeInBytes; ///< Size in bytes
|
||||
} linear;
|
||||
struct {
|
||||
hipDeviceptr_t devPtr; ///< Device pointer
|
||||
hipArray_Format format; ///< Array format
|
||||
unsigned int numChannels; ///< Channels per array element
|
||||
size_t width; ///< Width of the array in elements
|
||||
size_t height; ///< Height of the array in elements
|
||||
size_t pitchInBytes; ///< Pitch between two rows in bytes
|
||||
} pitch2D;
|
||||
struct {
|
||||
int reserved[32];
|
||||
} reserved;
|
||||
} res;
|
||||
unsigned int flags; ///< Flags (must be zero)
|
||||
HIPresourcetype resType; ///< Resource type
|
||||
union {
|
||||
struct {
|
||||
hipArray_t hArray; ///< HIP array
|
||||
} array;
|
||||
struct {
|
||||
hipMipmappedArray_t hMipmappedArray; ///< HIP mipmapped array
|
||||
} mipmap;
|
||||
struct {
|
||||
hipDeviceptr_t devPtr; ///< Device pointer
|
||||
hipArray_Format format; ///< Array format
|
||||
unsigned int numChannels; ///< Channels per array element
|
||||
size_t sizeInBytes; ///< Size in bytes
|
||||
} linear;
|
||||
struct {
|
||||
hipDeviceptr_t devPtr; ///< Device pointer
|
||||
hipArray_Format format; ///< Array format
|
||||
unsigned int numChannels; ///< Channels per array element
|
||||
size_t width; ///< Width of the array in elements
|
||||
size_t height; ///< Height of the array in elements
|
||||
size_t pitchInBytes; ///< Pitch between two rows in bytes
|
||||
} pitch2D;
|
||||
struct {
|
||||
int reserved[32];
|
||||
} reserved;
|
||||
} res;
|
||||
unsigned int flags; ///< Flags (must be zero)
|
||||
} HIP_RESOURCE_DESC;
|
||||
/**
|
||||
* HIP resource view descriptor
|
||||
*/
|
||||
struct hipResourceViewDesc {
|
||||
enum hipResourceViewFormat format; ///< Resource view format
|
||||
size_t width; ///< Width of the resource view
|
||||
size_t height; ///< Height of the resource view
|
||||
size_t depth; ///< Depth of the resource view
|
||||
unsigned int firstMipmapLevel; ///< First defined mipmap level
|
||||
unsigned int lastMipmapLevel; ///< Last defined mipmap level
|
||||
unsigned int firstLayer; ///< First layer index
|
||||
unsigned int lastLayer; ///< Last layer index
|
||||
enum hipResourceViewFormat format; ///< Resource view format
|
||||
size_t width; ///< Width of the resource view
|
||||
size_t height; ///< Height of the resource view
|
||||
size_t depth; ///< Depth of the resource view
|
||||
unsigned int firstMipmapLevel; ///< First defined mipmap level
|
||||
unsigned int lastMipmapLevel; ///< Last defined mipmap level
|
||||
unsigned int firstLayer; ///< First layer index
|
||||
unsigned int lastLayer; ///< Last layer index
|
||||
};
|
||||
/**
|
||||
* Resource view descriptor
|
||||
*/
|
||||
typedef struct HIP_RESOURCE_VIEW_DESC_st {
|
||||
HIPresourceViewFormat format; ///< Resource view format
|
||||
size_t width; ///< Width of the resource view
|
||||
size_t height; ///< Height of the resource view
|
||||
size_t depth; ///< Depth of the resource view
|
||||
unsigned int firstMipmapLevel; ///< First defined mipmap level
|
||||
unsigned int lastMipmapLevel; ///< Last defined mipmap level
|
||||
unsigned int firstLayer; ///< First layer index
|
||||
unsigned int lastLayer; ///< Last layer index
|
||||
unsigned int reserved[16];
|
||||
HIPresourceViewFormat format; ///< Resource view format
|
||||
size_t width; ///< Width of the resource view
|
||||
size_t height; ///< Height of the resource view
|
||||
size_t depth; ///< Depth of the resource view
|
||||
unsigned int firstMipmapLevel; ///< First defined mipmap level
|
||||
unsigned int lastMipmapLevel; ///< Last defined mipmap level
|
||||
unsigned int firstLayer; ///< First layer index
|
||||
unsigned int lastLayer; ///< Last layer index
|
||||
unsigned int reserved[16];
|
||||
} HIP_RESOURCE_VIEW_DESC;
|
||||
/**
|
||||
* Memory copy types
|
||||
*/
|
||||
#if !defined(__HIPCC_RTC__)
|
||||
typedef enum hipMemcpyKind {
|
||||
hipMemcpyHostToHost = 0, ///< Host-to-Host Copy
|
||||
hipMemcpyHostToDevice = 1, ///< Host-to-Device Copy
|
||||
hipMemcpyDeviceToHost = 2, ///< Device-to-Host Copy
|
||||
hipMemcpyDeviceToDevice = 3, ///< Device-to-Device Copy
|
||||
hipMemcpyDefault = 4, ///< Runtime will automatically determine
|
||||
///<copy-kind based on virtual addresses.
|
||||
hipMemcpyDeviceToDeviceNoCU = 1024 ///< Device-to-Device Copy without using compute units
|
||||
hipMemcpyHostToHost = 0, ///< Host-to-Host Copy
|
||||
hipMemcpyHostToDevice = 1, ///< Host-to-Device Copy
|
||||
hipMemcpyDeviceToHost = 2, ///< Device-to-Host Copy
|
||||
hipMemcpyDeviceToDevice = 3, ///< Device-to-Device Copy
|
||||
hipMemcpyDefault = 4, ///< Runtime will automatically determine
|
||||
///< copy-kind based on virtual addresses.
|
||||
hipMemcpyDeviceToDeviceNoCU = 1024 ///< Device-to-Device Copy without using compute units
|
||||
} hipMemcpyKind;
|
||||
/**
|
||||
* HIP pithed pointer
|
||||
*/
|
||||
typedef struct hipPitchedPtr {
|
||||
void* ptr; ///< Pointer to the allocated memory
|
||||
size_t pitch; ///< Pitch in bytes
|
||||
size_t xsize; ///< Logical size of the first dimension of allocation in elements
|
||||
size_t ysize; ///< Logical size of the second dimension of allocation in elements
|
||||
void* ptr; ///< Pointer to the allocated memory
|
||||
size_t pitch; ///< Pitch in bytes
|
||||
size_t xsize; ///< Logical size of the first dimension of allocation in elements
|
||||
size_t ysize; ///< Logical size of the second dimension of allocation in elements
|
||||
} hipPitchedPtr;
|
||||
/**
|
||||
* HIP extent
|
||||
*/
|
||||
typedef struct hipExtent {
|
||||
size_t width; // Width in elements when referring to array memory, in bytes when referring to
|
||||
// linear memory
|
||||
size_t height;
|
||||
size_t depth;
|
||||
size_t width; // Width in elements when referring to array memory, in bytes when referring to
|
||||
// linear memory
|
||||
size_t height;
|
||||
size_t depth;
|
||||
} hipExtent;
|
||||
/**
|
||||
* HIP position
|
||||
*/
|
||||
typedef struct hipPos {
|
||||
size_t x; ///< X coordinate
|
||||
size_t y; ///< Y coordinate
|
||||
size_t z; ///< Z coordinate
|
||||
size_t x; ///< X coordinate
|
||||
size_t y; ///< Y coordinate
|
||||
size_t z; ///< Z coordinate
|
||||
} hipPos;
|
||||
/**
|
||||
* HIP 3D memory copy parameters
|
||||
*/
|
||||
typedef struct hipMemcpy3DParms {
|
||||
hipArray_t srcArray; ///< Source array
|
||||
struct hipPos srcPos; ///< Source position
|
||||
struct hipPitchedPtr srcPtr; ///< Source pointer
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
struct hipPos dstPos; ///< Destination position
|
||||
struct hipPitchedPtr dstPtr; ///< Destination pointer
|
||||
struct hipExtent extent; ///< Extent of 3D memory copy
|
||||
enum hipMemcpyKind kind; ///< Kind of 3D memory copy
|
||||
hipArray_t srcArray; ///< Source array
|
||||
struct hipPos srcPos; ///< Source position
|
||||
struct hipPitchedPtr srcPtr; ///< Source pointer
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
struct hipPos dstPos; ///< Destination position
|
||||
struct hipPitchedPtr dstPtr; ///< Destination pointer
|
||||
struct hipExtent extent; ///< Extent of 3D memory copy
|
||||
enum hipMemcpyKind kind; ///< Kind of 3D memory copy
|
||||
} hipMemcpy3DParms;
|
||||
/**
|
||||
* HIP 3D memory copy
|
||||
*/
|
||||
typedef struct HIP_MEMCPY3D {
|
||||
size_t srcXInBytes; ///< Source X in bytes
|
||||
size_t srcY; ///< Source Y
|
||||
size_t srcZ; ///< Source Z
|
||||
size_t srcLOD; ///< Source LOD
|
||||
hipMemoryType srcMemoryType; ///< Source memory type
|
||||
const void* srcHost; ///< Source host pointer
|
||||
hipDeviceptr_t srcDevice; ///< Source device
|
||||
hipArray_t srcArray; ///< Source array
|
||||
size_t srcPitch; ///< Source pitch
|
||||
size_t srcHeight; ///< Source height
|
||||
size_t dstXInBytes; ///< Destination X in bytes
|
||||
size_t dstY; ///< Destination Y
|
||||
size_t dstZ; ///< Destination Z
|
||||
size_t dstLOD; ///< Destination LOD
|
||||
hipMemoryType dstMemoryType; ///< Destination memory type
|
||||
void* dstHost; ///< Destination host pointer
|
||||
hipDeviceptr_t dstDevice; ///< Destination device
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
size_t dstPitch; ///< Destination pitch
|
||||
size_t dstHeight; ///< Destination height
|
||||
size_t WidthInBytes; ///< Width in bytes of 3D memory copy
|
||||
size_t Height; ///< Height in bytes of 3D memory copy
|
||||
size_t Depth; ///< Depth in bytes of 3D memory copy
|
||||
size_t srcXInBytes; ///< Source X in bytes
|
||||
size_t srcY; ///< Source Y
|
||||
size_t srcZ; ///< Source Z
|
||||
size_t srcLOD; ///< Source LOD
|
||||
hipMemoryType srcMemoryType; ///< Source memory type
|
||||
const void* srcHost; ///< Source host pointer
|
||||
hipDeviceptr_t srcDevice; ///< Source device
|
||||
hipArray_t srcArray; ///< Source array
|
||||
size_t srcPitch; ///< Source pitch
|
||||
size_t srcHeight; ///< Source height
|
||||
size_t dstXInBytes; ///< Destination X in bytes
|
||||
size_t dstY; ///< Destination Y
|
||||
size_t dstZ; ///< Destination Z
|
||||
size_t dstLOD; ///< Destination LOD
|
||||
hipMemoryType dstMemoryType; ///< Destination memory type
|
||||
void* dstHost; ///< Destination host pointer
|
||||
hipDeviceptr_t dstDevice; ///< Destination device
|
||||
hipArray_t dstArray; ///< Destination array
|
||||
size_t dstPitch; ///< Destination pitch
|
||||
size_t dstHeight; ///< Destination height
|
||||
size_t WidthInBytes; ///< Width in bytes of 3D memory copy
|
||||
size_t Height; ///< Height in bytes of 3D memory copy
|
||||
size_t Depth; ///< Depth in bytes of 3D memory copy
|
||||
} HIP_MEMCPY3D;
|
||||
/**
|
||||
* Specifies the type of location
|
||||
*/
|
||||
typedef enum hipMemLocationType {
|
||||
hipMemLocationTypeInvalid = 0,
|
||||
hipMemLocationTypeNone = 0,
|
||||
hipMemLocationTypeDevice = 1, ///< Device location, thus it's HIP device ID
|
||||
hipMemLocationTypeHost = 2, ///< Host location, id is ignored
|
||||
hipMemLocationTypeHostNuma = 3, ///< Host NUMA node location, id is host NUMA node id
|
||||
hipMemLocationTypeHostNumaCurrent = 4 ///< Host NUMA node closest to current thread’s CPU, id is ignored
|
||||
hipMemLocationTypeInvalid = 0,
|
||||
hipMemLocationTypeNone = 0,
|
||||
hipMemLocationTypeDevice = 1, ///< Device location, thus it's HIP device ID
|
||||
hipMemLocationTypeHost = 2, ///< Host location, id is ignored
|
||||
hipMemLocationTypeHostNuma = 3, ///< Host NUMA node location, id is host NUMA node id
|
||||
hipMemLocationTypeHostNumaCurrent =
|
||||
4 ///< Host NUMA node closest to current thread’s CPU, id is ignored
|
||||
} hipMemLocationType;
|
||||
/**
|
||||
* Specifies a memory location.
|
||||
@@ -462,37 +464,42 @@ typedef enum hipMemLocationType {
|
||||
* To specify a gpu, set type = @p hipMemLocationTypeDevice and set id = the gpu's device ID
|
||||
*/
|
||||
typedef struct hipMemLocation {
|
||||
hipMemLocationType type; ///< Specifies the location type, which describes the meaning of id
|
||||
int id; ///< Identifier for the provided location type @p hipMemLocationType
|
||||
hipMemLocationType type; ///< Specifies the location type, which describes the meaning of id
|
||||
int id; ///< Identifier for the provided location type @p hipMemLocationType
|
||||
} hipMemLocation;
|
||||
|
||||
/**
|
||||
* Flags to specify for copies within a batch. Used with hipMemcpyBatchAsync
|
||||
*/
|
||||
typedef enum hipMemcpyFlags {
|
||||
hipMemcpyFlagDefault = 0x0, ///< Default flag
|
||||
hipMemcpyFlagPreferOverlapWithCompute = 0x1 ///< Tries to overlap copy with compute work.
|
||||
hipMemcpyFlagDefault = 0x0, ///< Default flag
|
||||
hipMemcpyFlagPreferOverlapWithCompute = 0x1 ///< Tries to overlap copy with compute work.
|
||||
} hipMemcpyFlags;
|
||||
|
||||
/**
|
||||
* Flags to specify order in which source pointer is accessed by Batch memcpy
|
||||
*/
|
||||
typedef enum hipMemcpySrcAccessOrder {
|
||||
hipMemcpySrcAccessOrderInvalid = 0x0, ///< Default Invalid.
|
||||
hipMemcpySrcAccessOrderStream = 0x1, ///< Access to source pointer must be in stream order.
|
||||
hipMemcpySrcAccessOrderDuringApiCall = 0x2, ///< Access to source pointer can be out of stream order and all accesses must be complete before API call returns.
|
||||
hipMemcpySrcAccessOrderAny = 0x3, ///< Access to the source pointer can be out of stream order and the accesses can happen even after the API call return.
|
||||
hipMemcpySrcAccessOrderMax = 0x7FFFFFFF
|
||||
hipMemcpySrcAccessOrderInvalid = 0x0, ///< Default Invalid.
|
||||
hipMemcpySrcAccessOrderStream = 0x1, ///< Access to source pointer must be in stream order.
|
||||
hipMemcpySrcAccessOrderDuringApiCall =
|
||||
0x2, ///< Access to source pointer can be out of stream order and all accesses must be
|
||||
///< complete before API call returns.
|
||||
hipMemcpySrcAccessOrderAny =
|
||||
0x3, ///< Access to the source pointer can be out of stream order and the accesses can happen
|
||||
///< even after the API call return.
|
||||
hipMemcpySrcAccessOrderMax = 0x7FFFFFFF
|
||||
} hipMemcpySrcAccessOrder;
|
||||
|
||||
/**
|
||||
* Attributes for copies within a batch.
|
||||
*/
|
||||
typedef struct hipMemcpyAttributes {
|
||||
hipMemcpySrcAccessOrder srcAccessOrder; ///< Source access ordering to be observed for copies with this attribute.
|
||||
hipMemLocation srcLocHint; ///< Location hint for src operand.
|
||||
hipMemLocation dstLocHint; ///< Location hint for destination operand.
|
||||
unsigned int flags; ///< Additional Flags for copies. See hipMemcpyFlags.
|
||||
hipMemcpySrcAccessOrder
|
||||
srcAccessOrder; ///< Source access ordering to be observed for copies with this attribute.
|
||||
hipMemLocation srcLocHint; ///< Location hint for src operand.
|
||||
hipMemLocation dstLocHint; ///< Location hint for destination operand.
|
||||
unsigned int flags; ///< Additional Flags for copies. See hipMemcpyFlags.
|
||||
} hipMemcpyAttributes;
|
||||
/**
|
||||
* Operand types for individual copies within a batch
|
||||
@@ -507,51 +514,50 @@ typedef enum hipMemcpy3DOperandType {
|
||||
* Struct representing offset into a hipArray_t in elements.
|
||||
*/
|
||||
typedef struct hipOffset3D {
|
||||
size_t x;
|
||||
size_t y;
|
||||
size_t z;
|
||||
size_t x;
|
||||
size_t y;
|
||||
size_t z;
|
||||
} hipOffset3D;
|
||||
/**
|
||||
* Struct representing an operand for copy with hipMemcpy3DBatchAsync.
|
||||
*/
|
||||
typedef struct hipMemcpy3DOperand {
|
||||
hipMemcpy3DOperandType type;
|
||||
union {
|
||||
struct {
|
||||
void *ptr;
|
||||
size_t rowLength; ///< Length of each row in elements.
|
||||
size_t layerHeight; ///< Height of each layer in elements.
|
||||
hipMemLocation locHint; ///< Location Hint for the operand.
|
||||
} ptr;
|
||||
struct {
|
||||
hipArray_t array; ///< Array struct for hipMemcpyOperandTypeArray.
|
||||
hipOffset3D offset; ///< Offset into array in elements.
|
||||
} array;
|
||||
} op;
|
||||
hipMemcpy3DOperandType type;
|
||||
union {
|
||||
struct {
|
||||
void* ptr;
|
||||
size_t rowLength; ///< Length of each row in elements.
|
||||
size_t layerHeight; ///< Height of each layer in elements.
|
||||
hipMemLocation locHint; ///< Location Hint for the operand.
|
||||
} ptr;
|
||||
struct {
|
||||
hipArray_t array; ///< Array struct for hipMemcpyOperandTypeArray.
|
||||
hipOffset3D offset; ///< Offset into array in elements.
|
||||
} array;
|
||||
} op;
|
||||
} hipMemcpy3DOperand;
|
||||
|
||||
/**
|
||||
* HIP 3D Batch Op
|
||||
*/
|
||||
typedef struct hipMemcpy3DBatchOp {
|
||||
hipMemcpy3DOperand src;
|
||||
hipMemcpy3DOperand dst;
|
||||
hipExtent extent;
|
||||
hipMemcpySrcAccessOrder srcAccessOrder;
|
||||
unsigned int flags;
|
||||
hipMemcpy3DOperand src;
|
||||
hipMemcpy3DOperand dst;
|
||||
hipExtent extent;
|
||||
hipMemcpySrcAccessOrder srcAccessOrder;
|
||||
unsigned int flags;
|
||||
} hipMemcpy3DBatchOp;
|
||||
|
||||
typedef struct hipMemcpy3DPeerParms
|
||||
{
|
||||
hipArray_t srcArray; ///< Source memory address
|
||||
hipPos srcPos; ///< Source position offset
|
||||
hipPitchedPtr srcPtr; ///< Pitched source memory address
|
||||
int srcDevice; ///< Source device
|
||||
hipArray_t dstArray; ///< Destination memory address
|
||||
hipPos dstPos; ///< Destination position offset
|
||||
hipPitchedPtr dstPtr; ///< Pitched destination memory address
|
||||
int dstDevice; ///< Destination device
|
||||
hipExtent extent; ///< Requested memory copy size
|
||||
typedef struct hipMemcpy3DPeerParms {
|
||||
hipArray_t srcArray; ///< Source memory address
|
||||
hipPos srcPos; ///< Source position offset
|
||||
hipPitchedPtr srcPtr; ///< Pitched source memory address
|
||||
int srcDevice; ///< Source device
|
||||
hipArray_t dstArray; ///< Destination memory address
|
||||
hipPos dstPos; ///< Destination position offset
|
||||
hipPitchedPtr dstPtr; ///< Pitched destination memory address
|
||||
int dstDevice; ///< Destination device
|
||||
hipExtent extent; ///< Requested memory copy size
|
||||
} hipMemcpy3DPeerParms;
|
||||
|
||||
/**
|
||||
@@ -564,14 +570,13 @@ typedef struct hipMemcpy3DPeerParms
|
||||
*
|
||||
* @returns The created hipPitchedPtr
|
||||
*/
|
||||
static inline struct hipPitchedPtr make_hipPitchedPtr(void* d, size_t p, size_t xsz,
|
||||
size_t ysz) {
|
||||
struct hipPitchedPtr s;
|
||||
s.ptr = d;
|
||||
s.pitch = p;
|
||||
s.xsize = xsz;
|
||||
s.ysize = ysz;
|
||||
return s;
|
||||
static inline struct hipPitchedPtr make_hipPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) {
|
||||
struct hipPitchedPtr s;
|
||||
s.ptr = d;
|
||||
s.pitch = p;
|
||||
s.xsize = xsz;
|
||||
s.ysize = ysz;
|
||||
return s;
|
||||
}
|
||||
/**
|
||||
* @brief Make hipPos struct
|
||||
@@ -583,11 +588,11 @@ static inline struct hipPitchedPtr make_hipPitchedPtr(void* d, size_t p, size_t
|
||||
* @returns The created hipPos struct
|
||||
*/
|
||||
static inline struct hipPos make_hipPos(size_t x, size_t y, size_t z) {
|
||||
struct hipPos p;
|
||||
p.x = x;
|
||||
p.y = y;
|
||||
p.z = z;
|
||||
return p;
|
||||
struct hipPos p;
|
||||
p.x = x;
|
||||
p.y = y;
|
||||
p.z = z;
|
||||
return p;
|
||||
}
|
||||
/**
|
||||
* @brief Make hipExtent struct
|
||||
@@ -599,57 +604,69 @@ static inline struct hipPos make_hipPos(size_t x, size_t y, size_t z) {
|
||||
* @returns The created hipExtent struct
|
||||
*/
|
||||
static inline struct hipExtent make_hipExtent(size_t w, size_t h, size_t d) {
|
||||
struct hipExtent e;
|
||||
e.width = w;
|
||||
e.height = h;
|
||||
e.depth = d;
|
||||
return e;
|
||||
struct hipExtent e;
|
||||
e.width = w;
|
||||
e.height = h;
|
||||
e.depth = d;
|
||||
return e;
|
||||
}
|
||||
typedef enum hipFunction_attribute {
|
||||
HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, ///< The maximum number of threads per block. Depends on function and device.
|
||||
HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, ///< The statically allocated shared memory size in bytes per block required by the function.
|
||||
HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, ///< The user-allocated constant memory by the function in bytes.
|
||||
HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, ///< The local memory usage of each thread by this function in bytes.
|
||||
HIP_FUNC_ATTRIBUTE_NUM_REGS, ///< The number of registers used by each thread of this function.
|
||||
HIP_FUNC_ATTRIBUTE_PTX_VERSION, ///< PTX version
|
||||
HIP_FUNC_ATTRIBUTE_BINARY_VERSION, ///< Binary version
|
||||
HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA, ///< Cache mode
|
||||
HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, ///< The maximum dynamic shared memory per block for this function in bytes.
|
||||
HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, ///< The shared memory carveout preference in percent of the maximum shared memory.
|
||||
HIP_FUNC_ATTRIBUTE_MAX
|
||||
HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, ///< The maximum number of threads per block. Depends
|
||||
///< on function and device.
|
||||
HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, ///< The statically allocated shared memory size in bytes
|
||||
///< per block required by the function.
|
||||
HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, ///< The user-allocated constant memory by the function in
|
||||
///< bytes.
|
||||
HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, ///< The local memory usage of each thread by this function
|
||||
///< in bytes.
|
||||
HIP_FUNC_ATTRIBUTE_NUM_REGS, ///< The number of registers used by each thread of this function.
|
||||
HIP_FUNC_ATTRIBUTE_PTX_VERSION, ///< PTX version
|
||||
HIP_FUNC_ATTRIBUTE_BINARY_VERSION, ///< Binary version
|
||||
HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA, ///< Cache mode
|
||||
HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, ///< The maximum dynamic shared memory per
|
||||
///< block for this function in bytes.
|
||||
HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, ///< The shared memory carveout preference
|
||||
///< in percent of the maximum shared
|
||||
///< memory.
|
||||
HIP_FUNC_ATTRIBUTE_MAX
|
||||
} hipFunction_attribute;
|
||||
|
||||
typedef enum hipPointer_attribute {
|
||||
HIP_POINTER_ATTRIBUTE_CONTEXT = 1, ///< The context on which a pointer was allocated
|
||||
HIP_POINTER_ATTRIBUTE_CONTEXT = 1, ///< The context on which a pointer was allocated
|
||||
///< @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE, ///< memory type describing the location of a pointer
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_POINTER,///< address at which the pointer is allocated on the device
|
||||
HIP_POINTER_ATTRIBUTE_HOST_POINTER, ///< address at which the pointer is allocated on the host
|
||||
HIP_POINTER_ATTRIBUTE_P2P_TOKENS, ///< A pair of tokens for use with Linux kernel interface
|
||||
HIP_POINTER_ATTRIBUTE_MEMORY_TYPE, ///< memory type describing the location of a pointer
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_POINTER, ///< address at which the pointer is allocated on the
|
||||
///< device
|
||||
HIP_POINTER_ATTRIBUTE_HOST_POINTER, ///< address at which the pointer is allocated on the host
|
||||
HIP_POINTER_ATTRIBUTE_P2P_TOKENS, ///< A pair of tokens for use with Linux kernel interface
|
||||
///< @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS, ///< Synchronize every synchronous memory operation
|
||||
HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS, ///< Synchronize every synchronous memory operation
|
||||
///< initiated on this region
|
||||
HIP_POINTER_ATTRIBUTE_BUFFER_ID, ///< Unique ID for an allocated memory region
|
||||
HIP_POINTER_ATTRIBUTE_IS_MANAGED, ///< Indicates if the pointer points to managed memory
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,///< device ordinal of a device on which a pointer
|
||||
HIP_POINTER_ATTRIBUTE_BUFFER_ID, ///< Unique ID for an allocated memory region
|
||||
HIP_POINTER_ATTRIBUTE_IS_MANAGED, ///< Indicates if the pointer points to managed memory
|
||||
HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL, ///< device ordinal of a device on which a pointer
|
||||
///< was allocated or registered
|
||||
HIP_POINTER_ATTRIBUTE_IS_LEGACY_HIP_IPC_CAPABLE, ///< if this pointer maps to an allocation
|
||||
///< that is suitable for hipIpcGetMemHandle
|
||||
///< @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_RANGE_START_ADDR,///< Starting address for this requested pointer
|
||||
HIP_POINTER_ATTRIBUTE_RANGE_SIZE, ///< Size of the address range for this requested pointer
|
||||
HIP_POINTER_ATTRIBUTE_MAPPED, ///< tells if this pointer is in a valid address range
|
||||
///< that is mapped to a backing allocation
|
||||
HIP_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,///< Bitmask of allowed hipmemAllocationHandleType
|
||||
///< for this allocation @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, ///< returns if the memory referenced by
|
||||
///< this pointer can be used with the GPUDirect RDMA API
|
||||
///< @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_ACCESS_FLAGS, ///< Returns the access flags the device associated with
|
||||
///< for the corresponding memory referenced by the ptr
|
||||
HIP_POINTER_ATTRIBUTE_MEMPOOL_HANDLE ///< Returns the mempool handle for the allocation if
|
||||
///< it was allocated from a mempool
|
||||
///< @warning This attribute is not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_IS_LEGACY_HIP_IPC_CAPABLE, ///< if this pointer maps to an allocation
|
||||
///< that is suitable for hipIpcGetMemHandle
|
||||
///< @warning This attribute is not supported in
|
||||
///< HIP
|
||||
HIP_POINTER_ATTRIBUTE_RANGE_START_ADDR, ///< Starting address for this requested pointer
|
||||
HIP_POINTER_ATTRIBUTE_RANGE_SIZE, ///< Size of the address range for this requested pointer
|
||||
HIP_POINTER_ATTRIBUTE_MAPPED, ///< tells if this pointer is in a valid address range
|
||||
///< that is mapped to a backing allocation
|
||||
HIP_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, ///< Bitmask of allowed hipmemAllocationHandleType
|
||||
///< for this allocation @warning This attribute is
|
||||
///< not supported in HIP
|
||||
HIP_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, ///< returns if the memory referenced by
|
||||
///< this pointer can be used with the
|
||||
///< GPUDirect RDMA API
|
||||
///< @warning This attribute is not supported
|
||||
///< in HIP
|
||||
HIP_POINTER_ATTRIBUTE_ACCESS_FLAGS, ///< Returns the access flags the device associated with
|
||||
///< for the corresponding memory referenced by the ptr
|
||||
HIP_POINTER_ATTRIBUTE_MEMPOOL_HANDLE ///< Returns the mempool handle for the allocation if
|
||||
///< it was allocated from a mempool
|
||||
///< @warning This attribute is not supported in HIP
|
||||
} hipPointer_attribute;
|
||||
|
||||
// doxygen end DriverTypes
|
||||
@@ -657,8 +674,8 @@ typedef enum hipPointer_attribute {
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/nvidia_detail/nvidia_hip_bf16.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif // HIP_INCLUDE_HIP_HIP_BF16_H
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#warning "hip_bfloat16.h is not supported on nvidia platform"
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif // _HIP_BFLOAT16_H_
|
||||
|
||||
@@ -55,8 +55,8 @@ THE SOFTWARE.
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define HIP_PUBLIC_API __attribute__ ((visibility ("default")))
|
||||
#define HIP_INTERNAL_EXPORTED_API __attribute__ ((visibility ("default")))
|
||||
#define HIP_PUBLIC_API __attribute__((visibility("default")))
|
||||
#define HIP_INTERNAL_EXPORTED_API __attribute__((visibility("default")))
|
||||
#else
|
||||
#define HIP_PUBLIC_API
|
||||
#define HIP_INTERNAL_EXPORTED_API
|
||||
|
||||
@@ -32,7 +32,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/nvidia_detail/nvidia_hip_complex.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,8 +27,8 @@ THE SOFTWARE.
|
||||
* feature.
|
||||
*/
|
||||
|
||||
#ifndef HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
#define HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
#ifndef HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
#define HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
|
||||
#include <hip/hip_version.h>
|
||||
#include <hip/hip_common.h>
|
||||
@@ -40,7 +40,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/nvidia_detail/nvidia_hip_cooperative_groups.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif // HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
#endif // HIP_INCLUDE_HIP_HIP_COOPERATIVE_GROUP_H
|
||||
|
||||
@@ -49,9 +49,9 @@ THE SOFTWARE.
|
||||
* @param [in] kernelParams pointer to kernel parameters.
|
||||
* @param [in] extra Pointer to kernel arguments. These are passed directly to the kernel and
|
||||
* must be in the memory layout and alignment expected by the kernel.
|
||||
* All passed arguments must be naturally aligned according to their type. The memory address of each
|
||||
* argument should be a multiple of its size in bytes. Please refer to hip_porting_driver_api.md
|
||||
* for sample usage.
|
||||
* All passed arguments must be naturally aligned according to their type. The memory address of
|
||||
* each argument should be a multiple of its size in bytes. Please refer to
|
||||
* hip_porting_driver_api.md for sample usage.
|
||||
* @param [in] startEvent If non-null, specified event will be updated to track the start time of
|
||||
* the kernel launch. The event must be created before calling this API.
|
||||
* @param [in] stopEvent If non-null, specified event will be updated to track the stop time of
|
||||
@@ -68,14 +68,14 @@ THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
HIP_PUBLIC_API
|
||||
extern "C" hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
|
||||
uint32_t localWorkSizeX, uint32_t localWorkSizeY,
|
||||
uint32_t localWorkSizeZ, size_t sharedMemBytes,
|
||||
hipStream_t hStream, void** kernelParams, void** extra,
|
||||
hipEvent_t startEvent __dparm(NULL),
|
||||
hipEvent_t stopEvent __dparm(NULL),
|
||||
uint32_t flags __dparm(0));
|
||||
extern "C" hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
|
||||
uint32_t localWorkSizeX, uint32_t localWorkSizeY,
|
||||
uint32_t localWorkSizeZ, size_t sharedMemBytes,
|
||||
hipStream_t hStream, void** kernelParams,
|
||||
void** extra, hipEvent_t startEvent __dparm(NULL),
|
||||
hipEvent_t stopEvent __dparm(NULL),
|
||||
uint32_t flags __dparm(0));
|
||||
/**
|
||||
* @brief This HIP API is deprecated, please use hipExtModuleLaunchKernel() instead.
|
||||
*
|
||||
@@ -83,12 +83,12 @@ HIP_PUBLIC_API
|
||||
HIP_DEPRECATED("use hipExtModuleLaunchKernel instead")
|
||||
HIP_PUBLIC_API
|
||||
extern "C" hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
|
||||
uint32_t localWorkSizeX, uint32_t localWorkSizeY,
|
||||
uint32_t localWorkSizeZ, size_t sharedMemBytes,
|
||||
hipStream_t hStream, void** kernelParams, void** extra,
|
||||
hipEvent_t startEvent __dparm(NULL),
|
||||
hipEvent_t stopEvent __dparm(NULL));
|
||||
uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
|
||||
uint32_t localWorkSizeX, uint32_t localWorkSizeY,
|
||||
uint32_t localWorkSizeZ, size_t sharedMemBytes,
|
||||
hipStream_t hStream, void** kernelParams,
|
||||
void** extra, hipEvent_t startEvent __dparm(NULL),
|
||||
hipEvent_t stopEvent __dparm(NULL));
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -118,7 +118,8 @@ extern "C" hipError_t hipExtLaunchKernel(const void* function_address, dim3 numB
|
||||
hipEvent_t stopEvent, int flags);
|
||||
|
||||
/**
|
||||
* @brief Launches kernel with dimention parameters and shared memory on stream with templated kernel and arguments.
|
||||
* @brief Launches kernel with dimention parameters and shared memory on stream with templated
|
||||
* kernel and arguments.
|
||||
*
|
||||
* @param [in] kernel Kernel to launch.
|
||||
* @param [in] numBlocks const number of blocks.
|
||||
@@ -141,18 +142,18 @@ inline void hipExtLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& d
|
||||
std::uint32_t sharedMemBytes, hipStream_t stream,
|
||||
hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags,
|
||||
Args... args) {
|
||||
constexpr size_t count = sizeof...(Args);
|
||||
auto tup_ = std::tuple<Args...>{args...};
|
||||
auto tup = validateArgsCountType(kernel, tup_);
|
||||
void* _Args[count];
|
||||
pArgs<0>(tup, _Args);
|
||||
constexpr size_t count = sizeof...(Args);
|
||||
auto tup_ = std::tuple<Args...>{args...};
|
||||
auto tup = validateArgsCountType(kernel, tup_);
|
||||
void* _Args[count];
|
||||
pArgs<0>(tup, _Args);
|
||||
|
||||
auto k = reinterpret_cast<void*>(kernel);
|
||||
hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent,
|
||||
stopEvent, (int)flags);
|
||||
auto k = reinterpret_cast<void*>(kernel);
|
||||
hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent, stopEvent,
|
||||
(int)flags);
|
||||
}
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // defined(__cplusplus)
|
||||
|
||||
// doxygen end AMD-specific features
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,7 @@ THE SOFTWARE.
|
||||
|
||||
#include "cuda_fp16.h"
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,6 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include "hip/nvidia_detail/nvidia_hip_math_constants.h"
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -47,8 +47,8 @@ THE SOFTWARE.
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#endif // __cplusplus
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#endif // __cplusplus
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
|
||||
#include <hip/hip_version.h>
|
||||
#include <hip/hip_common.h>
|
||||
@@ -58,13 +58,13 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/nvidia_detail/nvidia_hip_runtime.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#if !defined(__HIPCC_RTC__)
|
||||
#include <hip/hip_runtime_api.h>
|
||||
#include <hip/library_types.h>
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#include <hip/hip_vector_types.h>
|
||||
|
||||
#endif
|
||||
|
||||
La diferencia del archivo ha sido suprimido porque es demasiado grande
Cargar Diff
@@ -35,7 +35,7 @@ THE SOFTWARE.
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <vector_types.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+125
-102
@@ -48,106 +48,137 @@ extern "C" {
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
/**
|
||||
/**
|
||||
* hiprtc error code
|
||||
*/
|
||||
typedef enum hiprtcResult {
|
||||
HIPRTC_SUCCESS = 0, ///< Success
|
||||
HIPRTC_ERROR_OUT_OF_MEMORY = 1, ///< Out of memory
|
||||
HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2, ///< Failed to create program
|
||||
HIPRTC_ERROR_INVALID_INPUT = 3, ///< Invalid input
|
||||
HIPRTC_ERROR_INVALID_PROGRAM = 4, ///< Invalid program
|
||||
HIPRTC_ERROR_INVALID_OPTION = 5, ///< Invalid option
|
||||
HIPRTC_ERROR_COMPILATION = 6, ///< Compilation error
|
||||
HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7, ///< Failed in builtin operation
|
||||
HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8, ///< No name expression after compilation
|
||||
HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9, ///< No lowered names before compilation
|
||||
HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10, ///< Invalid name expression
|
||||
HIPRTC_ERROR_INTERNAL_ERROR = 11, ///< Internal error
|
||||
HIPRTC_ERROR_LINKING = 100 ///< Error in linking
|
||||
HIPRTC_SUCCESS = 0, ///< Success
|
||||
HIPRTC_ERROR_OUT_OF_MEMORY = 1, ///< Out of memory
|
||||
HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2, ///< Failed to create program
|
||||
HIPRTC_ERROR_INVALID_INPUT = 3, ///< Invalid input
|
||||
HIPRTC_ERROR_INVALID_PROGRAM = 4, ///< Invalid program
|
||||
HIPRTC_ERROR_INVALID_OPTION = 5, ///< Invalid option
|
||||
HIPRTC_ERROR_COMPILATION = 6, ///< Compilation error
|
||||
HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7, ///< Failed in builtin operation
|
||||
HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8, ///< No name expression after compilation
|
||||
HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9, ///< No lowered names before compilation
|
||||
HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10, ///< Invalid name expression
|
||||
HIPRTC_ERROR_INTERNAL_ERROR = 11, ///< Internal error
|
||||
HIPRTC_ERROR_LINKING = 100 ///< Error in linking
|
||||
} hiprtcResult;
|
||||
/**
|
||||
* hiprtc JIT option
|
||||
*/
|
||||
#define hiprtcJIT_option hipJitOption
|
||||
#define HIPRTC_JIT_MAX_REGISTERS hipJitOptionMaxRegisters ///< CUDA Only Maximum registers may be used in a
|
||||
///< thread, passed to compiler
|
||||
#define HIPRTC_JIT_THREADS_PER_BLOCK hipJitOptionThreadsPerBlock ///< CUDA Only Number of thread per block
|
||||
#define HIPRTC_JIT_WALL_TIME hipJitOptionWallTime ///< CUDA Only Value for total wall clock time
|
||||
#define HIPRTC_JIT_INFO_LOG_BUFFER hipJitOptionInfoLogBuffer ///< CUDA Only Pointer to the buffer with
|
||||
///< logged information
|
||||
#define HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES hipJitOptionInfoLogBufferSizeBytes ///< CUDA Only Size of the buffer
|
||||
///< in bytes for logged info
|
||||
#define HIPRTC_JIT_ERROR_LOG_BUFFER hipJitOptionErrorLogBuffer ///< CUDA Only Pointer to the buffer
|
||||
///< with logged error(s)
|
||||
#define HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES hipJitOptionErrorLogBufferSizeBytes ///< CUDA Only Size of the buffer in
|
||||
///< bytes for logged error(s)
|
||||
#define HIPRTC_JIT_OPTIMIZATION_LEVEL hipJitOptionOptimizationLevel ///< Value of optimization level for
|
||||
///< generated codes, acceptable
|
||||
///< options -O0, -O1, -O2, -O3
|
||||
#define HIPRTC_JIT_TARGET_FROM_HIPCONTEXT hipJitOptionTargetFromContext ///< CUDA Only The target context,
|
||||
///< which is the default
|
||||
#define HIPRTC_JIT_TARGET hipJitOptionTarget ///< CUDA Only JIT target
|
||||
#define HIPRTC_JIT_FALLBACK_STRATEGY hipJitOptionFallbackStrategy ///< CUDA Only Fallback strategy
|
||||
#define HIPRTC_JIT_GENERATE_DEBUG_INFO hipJitOptionGenerateDebugInfo ///< CUDA Only Generate debug information
|
||||
#define HIPRTC_JIT_LOG_VERBOSE hipJitOptionLogVerbose ///< CUDA Only Generate log verbose
|
||||
#define HIPRTC_JIT_GENERATE_LINE_INFO hipJitOptionGenerateLineInfo ///< CUDA Only Generate line number information
|
||||
#define HIPRTC_JIT_CACHE_MODE hipJitOptionCacheMode ///< CUDA Only Set cache mode
|
||||
#define HIPRTC_JIT_NEW_SM3X_OPT hipJitOptionSm3xOpt ///< @deprecated CUDA Only New SM3X option.
|
||||
#define HIPRTC_JIT_FAST_COMPILE hipJitOptionFastCompile ///< CUDA Only Set fast compile
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_NAMES hipJitOptionGlobalSymbolNames ///< CUDA Only Array of device symbol names to be
|
||||
///< relocated to the host
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS hipJitOptionGlobalSymbolAddresses ///< CUDA Only Array of host addresses to be
|
||||
///< relocated to the device
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_COUNT hipJitOptionGlobalSymbolCount ///< CUDA Only Number of symbol count.
|
||||
#define HIPRTC_JIT_LTO hipJitOptionLto ///< @deprecated CUDA Only Enable link-time
|
||||
///< optimization for device code
|
||||
#define HIPRTC_JIT_FTZ hipJitOptionFtz ///< @deprecated CUDA Only Set
|
||||
///< single-precision denormals.
|
||||
#define HIPRTC_JIT_PREC_DIV hipJitOptionPrecDiv ///< @deprecated CUDA Only Set
|
||||
///< single-precision floating-point division
|
||||
///< and reciprocals
|
||||
#define HIPRTC_JIT_PREC_SQRT hipJitOptionPrecSqrt ///< @deprecated CUDA Only Set
|
||||
///< single-precision floating-point
|
||||
///< square root
|
||||
#define HIPRTC_JIT_FMA hipJitOptionFma ///< @deprecated CUDA Only Enable
|
||||
///< floating-point multiplies and
|
||||
///< adds/subtracts operations
|
||||
#define HIPRTC_JIT_POSITION_INDEPENDENT_CODE hipJitOptionPositionIndependentCode ///< CUDA Only Generates
|
||||
///< Position Independent code
|
||||
#define HIPRTC_JIT_MIN_CTA_PER_SM hipJitOptionMinCTAPerSM ///< CUDA Only Hints to JIT compiler
|
||||
///< the minimum number of CTAs frin
|
||||
///< kernel's grid to be mapped to SM
|
||||
#define HIPRTC_JIT_MAX_THREADS_PER_BLOCK hipJitOptionMaxThreadsPerBlock ///< CUDA only Maximum number of
|
||||
///< threads in a thread block
|
||||
#define HIPRTC_JIT_OVERRIDE_DIRECT_VALUES hipJitOptionOverrideDirectiveValues ///< CUDA only Override Directive
|
||||
///< Values
|
||||
#define HIPRTC_JIT_NUM_OPTIONS hipJitOptionNumOptions ///< Number of options
|
||||
#define HIPRTC_JIT_IR_TO_ISA_OPT_EXT hipJitOptionIRtoISAOptExt ///< HIP Only Linker options to be
|
||||
///< passed on to compiler
|
||||
#define HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT hipJitOptionIRtoISAOptCountExt ///< HIP Only Count of linker options
|
||||
///< to be passed on to
|
||||
#define HIPRTC_JIT_MAX_REGISTERS \
|
||||
hipJitOptionMaxRegisters ///< CUDA Only Maximum registers may be used in a
|
||||
///< thread, passed to compiler
|
||||
#define HIPRTC_JIT_THREADS_PER_BLOCK \
|
||||
hipJitOptionThreadsPerBlock ///< CUDA Only Number of thread per block
|
||||
#define HIPRTC_JIT_WALL_TIME hipJitOptionWallTime ///< CUDA Only Value for total wall clock time
|
||||
#define HIPRTC_JIT_INFO_LOG_BUFFER \
|
||||
hipJitOptionInfoLogBuffer ///< CUDA Only Pointer to the buffer with
|
||||
///< logged information
|
||||
#define HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES \
|
||||
hipJitOptionInfoLogBufferSizeBytes ///< CUDA Only Size of the buffer
|
||||
///< in bytes for logged info
|
||||
#define HIPRTC_JIT_ERROR_LOG_BUFFER \
|
||||
hipJitOptionErrorLogBuffer ///< CUDA Only Pointer to the buffer
|
||||
///< with logged error(s)
|
||||
#define HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES \
|
||||
hipJitOptionErrorLogBufferSizeBytes ///< CUDA Only Size of the buffer in
|
||||
///< bytes for logged error(s)
|
||||
#define HIPRTC_JIT_OPTIMIZATION_LEVEL \
|
||||
hipJitOptionOptimizationLevel ///< Value of optimization level for
|
||||
///< generated codes, acceptable
|
||||
///< options -O0, -O1, -O2, -O3
|
||||
#define HIPRTC_JIT_TARGET_FROM_HIPCONTEXT \
|
||||
hipJitOptionTargetFromContext ///< CUDA Only The target context,
|
||||
///< which is the default
|
||||
#define HIPRTC_JIT_TARGET hipJitOptionTarget ///< CUDA Only JIT target
|
||||
#define HIPRTC_JIT_FALLBACK_STRATEGY hipJitOptionFallbackStrategy ///< CUDA Only Fallback strategy
|
||||
#define HIPRTC_JIT_GENERATE_DEBUG_INFO \
|
||||
hipJitOptionGenerateDebugInfo ///< CUDA Only Generate debug information
|
||||
#define HIPRTC_JIT_LOG_VERBOSE hipJitOptionLogVerbose ///< CUDA Only Generate log verbose
|
||||
#define HIPRTC_JIT_GENERATE_LINE_INFO \
|
||||
hipJitOptionGenerateLineInfo ///< CUDA Only Generate line number information
|
||||
#define HIPRTC_JIT_CACHE_MODE hipJitOptionCacheMode ///< CUDA Only Set cache mode
|
||||
#define HIPRTC_JIT_NEW_SM3X_OPT hipJitOptionSm3xOpt ///< @deprecated CUDA Only New SM3X option.
|
||||
#define HIPRTC_JIT_FAST_COMPILE hipJitOptionFastCompile ///< CUDA Only Set fast compile
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_NAMES \
|
||||
hipJitOptionGlobalSymbolNames ///< CUDA Only Array of device symbol names to be
|
||||
///< relocated to the host
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS \
|
||||
hipJitOptionGlobalSymbolAddresses ///< CUDA Only Array of host addresses to be
|
||||
///< relocated to the device
|
||||
#define HIPRTC_JIT_GLOBAL_SYMBOL_COUNT \
|
||||
hipJitOptionGlobalSymbolCount ///< CUDA Only Number of symbol count.
|
||||
#define HIPRTC_JIT_LTO \
|
||||
hipJitOptionLto ///< @deprecated CUDA Only Enable link-time
|
||||
///< optimization for device code
|
||||
#define HIPRTC_JIT_FTZ \
|
||||
hipJitOptionFtz ///< @deprecated CUDA Only Set
|
||||
///< single-precision denormals.
|
||||
#define HIPRTC_JIT_PREC_DIV \
|
||||
hipJitOptionPrecDiv ///< @deprecated CUDA Only Set
|
||||
///< single-precision floating-point division
|
||||
///< and reciprocals
|
||||
#define HIPRTC_JIT_PREC_SQRT \
|
||||
hipJitOptionPrecSqrt ///< @deprecated CUDA Only Set
|
||||
///< single-precision floating-point
|
||||
///< square root
|
||||
#define HIPRTC_JIT_FMA \
|
||||
hipJitOptionFma ///< @deprecated CUDA Only Enable
|
||||
///< floating-point multiplies and
|
||||
///< adds/subtracts operations
|
||||
#define HIPRTC_JIT_POSITION_INDEPENDENT_CODE \
|
||||
hipJitOptionPositionIndependentCode ///< CUDA Only Generates
|
||||
///< Position Independent code
|
||||
#define HIPRTC_JIT_MIN_CTA_PER_SM \
|
||||
hipJitOptionMinCTAPerSM ///< CUDA Only Hints to JIT compiler
|
||||
///< the minimum number of CTAs frin
|
||||
///< kernel's grid to be mapped to SM
|
||||
#define HIPRTC_JIT_MAX_THREADS_PER_BLOCK \
|
||||
hipJitOptionMaxThreadsPerBlock ///< CUDA only Maximum number of
|
||||
///< threads in a thread block
|
||||
#define HIPRTC_JIT_OVERRIDE_DIRECT_VALUES \
|
||||
hipJitOptionOverrideDirectiveValues ///< CUDA only Override Directive
|
||||
///< Values
|
||||
#define HIPRTC_JIT_NUM_OPTIONS hipJitOptionNumOptions ///< Number of options
|
||||
#define HIPRTC_JIT_IR_TO_ISA_OPT_EXT \
|
||||
hipJitOptionIRtoISAOptExt ///< HIP Only Linker options to be
|
||||
///< passed on to compiler
|
||||
#define HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT \
|
||||
hipJitOptionIRtoISAOptCountExt ///< HIP Only Count of linker options
|
||||
///< to be passed on to
|
||||
/**
|
||||
* hiprtc JIT input type
|
||||
*/
|
||||
#define hiprtcJITInputType hipJitInputType
|
||||
#define HIPRTC_JIT_INPUT_CUBIN hipJitInputCubin ///< Cuda only Input Cubin
|
||||
#define HIPRTC_JIT_INPUT_PTX hipJitInputPtx ///< Cuda only Input PTX
|
||||
#define HIPRTC_JIT_INPUT_FATBINARY hipJitInputFatBinary ///< Cuda Only Input FAT Binary
|
||||
#define HIPRTC_JIT_INPUT_OBJECT hipJitInputObject ///< Cuda Only Host Object with embedded device code
|
||||
#define HIPRTC_JIT_INPUT_LIBRARY hipJitInputLibrary ///< Cuda Only Archive of Host Objects with embedded device code
|
||||
#define HIPRTC_JIT_INPUT_NVVM hipJitInputNvvm ///< @deprecated CUDA only High Level intermediate code for LTO
|
||||
#define HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES hipJitNumLegacyInputTypes ///< Count of Legacy Input Types
|
||||
#define HIPRTC_JIT_INPUT_LLVM_BITCODE hipJitInputLLVMBitcode ///< HIP Only LLVM Bitcode or IR assembly
|
||||
#define HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE hipJitInputLLVMBundledBitcode ///< HIP Only LLVM Clang Bundled Code
|
||||
#define HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE hipJitInputLLVMArchivesOfBundledBitcode ///< HIP Only LLVM
|
||||
///< Archives of
|
||||
///< Bundled Bitcode
|
||||
#define HIPRTC_JIT_INPUT_CUBIN hipJitInputCubin ///< Cuda only Input Cubin
|
||||
#define HIPRTC_JIT_INPUT_PTX hipJitInputPtx ///< Cuda only Input PTX
|
||||
#define HIPRTC_JIT_INPUT_FATBINARY hipJitInputFatBinary ///< Cuda Only Input FAT Binary
|
||||
#define HIPRTC_JIT_INPUT_OBJECT \
|
||||
hipJitInputObject ///< Cuda Only Host Object with embedded device code
|
||||
#define HIPRTC_JIT_INPUT_LIBRARY \
|
||||
hipJitInputLibrary ///< Cuda Only Archive of Host Objects with embedded device code
|
||||
#define HIPRTC_JIT_INPUT_NVVM \
|
||||
hipJitInputNvvm ///< @deprecated CUDA only High Level intermediate code for LTO
|
||||
#define HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES \
|
||||
hipJitNumLegacyInputTypes ///< Count of Legacy Input Types
|
||||
#define HIPRTC_JIT_INPUT_LLVM_BITCODE \
|
||||
hipJitInputLLVMBitcode ///< HIP Only LLVM Bitcode or IR assembly
|
||||
#define HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE \
|
||||
hipJitInputLLVMBundledBitcode ///< HIP Only LLVM Clang Bundled Code
|
||||
#define HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE \
|
||||
hipJitInputLLVMArchivesOfBundledBitcode ///< HIP Only LLVM
|
||||
///< Archives of
|
||||
///< Bundled Bitcode
|
||||
#define HIPRTC_JIT_INPUT_SPIRV hipJitInputSpirv ///< HIP Only SPIRV Code Object
|
||||
#define HIPRTC_JIT_NUM_INPUT_TYPES hipJitNumInputTypes ///< Count of Input Types
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* hiprtc link state
|
||||
@@ -199,8 +230,7 @@ typedef struct _hiprtcProgram* hiprtcProgram;
|
||||
*
|
||||
* @see hiprtcResult
|
||||
*/
|
||||
hiprtcResult hiprtcAddNameExpression(hiprtcProgram prog,
|
||||
const char* name_expression);
|
||||
hiprtcResult hiprtcAddNameExpression(hiprtcProgram prog, const char* name_expression);
|
||||
|
||||
/**
|
||||
* @ingroup Runtime
|
||||
@@ -216,9 +246,7 @@ hiprtcResult hiprtcAddNameExpression(hiprtcProgram prog,
|
||||
*
|
||||
* @see hiprtcResult
|
||||
*/
|
||||
hiprtcResult hiprtcCompileProgram(hiprtcProgram prog,
|
||||
int numOptions,
|
||||
const char* const* options);
|
||||
hiprtcResult hiprtcCompileProgram(hiprtcProgram prog, int numOptions, const char* const* options);
|
||||
|
||||
/**
|
||||
* @ingroup Runtime
|
||||
@@ -240,11 +268,8 @@ hiprtcResult hiprtcCompileProgram(hiprtcProgram prog,
|
||||
*
|
||||
* @see hiprtcResult
|
||||
*/
|
||||
hiprtcResult hiprtcCreateProgram(hiprtcProgram* prog,
|
||||
const char* src,
|
||||
const char* name,
|
||||
int numHeaders,
|
||||
const char* const* headers,
|
||||
hiprtcResult hiprtcCreateProgram(hiprtcProgram* prog, const char* src, const char* name,
|
||||
int numHeaders, const char* const* headers,
|
||||
const char* const* includeNames);
|
||||
|
||||
/**
|
||||
@@ -260,8 +285,8 @@ hiprtcResult hiprtcCreateProgram(hiprtcProgram* prog,
|
||||
hiprtcResult hiprtcDestroyProgram(hiprtcProgram* prog);
|
||||
|
||||
/**
|
||||
* @brief Gets the lowered (mangled) name from an instance of hiprtcProgram with the given input parameters,
|
||||
* and sets the output lowered_name with it.
|
||||
* @brief Gets the lowered (mangled) name from an instance of hiprtcProgram with the given input
|
||||
* parameters, and sets the output lowered_name with it.
|
||||
* @ingroup Runtime
|
||||
* @param [in] prog runtime compilation program instance.
|
||||
* @param [in] name_expression const char pointer to the name expression.
|
||||
@@ -276,8 +301,7 @@ hiprtcResult hiprtcDestroyProgram(hiprtcProgram* prog);
|
||||
*
|
||||
* @see hiprtcResult
|
||||
*/
|
||||
hiprtcResult hiprtcGetLoweredName(hiprtcProgram prog,
|
||||
const char* name_expression,
|
||||
hiprtcResult hiprtcGetLoweredName(hiprtcProgram prog, const char* name_expression,
|
||||
const char** lowered_name);
|
||||
|
||||
/**
|
||||
@@ -300,8 +324,7 @@ hiprtcResult hiprtcGetProgramLog(hiprtcProgram prog, char* log);
|
||||
*
|
||||
* @see hiprtcResult
|
||||
*/
|
||||
hiprtcResult hiprtcGetProgramLogSize(hiprtcProgram prog,
|
||||
size_t* logSizeRet);
|
||||
hiprtcResult hiprtcGetProgramLogSize(hiprtcProgram prog, size_t* logSizeRet);
|
||||
|
||||
/**
|
||||
* @brief Gets the pointer of compilation binary by the runtime compilation program instance.
|
||||
@@ -446,5 +469,5 @@ hiprtcResult hiprtcLinkDestroy(hiprtcLinkState hip_link_state);
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
@@ -30,40 +30,40 @@ THE SOFTWARE.
|
||||
#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
|
||||
|
||||
typedef enum hipDataType {
|
||||
HIP_R_32F = 0,
|
||||
HIP_R_64F = 1,
|
||||
HIP_R_16F = 2,
|
||||
HIP_R_8I = 3,
|
||||
HIP_C_32F = 4,
|
||||
HIP_C_64F = 5,
|
||||
HIP_C_16F = 6,
|
||||
HIP_C_8I = 7,
|
||||
HIP_R_8U = 8,
|
||||
HIP_C_8U = 9,
|
||||
HIP_R_32I = 10,
|
||||
HIP_C_32I = 11,
|
||||
HIP_R_32U = 12,
|
||||
HIP_C_32U = 13,
|
||||
HIP_R_16BF = 14,
|
||||
HIP_C_16BF = 15,
|
||||
HIP_R_4I = 16,
|
||||
HIP_C_4I = 17,
|
||||
HIP_R_4U = 18,
|
||||
HIP_C_4U = 19,
|
||||
HIP_R_16I = 20,
|
||||
HIP_C_16I = 21,
|
||||
HIP_R_16U = 22,
|
||||
HIP_C_16U = 23,
|
||||
HIP_R_64I = 24,
|
||||
HIP_C_64I = 25,
|
||||
HIP_R_64U = 26,
|
||||
HIP_C_64U = 27,
|
||||
HIP_R_32F = 0,
|
||||
HIP_R_64F = 1,
|
||||
HIP_R_16F = 2,
|
||||
HIP_R_8I = 3,
|
||||
HIP_C_32F = 4,
|
||||
HIP_C_64F = 5,
|
||||
HIP_C_16F = 6,
|
||||
HIP_C_8I = 7,
|
||||
HIP_R_8U = 8,
|
||||
HIP_C_8U = 9,
|
||||
HIP_R_32I = 10,
|
||||
HIP_C_32I = 11,
|
||||
HIP_R_32U = 12,
|
||||
HIP_C_32U = 13,
|
||||
HIP_R_16BF = 14,
|
||||
HIP_C_16BF = 15,
|
||||
HIP_R_4I = 16,
|
||||
HIP_C_4I = 17,
|
||||
HIP_R_4U = 18,
|
||||
HIP_C_4U = 19,
|
||||
HIP_R_16I = 20,
|
||||
HIP_C_16I = 21,
|
||||
HIP_R_16U = 22,
|
||||
HIP_C_16U = 23,
|
||||
HIP_R_64I = 24,
|
||||
HIP_C_64I = 25,
|
||||
HIP_R_64U = 26,
|
||||
HIP_C_64U = 27,
|
||||
HIP_R_8F_E4M3 = 28,
|
||||
HIP_R_8F_E5M2 = 29,
|
||||
HIP_R_8F_UE8M0 = 30,
|
||||
HIP_R_6F_E2M3 = 31,
|
||||
HIP_R_6F_E3M2 = 32,
|
||||
HIP_R_4F_E2M1 = 33,
|
||||
HIP_R_6F_E2M3 = 31,
|
||||
HIP_R_6F_E3M2 = 32,
|
||||
HIP_R_4F_E2M1 = 33,
|
||||
// HIP specific Data Types
|
||||
HIP_R_8F_E4M3_FNUZ = 1000,
|
||||
HIP_R_8F_E5M2_FNUZ = 1001,
|
||||
@@ -78,7 +78,7 @@ typedef enum hipLibraryPropertyType {
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include "library_types.h"
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,77 +45,80 @@ THE SOFTWARE.
|
||||
* hipJitOption
|
||||
*/
|
||||
typedef enum hipJitOption {
|
||||
hipJitOptionMaxRegisters = 0, ///< CUDA Only Maximum registers may be used in a thread,
|
||||
///< passed to compiler
|
||||
hipJitOptionThreadsPerBlock, ///< CUDA Only Number of thread per block
|
||||
hipJitOptionWallTime, ///< CUDA Only Value for total wall clock time
|
||||
hipJitOptionInfoLogBuffer, ///< CUDA Only Pointer to the buffer with logged information
|
||||
hipJitOptionInfoLogBufferSizeBytes, ///< CUDA Only Size of the buffer in bytes for logged info
|
||||
hipJitOptionErrorLogBuffer, ///< CUDA Only Pointer to the buffer with logged error(s)
|
||||
hipJitOptionErrorLogBufferSizeBytes, ///< CUDA Only Size of the buffer in bytes for logged error(s)
|
||||
hipJitOptionOptimizationLevel, ///< Value of optimization level for generated codes, acceptable options
|
||||
///< -O0, -O1, -O2, -O3
|
||||
hipJitOptionTargetFromContext, ///< CUDA Only The target context, which is the default
|
||||
hipJitOptionTarget, ///< CUDA Only JIT target
|
||||
hipJitOptionFallbackStrategy, ///< CUDA Only Fallback strategy
|
||||
hipJitOptionGenerateDebugInfo, ///< CUDA Only Generate debug information
|
||||
hipJitOptionLogVerbose, ///< CUDA Only Generate log verbose
|
||||
hipJitOptionGenerateLineInfo, ///< CUDA Only Generate line number information
|
||||
hipJitOptionCacheMode, ///< CUDA Only Set cache mode
|
||||
hipJitOptionSm3xOpt, ///< @deprecated CUDA Only New SM3X option.
|
||||
hipJitOptionFastCompile, ///< CUDA Only Set fast compile
|
||||
hipJitOptionGlobalSymbolNames, ///< CUDA Only Array of device symbol names to be relocated to the host
|
||||
hipJitOptionGlobalSymbolAddresses, ///< CUDA Only Array of host addresses to be relocated to the device
|
||||
hipJitOptionGlobalSymbolCount, ///< CUDA Only Number of symbol count.
|
||||
hipJitOptionLto, ///< @deprecated CUDA Only Enable link-time optimization for device code
|
||||
hipJitOptionFtz, ///< @deprecated CUDA Only Set single-precision denormals.
|
||||
hipJitOptionPrecDiv, ///< @deprecated CUDA Only Set single-precision floating-point division
|
||||
///< and reciprocals
|
||||
hipJitOptionPrecSqrt, ///< @deprecated CUDA Only Set single-precision floating-point square root
|
||||
hipJitOptionFma, ///< @deprecated CUDA Only Enable floating-point multiplies and
|
||||
///< adds/subtracts operations
|
||||
hipJitOptionPositionIndependentCode, ///< CUDA Only Generates Position Independent code
|
||||
hipJitOptionMinCTAPerSM, ///< CUDA Only Hints to JIT compiler the minimum number of CTAs frin kernel's
|
||||
///< grid to be mapped to SM
|
||||
hipJitOptionMaxThreadsPerBlock, ///< CUDA only Maximum number of threads in a thread block
|
||||
hipJitOptionOverrideDirectiveValues, ///< Cuda only Override Directive values
|
||||
hipJitOptionNumOptions, ///< Number of options
|
||||
hipJitOptionIRtoISAOptExt = 10000, ///< Hip Only Linker options to be passed on to compiler
|
||||
hipJitOptionIRtoISAOptCountExt, ///< Hip Only Count of linker options to be passed on to compiler
|
||||
hipJitOptionMaxRegisters = 0, ///< CUDA Only Maximum registers may be used in a thread,
|
||||
///< passed to compiler
|
||||
hipJitOptionThreadsPerBlock, ///< CUDA Only Number of thread per block
|
||||
hipJitOptionWallTime, ///< CUDA Only Value for total wall clock time
|
||||
hipJitOptionInfoLogBuffer, ///< CUDA Only Pointer to the buffer with logged information
|
||||
hipJitOptionInfoLogBufferSizeBytes, ///< CUDA Only Size of the buffer in bytes for logged info
|
||||
hipJitOptionErrorLogBuffer, ///< CUDA Only Pointer to the buffer with logged error(s)
|
||||
hipJitOptionErrorLogBufferSizeBytes, ///< CUDA Only Size of the buffer in bytes for logged
|
||||
///< error(s)
|
||||
hipJitOptionOptimizationLevel, ///< Value of optimization level for generated codes, acceptable
|
||||
///< options -O0, -O1, -O2, -O3
|
||||
hipJitOptionTargetFromContext, ///< CUDA Only The target context, which is the default
|
||||
hipJitOptionTarget, ///< CUDA Only JIT target
|
||||
hipJitOptionFallbackStrategy, ///< CUDA Only Fallback strategy
|
||||
hipJitOptionGenerateDebugInfo, ///< CUDA Only Generate debug information
|
||||
hipJitOptionLogVerbose, ///< CUDA Only Generate log verbose
|
||||
hipJitOptionGenerateLineInfo, ///< CUDA Only Generate line number information
|
||||
hipJitOptionCacheMode, ///< CUDA Only Set cache mode
|
||||
hipJitOptionSm3xOpt, ///< @deprecated CUDA Only New SM3X option.
|
||||
hipJitOptionFastCompile, ///< CUDA Only Set fast compile
|
||||
hipJitOptionGlobalSymbolNames, ///< CUDA Only Array of device symbol names to be relocated to the
|
||||
///< host
|
||||
hipJitOptionGlobalSymbolAddresses, ///< CUDA Only Array of host addresses to be relocated to the
|
||||
///< device
|
||||
hipJitOptionGlobalSymbolCount, ///< CUDA Only Number of symbol count.
|
||||
hipJitOptionLto, ///< @deprecated CUDA Only Enable link-time optimization for device code
|
||||
hipJitOptionFtz, ///< @deprecated CUDA Only Set single-precision denormals.
|
||||
hipJitOptionPrecDiv, ///< @deprecated CUDA Only Set single-precision floating-point division
|
||||
///< and reciprocals
|
||||
hipJitOptionPrecSqrt, ///< @deprecated CUDA Only Set single-precision floating-point square root
|
||||
hipJitOptionFma, ///< @deprecated CUDA Only Enable floating-point multiplies and
|
||||
///< adds/subtracts operations
|
||||
hipJitOptionPositionIndependentCode, ///< CUDA Only Generates Position Independent code
|
||||
hipJitOptionMinCTAPerSM, ///< CUDA Only Hints to JIT compiler the minimum number of CTAs frin
|
||||
///< kernel's grid to be mapped to SM
|
||||
hipJitOptionMaxThreadsPerBlock, ///< CUDA only Maximum number of threads in a thread block
|
||||
hipJitOptionOverrideDirectiveValues, ///< Cuda only Override Directive values
|
||||
hipJitOptionNumOptions, ///< Number of options
|
||||
hipJitOptionIRtoISAOptExt = 10000, ///< Hip Only Linker options to be passed on to compiler
|
||||
hipJitOptionIRtoISAOptCountExt, ///< Hip Only Count of linker options to be passed on to compiler
|
||||
} hipJitOption;
|
||||
/**
|
||||
* hipJitInputType
|
||||
*/
|
||||
typedef enum hipJitInputType {
|
||||
hipJitInputCubin = 0, ///< Cuda only Input cubin
|
||||
hipJitInputPtx, ///< Cuda only Input PTX
|
||||
hipJitInputFatBinary, ///< Cuda Only Input FAT Binary
|
||||
hipJitInputObject, ///< Cuda Only Host Object with embedded device code
|
||||
hipJitInputLibrary, ///< Cuda Only Archive of Host Objects with embedded
|
||||
///< device code
|
||||
hipJitInputNvvm, ///< @deprecated Cuda only High Level intermediate
|
||||
///< code for LTO
|
||||
hipJitNumLegacyInputTypes, ///< Count of Legacy Input Types
|
||||
hipJitInputLLVMBitcode = 100, ///< HIP Only LLVM Bitcode or IR assembly
|
||||
hipJitInputLLVMBundledBitcode = 101, ///< HIP Only LLVM Clang Bundled Code
|
||||
hipJitInputLLVMArchivesOfBundledBitcode = 102, ///< HIP Only LLVM Archive of Bundled Bitcode
|
||||
hipJitInputSpirv = 103, ///< HIP Only SPIRV Code Object
|
||||
hipJitNumInputTypes = 10 ///< Count of Input Types
|
||||
hipJitInputCubin = 0, ///< Cuda only Input cubin
|
||||
hipJitInputPtx, ///< Cuda only Input PTX
|
||||
hipJitInputFatBinary, ///< Cuda Only Input FAT Binary
|
||||
hipJitInputObject, ///< Cuda Only Host Object with embedded device code
|
||||
hipJitInputLibrary, ///< Cuda Only Archive of Host Objects with embedded
|
||||
///< device code
|
||||
hipJitInputNvvm, ///< @deprecated Cuda only High Level intermediate
|
||||
///< code for LTO
|
||||
hipJitNumLegacyInputTypes, ///< Count of Legacy Input Types
|
||||
hipJitInputLLVMBitcode = 100, ///< HIP Only LLVM Bitcode or IR assembly
|
||||
hipJitInputLLVMBundledBitcode = 101, ///< HIP Only LLVM Clang Bundled Code
|
||||
hipJitInputLLVMArchivesOfBundledBitcode = 102, ///< HIP Only LLVM Archive of Bundled Bitcode
|
||||
hipJitInputSpirv = 103, ///< HIP Only SPIRV Code Object
|
||||
hipJitNumInputTypes = 10 ///< Count of Input Types
|
||||
} hipJitInputType;
|
||||
/**
|
||||
* hipJitCacheMode
|
||||
*/
|
||||
typedef enum hipJitCacheMode {
|
||||
hipJitCacheOptionNone = 0,
|
||||
hipJitCacheOptionCG,
|
||||
hipJitCacheOptionCA
|
||||
hipJitCacheOptionNone = 0,
|
||||
hipJitCacheOptionCG,
|
||||
hipJitCacheOptionCA
|
||||
} hipJitCacheMode;
|
||||
/**
|
||||
* hipJitFallback
|
||||
*/
|
||||
typedef enum hipJitFallback {
|
||||
hipJitPreferPTX = 0,
|
||||
hipJitPreferBinary,
|
||||
hipJitPreferPTX = 0,
|
||||
hipJitPreferBinary,
|
||||
} hipJitFallback;
|
||||
|
||||
// doxygen end LinkerTypes
|
||||
@@ -124,7 +127,7 @@ typedef enum hipJitFallback {
|
||||
*/
|
||||
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif // HIP_INCLUDE_HIP_LINKER_TYPES_H
|
||||
#endif // HIP_INCLUDE_HIP_LINKER_TYPES_H
|
||||
@@ -34,9 +34,9 @@ THE SOFTWARE.
|
||||
#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
|
||||
#include <hip/amd_detail/amd_math_functions.h>
|
||||
#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
|
||||
//#include <hip/nvidia_detail/math_functions.h>
|
||||
// #include <hip/nvidia_detail/math_functions.h>
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,16 +44,16 @@ typedef struct __hip_surface* hipSurfaceObject_t;
|
||||
* hip surface reference
|
||||
*/
|
||||
struct surfaceReference {
|
||||
hipSurfaceObject_t surfaceObject;
|
||||
hipSurfaceObject_t surfaceObject;
|
||||
};
|
||||
|
||||
/**
|
||||
* hip surface boundary modes
|
||||
*/
|
||||
enum hipSurfaceBoundaryMode {
|
||||
hipBoundaryModeZero = 0,
|
||||
hipBoundaryModeTrap = 1,
|
||||
hipBoundaryModeClamp = 2
|
||||
hipBoundaryModeZero = 0,
|
||||
hipBoundaryModeTrap = 1,
|
||||
hipBoundaryModeClamp = 2
|
||||
};
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
@@ -45,7 +45,7 @@ THE SOFTWARE.
|
||||
#if !defined(__HIPCC_RTC__)
|
||||
#include <hip/channel_descriptor.h>
|
||||
#include <hip/driver_types.h>
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
#endif // !defined(__HIPCC_RTC__)
|
||||
|
||||
#define hipTextureType1D 0x01
|
||||
#define hipTextureType2D 0x02
|
||||
@@ -73,10 +73,10 @@ typedef struct __hip_texture* hipTextureObject_t;
|
||||
* hip texture address modes
|
||||
*/
|
||||
enum hipTextureAddressMode {
|
||||
hipAddressModeWrap = 0,
|
||||
hipAddressModeClamp = 1,
|
||||
hipAddressModeMirror = 2,
|
||||
hipAddressModeBorder = 3
|
||||
hipAddressModeWrap = 0,
|
||||
hipAddressModeClamp = 1,
|
||||
hipAddressModeMirror = 2,
|
||||
hipAddressModeBorder = 3
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -93,39 +93,39 @@ enum hipTextureReadMode { hipReadModeElementType = 0, hipReadModeNormalizedFloat
|
||||
* hip texture reference
|
||||
*/
|
||||
typedef struct textureReference {
|
||||
int normalized;
|
||||
enum hipTextureReadMode readMode;// used only for driver API's
|
||||
enum hipTextureFilterMode filterMode;
|
||||
enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions
|
||||
struct hipChannelFormatDesc channelDesc;
|
||||
int sRGB; // Perform sRGB->linear conversion during texture read
|
||||
unsigned int maxAnisotropy; // Limit to the anisotropy ratio
|
||||
enum hipTextureFilterMode mipmapFilterMode;
|
||||
float mipmapLevelBias;
|
||||
float minMipmapLevelClamp;
|
||||
float maxMipmapLevelClamp;
|
||||
int normalized;
|
||||
enum hipTextureReadMode readMode; // used only for driver API's
|
||||
enum hipTextureFilterMode filterMode;
|
||||
enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions
|
||||
struct hipChannelFormatDesc channelDesc;
|
||||
int sRGB; // Perform sRGB->linear conversion during texture read
|
||||
unsigned int maxAnisotropy; // Limit to the anisotropy ratio
|
||||
enum hipTextureFilterMode mipmapFilterMode;
|
||||
float mipmapLevelBias;
|
||||
float minMipmapLevelClamp;
|
||||
float maxMipmapLevelClamp;
|
||||
|
||||
hipTextureObject_t textureObject;
|
||||
int numChannels;
|
||||
enum hipArray_Format format;
|
||||
}textureReference;
|
||||
hipTextureObject_t textureObject;
|
||||
int numChannels;
|
||||
enum hipArray_Format format;
|
||||
} textureReference;
|
||||
|
||||
/**
|
||||
* hip texture descriptor
|
||||
*/
|
||||
typedef struct hipTextureDesc {
|
||||
enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions
|
||||
enum hipTextureFilterMode filterMode;
|
||||
enum hipTextureReadMode readMode;
|
||||
int sRGB; // Perform sRGB->linear conversion during texture read
|
||||
float borderColor[4];
|
||||
int normalizedCoords;
|
||||
unsigned int maxAnisotropy;
|
||||
enum hipTextureFilterMode mipmapFilterMode;
|
||||
float mipmapLevelBias;
|
||||
float minMipmapLevelClamp;
|
||||
float maxMipmapLevelClamp;
|
||||
}hipTextureDesc;
|
||||
enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions
|
||||
enum hipTextureFilterMode filterMode;
|
||||
enum hipTextureReadMode readMode;
|
||||
int sRGB; // Perform sRGB->linear conversion during texture read
|
||||
float borderColor[4];
|
||||
int normalizedCoords;
|
||||
unsigned int maxAnisotropy;
|
||||
enum hipTextureFilterMode mipmapFilterMode;
|
||||
float mipmapLevelBias;
|
||||
float minMipmapLevelClamp;
|
||||
float maxMipmapLevelClamp;
|
||||
} hipTextureDesc;
|
||||
|
||||
#if __cplusplus
|
||||
|
||||
@@ -145,45 +145,45 @@ typedef textureReference* hipTexRef;
|
||||
template <class T, int texType = hipTextureType1D,
|
||||
enum hipTextureReadMode mode = hipReadModeElementType>
|
||||
struct __HIP_TEXTURE_ATTRIB texture : public textureReference {
|
||||
texture(int norm = 0, enum hipTextureFilterMode fMode = hipFilterModePoint,
|
||||
enum hipTextureAddressMode aMode = hipAddressModeClamp) {
|
||||
normalized = norm;
|
||||
readMode = mode;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
addressMode[2] = aMode;
|
||||
channelDesc = hipCreateChannelDesc<T>();
|
||||
sRGB = 0;
|
||||
textureObject = nullptr;
|
||||
maxAnisotropy = 0;
|
||||
mipmapLevelBias = 0;
|
||||
minMipmapLevelClamp = 0;
|
||||
maxMipmapLevelClamp = 0;
|
||||
}
|
||||
texture(int norm = 0, enum hipTextureFilterMode fMode = hipFilterModePoint,
|
||||
enum hipTextureAddressMode aMode = hipAddressModeClamp) {
|
||||
normalized = norm;
|
||||
readMode = mode;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
addressMode[2] = aMode;
|
||||
channelDesc = hipCreateChannelDesc<T>();
|
||||
sRGB = 0;
|
||||
textureObject = nullptr;
|
||||
maxAnisotropy = 0;
|
||||
mipmapLevelBias = 0;
|
||||
minMipmapLevelClamp = 0;
|
||||
maxMipmapLevelClamp = 0;
|
||||
}
|
||||
|
||||
texture(int norm, enum hipTextureFilterMode fMode, enum hipTextureAddressMode aMode,
|
||||
struct hipChannelFormatDesc desc) {
|
||||
normalized = norm;
|
||||
readMode = mode;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
addressMode[2] = aMode;
|
||||
channelDesc = desc;
|
||||
sRGB = 0;
|
||||
textureObject = nullptr;
|
||||
maxAnisotropy = 0;
|
||||
mipmapLevelBias = 0;
|
||||
minMipmapLevelClamp = 0;
|
||||
maxMipmapLevelClamp = 0;
|
||||
}
|
||||
texture(int norm, enum hipTextureFilterMode fMode, enum hipTextureAddressMode aMode,
|
||||
struct hipChannelFormatDesc desc) {
|
||||
normalized = norm;
|
||||
readMode = mode;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
addressMode[2] = aMode;
|
||||
channelDesc = desc;
|
||||
sRGB = 0;
|
||||
textureObject = nullptr;
|
||||
maxAnisotropy = 0;
|
||||
mipmapLevelBias = 0;
|
||||
minMipmapLevelClamp = 0;
|
||||
maxMipmapLevelClamp = 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#else
|
||||
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#error ("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
Referencia en una nueva incidencia
Block a user