X_train
is a parameter, and is declared as:
__global int * restrict X_train
__kernel void KNN_classifier(__global int * restrict X_train, __global int * restrict Y_train, __global int * restrict data_point, int k)
The method you are calling expects an
int *
:
inline float Euclidean_distance(int * array_point_A, int * array_point_B)
array_dist[i] = Euclidean_distance(X_train[i], data_point[j]);
When you select an element from an array with an index, you get the item, not a pointer to the item.
So if you pass in a pointer to an integer and then select an element from that, you get an integer, not a pointer to an integer (remember, the name of an array is a pointer to the first element of that array - so a pointer to a value is also an array of those values).
Either use the
address of operator '&' or pass the whole array when you call the second method.