Hi!
Here’s the code that doesn’t work
global void assign_centroids(Datapoint* data, long n, int k, bool* global_reassigned)
{
long id;
id = blockDim.x * blockIdx.x + threadIdx.x;
if(id >= n)
return;
printf(“data[id] b[%d], t[%d], id[%ld]\n”, blockIdx.x, threadIdx.x, id);
}
Here’s the code that works
global void assign_centroids(Datapoint* data, long n, int k, bool* global_reassigned)
{
long id;
id = blockDim.x * blockIdx.x + threadIdx.x;
if(id >= n)
return;
//printf(“data[id] b[%d], t[%d], id[%ld]\n”, blockIdx.x, threadIdx.x, id);
}
Is it because I am trying to print a long? If so, is there any way to print longs?
Thanks!