CUDA вычисляет гистограмму с общей памятьюC++

Программы на C++. Форум разработчиков
Anonymous
CUDA вычисляет гистограмму с общей памятью

Сообщение Anonymous »


I'm following a udacity problem set lesson to compute a histogram of numBins element out of a long series of numElems values. In this simple case each element's value is also his own bin in the histogram, so generating with CPU code the histogram is as simple as

for (i = 0; i < numElems; ++i) histo[val]++; I don't get the video explanation for a "fast histogram computation" according to which I should sort the values by a 'coarse bin id' and then compute the final histogram.

The question is:
  • why should I sort the values by 'coarse bin indices'?


Источник: https://stackoverflow.com/questions/365 ... red-memory

Вернуться в «C++»