parallelize

Moderator: BarsMonster

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
chtulu
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

parallelize

Post by chtulu » Wed Apr 21, 2010 11:21 am

Hi,

Would it be possible to parallelize this combinations generator with cuda? If yes how?

// Generate combinations



c[1] = 1;
c[2] = 2;
c[3] = 3;
c[4] = 4;
c[5] = 5;
c[6] = 6;
c[7] = 50;
j = 6;




visit:




if (6&1)
{
if (c[1] + 1 < c[2]) {c[1] += 1; goto visit;}
else j = 2;
}
else
{
if (c[1] > 1) {c[1] -= 1; goto visit;}
else j = 2;
goto R5;
}

R4:
if (c[j] >= j+1)
{
c[j] = c[j-1];
c[j-1] = j-1;
goto visit;
}
j++;

R5:
if (c[j]+1 < c[j+1])
{
c[j-1] = c[j];
c[j] += 1;
goto visit;
}
j++;
if (j <= 6) goto R4;




thanks.

User avatar
schwarzwaldhacker
Posts: 170
Joined: Tue Apr 07, 2009 7:18 am
Location: Россия
Contact:

Re: parallelize

Post by schwarzwaldhacker » Wed Apr 21, 2010 6:01 pm

I don't really know what this is about? And I am sorry, I am very busy. So I can't spend too much time on it. But I guess the answer is YES?

Maybe each "if" like "if (6&1)" = one thread?

Whereby you should know that "multiples of 32 threads" are recommended because of speed.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest