I wrote a little app which is formed by cpu’s code and cuda’s code.
I don’t understand why some global function start without problems and others not!
This is the code, and the bum part (!!!) is in the last 4 lines…
while (*changed) {
n++;
printf("%d\n", n);
*changed=false;
cudaMemcpy(d_changed, changed, sizeof(bool), cudaMemcpyHostToDevice);
mediaReset<<< dimGrid2, dimBlock2 >>>(d_media, nsoglie);
cudaThreadSynchronize();
mediaDistance<<< dimGrid1, dimBlock1 >>>(d_media, d_newImg, nsoglie, img->width(), img->height());
cudaThreadSynchronize();
mediaRecalculate<<< dimGrid2, dimBlock2 >>>(d_media, d_changed, nsoglie);
cudaThreadSynchronize();
cudaMemcpy(changed, d_changed, sizeof(bool), cudaMemcpyDeviceToHost);
}
votiInMat<<< dimGrid1, dimBlock1 >>>(d_media, d_newImg, d_votiMat, nsoglie, img->width(), img->height());
cudaThreadSynchronize();
votazioneFinestra<<< dimGrid1, dimBlock1 >>>(d_media, d_newImg, d_votiMat, nsoglie, raggio, img->width(), img->height());
cudaThreadSynchronize();
I’ve seen the code more and more times, and there’s NOTHING WRONG! These two global functions are similar at all at the others…
The compiler finishes without any error, but at the end I can see that these last two global functions are not called!
I’m using Ubuntu 10.4… can someone help me?
Thanks!