0

I am trying to learn CUDA and want to know how to deal with nested loops and things I was wondering how you might code this in CUDA

float a[1024][1024], b[1024];
		for (i=0; i<1024; i++)
			for (j=0; j<1024‐i; j++)
				b[i+j] += arbitrary_function(a[i][j]);
2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by Phaelax
0

That's basically it, it's still C++ code really. Since CUDA can be used with C#, C++, Python, Java, possibly others, it's really just an extension to provide access to the GPU through whatever language you're currently using.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.