80 likes | 193 Views
Accelerator Compiler for the VENICE Vector Processor. Zhiduo Liu Aaron Severance Satnam Singh Guy Lemieux. This is the VENICE Vector Processor :. Complicated. OR like this :. You can program it like this :. #include "vector.h “ int main() { int A[] = { 1,2,3,4,5,6,7,8 };
E N D
Accelerator Compiler for the VENICE Vector Processor Zhiduo Liu Aaron Severance Satnam Singh Guy Lemieux
This is the VENICE Vector Processor : Complicated
OR like this : You can program it like this : #include "vector.h“ int main() { int A[] = {1,2,3,4,5,6,7,8}; const int data_len = sizeof ( A ); int *va = ( int *) vector_malloc ( data_len ); vector_dma_to_vector ( va, A, data_len ); vector_wait_for_dma (); vector_set_vl ( data_len / sizeof (int) ); vector ( SVW, VADD, va, 42, va ); vector_instr_sync(); // wait for operation to complete vector_dma_to_host ( A, va, data_len ); vector_wait_for_dma (); vector_free (); // deallocate scratchpad malloc } #include "Accelerator.h" #include "VectorTarget.h" using namespace ParallelArrays; using namespace MicrosoftTargets; int main() { Target *tgtVector = CreateVectorTarget(); int A[] = {1,2,3,4,5,6,7,8}; IPA b = IPA( A, sizeof (A)/sizeof (int)); IPA c = b + 42; tgtVector->ToArray( c, A, sizeof (A)/sizeof (int)); tgtVector->Delete(); } Target *tgtVector = CreateMulticoreTarget(); Target *tgtVector = CreateDX9Target();
Assembly Programming : Accelerator Programming : Write in Accelerator Write Assembly Compile with Microsoft Visual Studio Doesn’t compile? Or result incorrect? Compile with Gcc Compile with Gcc Doesn’t compile? Download to board Download to board Get Result Get Result Result Incorrect?
Assembly Programming : • Hard to program • Long debug cycle • Not portable • Manual – Not always optimal or correct (wysiwyg) • Accelerator Programming : • Easy to program • Easy to debug • Can also target other devices • Automated compiler optimizations
Compiler Flow LIR IR Calculate Buffer Size Add Intermediates Assign Buffers to Inputs Combine Operations Allocate & Initialize Memory Evaluation Ordering & Reference Counting Transfer Data To Scratchpad Set VL Buffer Counting Write Vector Instructions Convert To LIR Transfer Result To Host LIR Need Double buffering?