DSPLIB User Guide
Common definitions

Introduction

This module consists of definitions (macros, structures, utility functions) that are commonly applicable to all DSPLIB kernels.

Data Structures

struct  DSPLIB_bufParams1D_t
 A structure for a 1 dimensional buffer descriptor. More...
 
struct  DSPLIB_bufParams2D_t
 A structure for a 2 dimensional buffer descriptor. More...
 
struct  DSPLIB_bufParams3D_t
 A structure for a 3 dimensional buffer descriptor. More...
 
struct  DSPLIB_bufParamsND_t
 A structure for a N dimensional buffer descriptor. More...
 

Functions

static int32_t DSPLIB_sizeof (uint32_t type)
 Inline function returns number of bytes per element given a type of DSPLIB_data_type_e. More...
 

Typedefs

typedef double DSPLIB_D64
 Double precision floating point. More...
 
typedef float DSPLIB_F32
 Single precision floating point. More...
 
typedef DSPLIB_STATUS_NAME DSPLIB_STATUS
 Return value for DSPLIB functions. More...
 
typedef void * DSPLIB_kernelHandle
 Handle type for DSPLIB operations. More...
 

Enumerations

enum  DSPLIB_data_type_e {
  DSPLIB_INT8 = 0 , DSPLIB_INT16 = 1 , DSPLIB_INT32 = 2 , DSPLIB_INT64 = 3 ,
  DSPLIB_INT128 = 4 , DSPLIB_UINT8 = 5 , DSPLIB_UINT16 = 6 , DSPLIB_UINT24 = 7 ,
  DSPLIB_UINT32 = 8 , DSPLIB_UINT64 = 9 , DSPLIB_UINT128 = 10 , DSPLIB_FLOAT16 = 11 ,
  DSPLIB_FLOAT32 = 12 , DSPLIB_FLOAT64 = 13
}
 The enumeration of all data types. More...
 
enum  DSPLIB_dimension_e {
  DSPLIB_2D = 0 , DSPLIB_3D = 1 , DSPLIB_4D = 2 , DSPLIB_5D = 3 ,
  DSPLIB_6D = 4
}
 The enumeration of multidimensional buffer types. More...
 
enum  DSPLIB_STATUS_NAME {
  DSPLIB_SUCCESS = 0 , DSPLIB_ERR_FAILURE = 1 , DSPLIB_ERR_INVALID_VALUE = 2 , DSPLIB_ERR_INVALID_TYPE = 3 ,
  DSPLIB_ERR_INVALID_DIMENSION = 4 , DSPLIB_ERR_NULL_POINTER = 5 , DSPLIB_ERR_NOT_IMPLEMENTED = 6 , DSPLIB_ERR_NOT_EQUAL_WIDTH_STRIDE = 7 ,
  DSPLIB_ERR_NOT_ALIGNED_PTRS_STRIDES = 8 , DSPLIB_ERR_NOT_ALIGNED_WIDTHS = 9 , DSPLIB_ERR_BUFFER_TOO_SMALL = 10 , DSPLIB_ERR_INVALID_ACTIVATION = 11 ,
  DSPLIB_ERR_INVALID_SHIFT = 12 , DSPLIB_ERROR_MAX = 13
}
 The enumeration of all status codes. More...
 
enum  DSPLIB_FUNCTION_STYLE { DSPLIB_FUNCTION_NATC = 0 , DSPLIB_FUNCTION_OPTIMIZED , DSPLIB_FUNCTION_MAX = 128 }
 Enumeration for the style of function implementation. More...
 

Macros

#define DSPLIB_ISSIGNED(type)   ((type) < DSPLIB_UINT8 || (type) > DSPLIB_UINT128)
 
#define DSPLIB_SIGNEDNESS(type)   (DSPLIB_ISSIGNED((type)) ? "signed" : "unsigned")
 
#define DSPLIB_PARAM_SIZE   128
 Parameter structure size in bytes. More...
 
#define DSPLIB_ALIGN_SHIFT_64BYTES   6
 Number of bits to shift for 64-byte memory alignment. More...
 
