请问DMA模式中RANK_MODE行集合模式是什么呢?
-
如题。请问各位老师,如果想要使用,mask应该怎么写呢? 如果能有相关代码示例是最好啦,万分感谢~
还有15年JCST上的文章《Cooperative Computing Techniques for a Deeply Fused and Heterogeneous Many-Core Processor Architecture》中提到的Array Pattern是指什么呢? 应该怎么使用呢?就是文章Fig.4 (g)
-
大概应该是
athread_get(RANK_MODE, src, dst, len, &reply, mask, stride, bsize)
比如athread_get(RANK_MODE, src, dst, 1024, &reply, 0xff, 0, 32)
应该是: len=1024, mask=0xff, bsize=32
可以获取1024B数据,其中从核0获得0-32B, 256-288B, 512-544B, 768-800B, 从核1获得32-63B, 288-320B, 544-576B, 800-832B, 以此类推。例子:
#ifdef MPE #include <athread.h> #include <stdio.h> extern SLAVE_FUN(rank_mode)(double *); int main(){ double data[128]; int i; for (i = 0; i < 128; i ++){ data[i] = i; } athread_init(); athread_spawn(rank_mode, data); athread_join(); athread_halt(); } #endif #ifdef CPE #include <slave.h> void rank_mode(double *data){ if (_ROW > 0) return; double d_local[16]; volatile int reply; athread_syn(ROW_SCOPE, 0xff); if (_COL == 0){ reply = 0; athread_get(RANK_MODE, data, d_local, 1024, &reply, 0xff, 0, 32); while (reply != 1); } athread_syn(ROW_SCOPE, 0xff); int i; for (i = 0; i < 8; i ++){ athread_syn(ROW_SCOPE, 0xff); if (_COL == i){ printf("%d:", _COL); int j; for (j = 0; j < 16; j ++){ printf("%f ", d_local[j]); } puts(""); } } } #endif