35#include "src/include/jazz_platform.h"
46#ifndef INCLUDED_JAZZ_CATCH2
47#define INCLUDED_JAZZ_CATCH2
49#include "src/catch2/catch.hpp"
55#ifndef INCLUDED_JAZZ_ELEMENTS_TYPES
56#define INCLUDED_JAZZ_ELEMENTS_TYPES
67#define SHORT_NAME_SIZE 8
69#define NAME_LENGTH NAME_SIZE - 1
70#define ONE_MB (1024*1024)
78#define JAZZ_MAX_NUM_THREADS 64
80#define MAX_TENSOR_RANK 6
81#define MAX_CHECKS_4_MATCH 25
82#define MAX_ITEMS_IN_KIND 64
87#define CELL_TYPE_UNDEFINED 0x000
90#define CELL_TYPE_BYTE 0x001
91#define CELL_TYPE_BYTE_BOOLEAN 0x101
92#define CELL_TYPE_INT8 0x201
96#define CELL_TYPE_INT16 0x002
97#define CELL_TYPE_UINT16 0x102
98#define CELL_TYPE_FLOAT16 0x202
99#define CELL_TYPE_BFLOAT16 0x302
102#define CELL_TYPE_INTEGER 0x004
103#define CELL_TYPE_FACTOR 0x104
104#define CELL_TYPE_GRADE 0x204
105#define CELL_TYPE_BOOLEAN 0x304
106#define CELL_TYPE_SINGLE 0x404
107#define CELL_TYPE_STRING 0x504
108#define CELL_TYPE_UINT32 0x604
111#define CELL_TYPE_LONG_INTEGER 0x008
112#define CELL_TYPE_TIME 0x108
113#define CELL_TYPE_DOUBLE 0x208
114#define CELL_TYPE_UINT64 0x308
117#define CELL_TYPE_TUPLE_ITEM 0x028
118#define CELL_TYPE_KIND_ITEM 0x128
121#define CELL_TYPE_INDEX 0x030
124#define CELL_TYPE_ONNX_GRAPH 0x040
125#define CELL_TYPE_ONNX_TENSOR 0x140
128#define BYTE_BOOLEAN_NA 0x0ff
129#define BOOLEAN_NA 0x0ff
130#define FLOAT16_NA F16_NA
131#define BFLOAT16_NA BF16_NA
132#define INTEGER_NA INT_MIN
133#define SINGLE_NA F_NA
135#define STRING_EMPTY 1
136#define LONG_INTEGER_NA LLONG_MIN
137#define TIME_POINT_NA 0
138#define DOUBLE_NA R_NA
140#define SINGLE_NA_UINT32 F_NA_uint32
141#define DOUBLE_NA_UINT64 R_NA_uint64
147#define MIXED_TYPE_INVALID 0
148#define MIXED_TYPE_KIND 1
149#define MIXED_TYPE_TUPLE 2
155#define BLOCK_ATTRIB_BLOCKTYPE 1
156#define BLOCK_ATTRIB_SOURCE 2
157#define BLOCK_ATTRIB_DEST 3
158#define BLOCK_ATTRIB_MIMETYPE 4
159#define BLOCK_ATTRIB_URL 5
160#define BLOCK_ATTRIB_LANGUAGE 6
161#define BLOCK_ATTRIB_SNIPSTATE 7
162#define BLOCK_ATTRIB_SNIPVERS 8
167#define SET_HAS_NA_FALSE 0
168#define SET_HAS_NA_TRUE 1
169#define SET_HAS_NA_AUTO 2
238typedef std::map<std::string, std::string>
Index;
The namespace for Jazz Utils, Blocks, Kinds, Tuples, Containers, etc.
Definition block.cpp:39
BlockHeader * pBlockHeader
A pointer to a BlockHeader.
Definition types.h:261
double R_NA
NaN in double (binary R-compatible)
Definition types.cpp:57
StringBuffer * pStringBuffer
A pointer to a StringBuffer.
Definition types.h:289
std::map< std::string, std::string > Index
An Index kept in RAM by Volatile implemented as an stdlib map (string, string)
Definition types.h:238
std::set< std::string > Dimensions
An set::set with the dimension names returned by kind.dimensions()
Definition types.h:235
char * pChar
A pointer to a char buffer.
Definition types.h:185
char Name[NAME_SIZE]
A short identifier used in Blocks, Containers and API.
Definition types.h:183
uint16_t ff_fp16
A future (C++23 declares std::float16_t) 16-bit floating point placeholder for float16 and bfloat16.
Definition types.h:210
Name * pName
A pointer to a Name.
Definition types.h:184
std::chrono::steady_clock::time_point TimePoint
A time point stored as 8 bytes.
Definition types.h:172
float F_NA
NaN in single.
Definition types.cpp:56
StaticBlockHeader * pStaticBlockHeader
A pointer to a StaticBlockHeader.
Definition types.h:278
Structure at the end of a Block, initially created with init_string_buffer()
Definition types.h:282
int last_idx
The index to the first free space after the last stored string.
Definition types.h:285
bool stop_check_4_match
When the StringBuffer is small, try to match existing indices of the same string to save RAM.
Definition types.h:283
int buffer_size
The size in bytes of buffer[].
Definition types.h:286
char buffer[]
The buffer where strings are stored starting with two zeroes for STRING_NA & STRING_EMPTY.
Definition types.h:287
bool alloc_failed
A previous call to get_string_offset() failed to alloc space for a string.
Definition types.h:284
The dimension of a tensor.
Definition types.h:192
int dim[MAX_TENSOR_RANK]
Dimensions for the Tensor. The product of all * (cell_type & 0xff) < 2 Gb.
Definition types.h:193
A tensor of cell size 1, 4, 8 or sizeof(BlockHeader)
Definition types.h:214
double cell_double[0]
.. CELL_TYPE_DOUBLE
Definition types.h:230
ItemHeader cell_item[0]
.. An array of BlockHeader used by Kinds and Tuples
Definition types.h:231
int8_t cell_int8[0]
.. CELL_TYPE_INT8
Definition types.h:216
int16_t cell_int16[0]
.. CELL_TYPE_INT16
Definition types.h:219
time_t cell_time[0]
.. CELL_TYPE_TIME
Definition types.h:228
uint32_t cell_uint[0]
.. CELL_TYPE_UINT32 or CELL_TYPE_SINGLE or CELL_TYPE_BOOLEAN as 32 bit unsigned
Definition types.h:224
uint8_t cell_byte[0]
Cell size for CELL_TYPE_BYTE.
Definition types.h:215
uint64_t cell_ulongint[0]
.. CELL_TYPE_UINT64 or CELL_TYPE_DOUBLE or CELL_TYPE_TIME as 64 bit unsigned
Definition types.h:229
bool cell_bool[0]
.. CELL_TYPE_BYTE_BOOLEAN
Definition types.h:217
ff_fp16 cell_float16[0]
.. CELL_TYPE_FLOAT16 or CELL_TYPE_BFLOAT16
Definition types.h:221
int cell_int[0]
.. CELL_TYPE_INTEGER, CELL_TYPE_FACTOR, CELL_TYPE_GRADE, CELL_TYPE_BOOLEAN and CELL_TYPE_STRING
Definition types.h:223
uint16_t cell_word[0]
.. CELL_TYPE_UINT16
Definition types.h:220
long long cell_longint[0]
.. CELL_TYPE_LONG_INTEGER
Definition types.h:227
float cell_single[0]
.. CELL_TYPE_SINGLE
Definition types.h:225