Algorithms in CUDA: finding max value in an array

preview_player
Показать описание
In this video I look at writing a CUDA program to find the maximum value in an array.

Рекомендации по теме
Комментарии
Автор

Awesome! Thank you so much for those tutorials!!!

rendermanpro
Автор

awesome video i found it quite useful, there are two minors errors, first when you initialize the max (d_max) to 0 it will return this zero if all the numbers of the array are less than 0, it should be any number of the array, the second is on the kernel sould also initialize temp with a value in the array (temp = array[0]);

cripplededu
Автор

Hi James. How can I change kernel & main code to handle 2d array and find max value per each column in that array? I have 50 columns, each has 5000 consecutive float elements in memory.

IsraelAmar
Автор

I try to do the min version of this code, but when the array of floats has each element greater than -1.0, the minimum value that kernel returns is always -1.0. I try to assign the macro FLT_MAX to variable "temp" in the kernel, but there's another problem: this time the minimum value is 0.0, but in the input array there's not this value. Please, can anyone help me to fix these problems? (I am very desperate)

davidecangiano
Автор

Hi James, great video, and really helpful to me. What should I do to obtain not only the maximum number of an array of numbers, but also the index of the maximum number in the array?

rbnstmar
Автор

So you are using a grid size of 256 blocks and each block has 256 threads => 65.536 threads.

grigorecosmin
Автор

Sorry I wanted to say whether one can calculate the same minimum value, if one instead of fmaxf, fminf will use

aminladal
Автор

hey, thanks for the video, can i use this code for 3ds max to make a better rendering ?

Haydu_lion
Автор

Hello, can you help please to find the index of the maximum value in an array?
Thank you

tp
Автор

Your method isn't working. Try a small array size (e.g. 10 values) and write to console array values. Compare results by human-brain comparison. This method calculates number of executed threads only. :)

hammerhead
Автор

Real man implement bubble sort and then get the last element of the array

jussehwagner
Автор

Hey man sorry, but i get the same result over and over, why do I get the same max number every time I run the program ?

rdavid