Depending on its declaration [font=“Courier New”]bound[/font] might not need a cast, but [font=“Courier New”]threadIdx.x[/font] and [font=“Courier New”]threadIdx.y[/font] aren’t [font=“Courier New”]int[/font]s.
Regardless of the strange printf() results (which I can’t explain either, but as tera says, try casts…) your code is likely not workable.
You’re reading and writing into the same array from multiple threads at once. Depending on your value of bound, you can easily have thread races. There’s a small caveat that this might be OK if both bound <= 32 and threadDim.x<=32, and the warp synchronous behavior would prevent it, but likely what you’re doing is dangerous anyway. You probably mean to have a syncthreads() call after each iteration of your loop.