Altera_Forum
Honored Contributor
8 years agoglobal memory access cause II become large
I have memory read and memory write kernel in similar pattern.
these two kernel have same memory access pattern that is not continuous access. and memory read have II=1, memory write have II = 312. how come read and write to global memory different so large? and what cause memory write have large II. an If I change access pattern to continuous access, read and write II will be 1. why memory read always have II=1,and memory write will require continuous access if I want II=1? and if I add# pragma ivdep before memory write loop, the II will be 1 no matter what access pattern, what is that mean? memory read: int id=...; float temp[5]; for(...){ # pragma unroll for(int i=0;i<5;i++){ temp = global[i*id+a];write_channel_intel(data1_ch,temp); } } memory write: int id=...; float temp[5]; for(...){ # pragma unroll for(int i=0;i<5;i++){ temp = read_channel_intel(data2_ch);
global[i*id+a] = temp; //Compiler failed to schedule this loop with smaller II due to memory dependency:Store Operation } }