#define DSPLIB_ALIGN_SHIFT_128BYTES   7
 Number of bits to shift for 128-byte memory alignment. More...
 
#define DSPLIB_ALIGN_SHIFT_256BYTES   8
 Number of bits to shift for 256-byte memory alignment. More...
 
#define DSPLIB_ALIGN_64BYTES   (1 << DSPLIB_ALIGN_SHIFT_64BYTES)
 Align by 64-byte memory alignment. More...
 
#define DSPLIB_ALIGN_128BYTES   (1 << DSPLIB_ALIGN_SHIFT_128BYTES)
 Align by 128-byte memory alignment. More...
 
#define DSPLIB_ALIGN_256BYTES   (1 << DSPLIB_ALIGN_SHIFT_256BYTES)
 Align by 256-byte memory alignment. More...
 
#define DSPLIB_L2DATA_ALIGN_SHIFT   DSPLIB_ALIGN_SHIFT_64BYTES
 Set the default L2 data alignment. More...
 
#define DSPLIB_L2DATA_ALIGNMENT   (((uint32_t) 1) << ((uint32_t) DSPLIB_L2DATA_ALIGN_SHIFT))
 Macro that specifies the alignment of data buffers in L2 memory for optimal performance. More...
 

Macro Definition Documentation

◆ DSPLIB_ISSIGNED

#define DSPLIB_ISSIGNED (   type)    ((type) < DSPLIB_UINT8 || (type) > DSPLIB_UINT128)

Definition at line 57 of file DSPLIB_bufParams.h.

◆ DSPLIB_SIGNEDNESS

#define DSPLIB_SIGNEDNESS (   type)    (DSPLIB_ISSIGNED((type)) ? "signed" : "unsigned")

Definition at line 58 of file DSPLIB_bufParams.h.

◆ DSPLIB_PARAM_SIZE

#define DSPLIB_PARAM_SIZE   128

Parameter structure size in bytes.

Definition at line 188 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_SHIFT_64BYTES

#define DSPLIB_ALIGN_SHIFT_64BYTES   6

Number of bits to shift for 64-byte memory alignment.

Definition at line 196 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_SHIFT_128BYTES

#define DSPLIB_ALIGN_SHIFT_128BYTES   7

Number of bits to shift for 128-byte memory alignment.

Definition at line 197 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_SHIFT_256BYTES

#define DSPLIB_ALIGN_SHIFT_256BYTES   8

Number of bits to shift for 256-byte memory alignment.

Definition at line 198 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_64BYTES

#define DSPLIB_ALIGN_64BYTES   (1 << DSPLIB_ALIGN_SHIFT_64BYTES)

Align by 64-byte memory alignment.

Definition at line 200 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_128BYTES

#define DSPLIB_ALIGN_128BYTES   (1 << DSPLIB_ALIGN_SHIFT_128BYTES)

Align by 128-byte memory alignment.

Definition at line 201 of file DSPLIB_types.h.

◆ DSPLIB_ALIGN_256BYTES

#define DSPLIB_ALIGN_256BYTES   (1 << DSPLIB_ALIGN_SHIFT_256BYTES)

Align by 256-byte memory alignment.

Definition at line 202 of file DSPLIB_types.h.

◆ DSPLIB_L2DATA_ALIGN_SHIFT

#define DSPLIB_L2DATA_ALIGN_SHIFT   DSPLIB_ALIGN_SHIFT_64BYTES

Set the default L2 data alignment.

Definition at line 204 of file DSPLIB_types.h.

◆ DSPLIB_L2DATA_ALIGNMENT

#define DSPLIB_L2DATA_ALIGNMENT   (((uint32_t) 1) << ((uint32_t) DSPLIB_L2DATA_ALIGN_SHIFT))

Macro that specifies the alignment of data buffers in L2 memory for optimal performance.

Definition at line 208 of file DSPLIB_types.h.

Typedef Documentation

◆ DSPLIB_D64

typedef double DSPLIB_D64

Double precision floating point.

Definition at line 147 of file DSPLIB_types.h.

◆ DSPLIB_F32

typedef float DSPLIB_F32

