/* ============================================================ //--cambine: kernel funtion of pgain //--author: created by Jianbin Fang //--date: 02/03/2011 ============================================================ */ typedef struct { float weight; //float *coord; long assign; /* number of point where this one is assigned */ float cost; /* cost of that assignment, weight*distance */ } Point_Struct; //#define Elements __kernel void memset_kernel(__global char * mem_d, short val, int number_bytes){ const int thread_id = get_global_id(0); mem_d[thread_id] = val; } //--9 parameters /* kernel */ __kernel void pgain_kernel( __global Point_Struct *p, __global float *coord_d, __global float * work_mem_d, __global int *center_table_d, __global char *switch_membership_d, __local float *coord_s, int num, int dim, long x, int K){ /* block ID and global thread ID */ const int thread_id = get_global_id(0); const int local_id = get_local_id(0); if(thread_id