Menu

#6 Detect Mismatch between Memory Acces Pattern in Accessor Definition and Code Analysis

1.0
open
nobody
None
2013-07-23
2013-07-23
No

In case the Accessor defintion used within a Kernel does not match the memory access pattern, emit an error. In the following example, a region of range x 1 is specified, but the kernel reads a region of 1 x range. This may generate wrong code that segfaults.

BoundaryCondition<unsigned char=""> BcInClamp(IN, range, 1, BOUNDARY_CLAMP);
Accessor<unsigned char=""> AccInClamp(BcInClamp);</unsigned></unsigned>

kernel() {
int sum = 0;
for (int xf=-range/2; xf<=range/2; xf++)
sum += in(0, xf);
output() = sum;
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB