AnsweredAssumed Answered

incorect result on GPU

Question asked by nou on Apr 23, 2010
Latest reply on Jan 9, 2013 by heman

i have problem that on CPU it gives right results. but if run my code on GPU it return random results.

i pinpoint that problem is in this function. event_vector array did not contain proper values.

you can find whole code here http://orwell.fiit.stuba.sk/git?p=cellula.git;a=blob;f=kernels/asyn.cl;h=95f69b0872a356b035bc6200851cd7da1bdc3713;hb=da36c88bdc666c12c8fe5131a6c59ca8e48eae30

#define NEIGHBOR 8 #define QUEUE_LEN 8 #define COORD(c) (c.y*get_global_size(0) + c.x) typedef float _time; typedef float _state; typedef struct { _time x; _state y; }_event; typedef struct { int start,end; int start2,end2; _event state; _event queue[QUEUE_LEN]; }_cell; void create_event_vector(__global _cell *cells, _event *event_vector, int2 *coord, int *index) { for(int i=0;i<NEIGHBOR;i++) event_vector[i] = cells[COORD(coord[i])].queue[index[i]]; }

Outcomes