-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi.
A somewhat important issue: SRA (at least the one at http://cuda.dcc.ufmg.br/dawn/index.php) isn't able to analyze the below program - I prefer using the MODULO macro with conditional statements (the other one below seems to work with SRA).
#define SIZE 128
//typedef long TYPE;
typedef int TYPE;
//typedef short TYPE;
// Unfortunately, in C language: -1 % 4 = -1
//#define MODULO(val, SIZE) ((val < 0) ? (SIZE + val) : ((val >= SIZE) ? val - SIZE : val) )
// However, this macro WORKS with SRA: #define MODULO(val, SIZE) ((val + SIZE) % SIZE)
TYPE tmp[SIZE];
TYPE tmpF[SIZE];
//void Shift(TYPE tmp[SIZE], TYPE tmpF[SIZE], TYPE d) {
void Shift(TYPE d) {
TYPE k;
for (k = 0; k < SIZE; k++)
tmpF[k] = tmp[MODULO(k + d, SIZE)];
}
Metadata
Metadata
Assignees
Labels
No labels