SIMA_TESSELATE

Description

This graph is responsible for performing tesselation operation on the tensor passed to it.

Graph Info

SIMA_TESSELATE

Graph Name

SIMA_TESSELATE

Graph ID

2

Operations Supported

Tesselates incoming tensor

Important Parameters to configure

“n_boxes” → No:of input boxes/images/tensors to be tessellated

“c16_align” → Tessellated output is aligned to 16 bytes boundary(1) or not(0). 0 is supported only if elemSize = 1

“input_width” → Width of the input box/image/tensor

“input_height” → Height of the input box/image/tensor

“input_depth” → Depth/Channels of the input box/image/tensor

“tile_width” → Width of the Slice/Tile

“tile_height” → Height of the Slice/Tile

“tile_depth” → Depth/Channels of the Slice/Tile

“elem_size” → Width in bytes of each input element/data(1, 2, 4). 1 → INT8, 2 → INT16, 4 → INT32

“debug” → Enable more debug logs, 0 → disable, 1→ enable

Available Since Yocto Build

B670

Example Config

Below is the example config json for this graph. We need to use such config for configuring the EV74 graph first. For this purpose, we need a CVU Configuration Application developed in C++.

{
 "version": 0.1,
 "node_name": "ev-tess",
 "simaai__params": {
     "params": 15,
     "index": 0,
     "cpu": 1,
     "next_cpu": 2,
     "graph_id": 2,
     "input_width": 10,
     "input_height": 17,
     "input_depth": 32,
     "tile_width": 4,
     "tile_height": 3,
     "tile_depth": 23,
     "data_type": 2,
     "n_boxes": 1,
     "c16_align": 1,
     "format": 1,
     "in_type": 0,
     "no_of_outbuf": 1,
     "out_type": 2,
     "in_sz": 21760,
     "out_sz": 21840,
     "ibufname": "in-source",
     "debug": 1,
     "dump_data": 1
     }
 }

Note

Please note that, the out_sz parameter in above mentioned config json needs to be calculated using tess_out_sz.py file.

CVU Configuration Application

To configure any CVU graph, a C++ CVU Configuration Application must be cross-compiled and executed on the board before using the CVU. Multiple graphs can be pre-programmed into the CVU before running any application. This guide provides a pre-written C++ application for download for each graph that can be cross-compiled on Palette, and executed on the board prior to running the simaaiprocesscvu GStreamer plugin. An pre-compiled version is also included for direct use. If you encounter issues, please re-compile the application from the sources provided.

Sample CVU Configuration Application Function to configure Parameters
 1 #define SIMA_TESS_GRAPH_ID  (2)
 2 #define N_BOXES      (1)
 3 #define C_ALIGN_16   (2)
 4 #define INPUT_WIDTH  (3)
 5 #define INPUT_HEIGHT (4)
 6 #define TILE_WIDTH   (5)
 7 #define TILE_HEIGHT  (6)
 8 #define INPUT_DEPTH  (7)
 9 #define TILE_DEPTH   (8)
10 #define ELEM_SIZE    (9)
11 #define DEBUG_EN     (10)
12
13 void configure_tesselate(const char *json_fpath)
14 {
15   simaai_params_t *params = parser_node_struct_init();
16
17   uint8_t *buf = (uint8_t *)calloc(1, sizeof(uint8_t) * 16);
18
19   int val = *((int *)parser_get_int(params, "n_boxes"));
20   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_N_BOXES, buf, val);
21
22   val = *((int *)parser_get_int(params, "c16_align"));
23   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_C_ALIGN_16, buf, val);
24
25   val = *((int *)parser_get_int(params, "img_width"));
26   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_INPUT_WIDTH, buf, val);
27
28   val = *((int *)parser_get_int(params, "img_height"));
29   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_INPUT_HEIGHT, buf, val);
30
31   val = *((int *)parser_get_int(params, "tile_width"));
32   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_TILE_WIDTH, buf, val);
33
34   val = *((int *)parser_get_int(params, "tile_height"));
35   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_TILE_HEIGHT, buf, val);
36
37   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_INPUT_DEPTH, buf, 3);
38
39   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_TILE_DEPTH, buf, 3);
40
41   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_ELEM_SIZE, buf, 0);
42
43   send_i32_param(2, SIMA_TESS_GRAPH_ID, SIMA_TESS_GRAPH_DEBUG_EN, buf, 0);
44
45   std::cout << "Completed tess Graph Configure \n";
46   parser_finalize(params);
47   free(buf);
48 }

Please refer to How to compile CVU Configuration Application? for more info.