when compiling the bellow device cod
e. the following error showed up:
error: passing 'int *' to parameter of type ' int *' changes address space of pointer
array_dist[i] = Euclidean_distance(X_train, mydatapoint);
note: passing argument to parameter 'array_point_B' here
float Euclidean_distance(__global int* restrict array_point_A, __global int* restrict array_point_B) {
my code:
>
inline float Euclidean_distance(__global int* restrict array_point_A, __global int* restrict array_point_B) {
> // do something
> }
> _kernel void KNN_classifier(__global int* restrict X_train, __global int* restrict Y_train, __global int* restrict data_point, __global int* restrict array_X_set, __global int* restrict index_arr, __global float* restrict array_dist)
> {
> int mydatapoint[20];
> for (int l = 0; l + 8 < 4344; l += 8) {
> for (int u = l; u < l + 8; ++u) {
> for (int j = 0; j < 20; ++j) {
> mydatapoint[j] = array_X_set[u];
>
> }
>
> for (int i = 0; i < 4344; i++) {
> array_dist[i] = Euclidean_distance(X_train, mydatapoint);//ask
> index_arr[i] = i;
> }