serial programming serial programming in NVIDIA

Hi,
I want to use NVIDIA as co processor. I need to run main loop. each time it takes a sample and do with it some calculations. after that, next sample is tested.

each sample has to wait the previous one to ended before calculations are done with it . doe’s NVIDIA can handle with 10MSampe/Sec. doe’s NVIDIA useful for such kinds of calculations.

example for main loop:

for (int i=0;i<n_samp;i++) {
if vec[i]>a {
}
if (state==1) {
m=m+vec[i];
}

if (state==2) {
}
}

Yair

I’m not sure I understand the problem entirely but if the outcome of each iteration of this ‘for’ loop depends on the outcome of the previous one (or in other words, if elements of vec array must be processed in sequence) CUDA will probably not be very efficient.

I mean that outcome of each iteration of this ‘for’ loop depends on the outcome of the previous one. in this situation, the loop runs only on one kerenl. what is the maximum FLOPs that one processor can handle. I want to precess vector in length of 10M in less of 1 Sec.

If you could process each element of vec array independently and in parallel, CUDA would be great for you. But if you can’t, you’ll most likely be better of on a fast CPU. GPUs are much less efficient than CPUs in serial execution, they only achieve those high FLOPS counts when running a massively parallel application.