Single precision floating point.

Definition at line 148 of file DSPLIB_types.h.

◆ DSPLIB_STATUS

Return value for DSPLIB functions.

Definition at line 170 of file DSPLIB_types.h.

◆ DSPLIB_kernelHandle

typedef void* DSPLIB_kernelHandle

Handle type for DSPLIB operations.

Definition at line 172 of file DSPLIB_types.h.

Enumeration Type Documentation

◆ DSPLIB_data_type_e

The enumeration of all data types.

Enumerator
DSPLIB_INT8 

Signed 8-bit integer

DSPLIB_INT16 

Signed 16-bit integer

DSPLIB_INT32 

Signed 32-bit integer

DSPLIB_INT64 

Signed 64-bit integer

DSPLIB_INT128 

Signed 128-bit integer

DSPLIB_UINT8 

Unsigned 8-bit integer

DSPLIB_UINT16 

Unsigned 16-bit integer

DSPLIB_UINT24 

Unsigned 24-bit integer

DSPLIB_UINT32 

Unsigned 32-bit integer

DSPLIB_UINT64 

Unsigned 64-bit integer

DSPLIB_UINT128 

Unsigned 128-bit integer

DSPLIB_FLOAT16 

16-bit floating point number

DSPLIB_FLOAT32 

32-bit floating point number

DSPLIB_FLOAT64 

64-bit floating point number

Definition at line 29 of file DSPLIB_bufParams.h.

◆ DSPLIB_dimension_e

The enumeration of multidimensional buffer types.

Enumerator
DSPLIB_2D 

Two dimensional buffer

DSPLIB_3D 

Three dimensional buffer

DSPLIB_4D 

Four dimensional buffer

DSPLIB_5D 

Five dimensional buffer

DSPLIB_6D 

Six dimensional buffer

Definition at line 61 of file DSPLIB_bufParams.h.

◆ DSPLIB_STATUS_NAME

The enumeration of all status codes.

Enumerator
DSPLIB_SUCCESS 

0 => No error

DSPLIB_ERR_FAILURE 

1 => Unspecified error

DSPLIB_ERR_INVALID_VALUE 

2 => Invalid parameter value

DSPLIB_ERR_INVALID_TYPE 

3 => Invalid parameter type (DSPLIB_data_type_e data_type)

DSPLIB_ERR_INVALID_DIMENSION 

4 => Dimension parameter (width/height) is too big/small

DSPLIB_ERR_NULL_POINTER 

5 => Unsupported null pointer condition

DSPLIB_ERR_NOT_IMPLEMENTED 

6 => Parameter configuration is not supported/implemented

DSPLIB_ERR_NOT_EQUAL_WIDTH_STRIDE 

7 => Stride should be equal to width * element size

DSPLIB_ERR_NOT_ALIGNED_PTRS_STRIDES 

8 => Pointers and stride values are not aligned to documented value

DSPLIB_ERR_NOT_ALIGNED_WIDTHS 

9 => Width values are not aligned to documented value

DSPLIB_ERR_BUFFER_TOO_SMALL 

10 => Buffer size not large enough

DSPLIB_ERR_INVALID_ACTIVATION 

11 => Activation selection incompatible with data type

DSPLIB_ERR_INVALID_SHIFT 

12 => Requested shift amount is not valid

DSPLIB_ERROR_MAX 

Definition at line 151 of file DSPLIB_types.h.

◆ DSPLIB_FUNCTION_STYLE

Enumeration for the style of function implementation.

Enumerator
DSPLIB_FUNCTION_NATC 

Natural C implementation of the function

DSPLIB_FUNCTION_OPTIMIZED 

Optimized C implementation of the function for the MMA + C7x architecture

DSPLIB_FUNCTION_MAX 

Definition at line 175 of file DSPLIB_types.h.

Function Documentation

◆ DSPLIB_sizeof()

static int32_t DSPLIB_sizeof ( uint32_t  type)
inlinestatic

Inline function returns number of bytes per element given a type of DSPLIB_data_type_e.

Definition at line 136 of file DSPLIB_bufParams.h.