Previous | Next --- Slide 46 of 78
Back to Lecture Thumbnails
fire

The code within the "if logic" (threadIdx.x < 2 ....) is to load two more inputs once in order to finish the last computation (with 3 input numbers). Is it correct?

taoy1

I think it is correct. In this case the first two threads load two values, and other threads load one value. This practice has better performance than one thread loads all the values. There's a good discussion about how to distribute memory requests here.