I am in the process of learning tiling in C++ AMP and I have read many exmaples but all involves 2D matrix examples.
Honestly I don't quite fully understand tiling yet so I found this example online that I need help with.
extent<1> ext(250000); tiled_extent<1024> tiled_ext = ext.tile<1024>().pad(); parallel_for_each(tiled_ext, [=](tiled_index<1024> idx) restrict(amp) { .... .... });
Please correct me if I am wrong. In example above:
1) the tiled_extent<1024> means that one tile has size 1024? Is that correct?
Or is it more because of additional padding?
2) ext.tile<1024>().pad() means exactly what? Am I adding additional memory (additional elements) to the tile itself?
If so, are these additional memory initialized? And to what value? Zero?
But since the maximum tile size is 1024 does this padding in this case exceeds the maximum size of 1024? I am confused, please help.
3) In the example above, what is the total number of threads? Or is this automatically calculated by the compiler by multiplying total tiles by tile size? If that is the case then in above example how many tiles does it have? And tile size?
Some clarifications would help. Thank you.