Rate This Document
Findability
Accuracy
Completeness
Readability

User-defined Data Types and Ranges

Complex Numbers

Complex numbers in the HMPP are described by the structures that contain two numbers of the respective data type. They are real and imaginary parts of the complex number.

The format is defined as follows:
typedef struct {
    <data_type>  re;
    <data_type>  im;
} Hmpp<type>c;

For details about the mapping between <type> and <data_type>, see Data Types and Ranges in the Standard Library.

The complex number types used in HMPP are defined in hmpp_typebase.h, including Hmpp16sc, Hmpp16uc, Hmpp32sc, Hmpp32fc, Hmpp64sc, Hmpp64fc and Hmpp8sc.

Bool Data Type

It is defined in the form of enumeration (defined in hmpp_typebase.h) as follows:

typedef enum {
    HMPP_FALSE = 0,
    HMPP_TRUE = 1
} HmppBool;

Special Data Types

Some data types (such as 24s) are not supported by the HMPP. You can use the Convert function to convert the data types to those supported by the HMPP for subsequent processing.

For 24-bit signed data, each vector element consists of three consecutive 8-bit unsigned character bytes (uint8_t) and is stored in little-endian byte order (the lower eight bits of the vector element are stored in the lower address). The sign is represented by the first bit of the eight most significant bits. These data can be converted to 32-bit signed integer (32s) or 32-bit floating-point (32f) type by using the Convert function in the HMPP.

Table 1 describes the user-defined data ranges in the HMPP.

Table 1 User-defined data ranges in the HMPP

Macro Definition

Maximum Value

Description

UINT24_MAX

16777215

The corresponding data type is not defined and is stored in the variable of the uint32_t type.

INT24_MAX

8388607

The corresponding data type is not defined and is stored in the variable of the int32_t type.

INT24_MIN

-8388608

The corresponding data type is not defined and is stored in the variable of the int32_t type.