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.
parallelize
Moderator: BarsMonster
- schwarzwaldhacker
- Posts: 170
- Joined: Tue Apr 07, 2009 7:18 am
- Location: Россия
- Contact:
Re: parallelize
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.
Maybe each "if" like "if (6&1)" = one thread?
Whereby you should know that "multiples of 32 threads" are recommended because of speed.
Who is online
Users browsing this forum: No registered users and 1 guest