Mercurial > hg > Papers > 2015 > kkb-sigos
view paper/source/multiply.cc @ 2:8e3bf4806e33
edit
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 04 May 2015 17:13:09 +0900 |
parents | |
children |
line wrap: on
line source
void multi_init(TaskManager *manager) { A = new float[length]; B = new float[length]; C = new float[length]; for(int i=0; i<length; i++) { A[i]=(float)(i+1000); B[i]=(float)(i+1)/10.f; } // create task HTask* multiply = manager->create_task(MULTIPLY_TASK); // set cputype multiply->set_cpu(spe_cpu); // set indata multiply->set_inData(0,(memaddr)A, sizeof(float)*length); multiply->set_inData(1,(memaddr)B, sizeof(float)*length); // set outdata multiply->set_outData(0,(memaddr)C, sizeof(float)*length); multiply->set_param(0,(long)length); // spawn task multiply->iterate(length); }