Vector data types are the most commonly used types in AI Engine kernel code. To debug vector operations within
a kernel it is helpful to use
Using printf() with Vector Data Types
printf() the native vector
types you can use a technique as follows.
v4cint16 input_vector; ... int16_t* print_ptr =(int16_t*)&input_vector; for (int qq=0; qq<4;qq++) //4 here so we print two int16s, real + imag per loop. printf("vector re: %d, im: %d\r\n",print_ptr[2*qq],print_ptr[2*qq+1]); }
With the AI Engine simulator the
--profile option is required in order to
printf() outputs. With the x86 simulator
no additional options are needed to enable
calls. This is one of the benefits of the x86 simulator.
std::coutin kernel and host code. If
std::coutis used its outputs can appear interleaved, given the multi-threaded nature of the x86 simulator. Using
printf()is recommended instead.