niravshah .
Joined: 18 Mar 2010 Posts: 11
|
Posted: Fri Jun 11, 2010 9:10 pm Post subject: How to return results from kernel |
|
|
I have kerne running with and want to return a set of six integers back to the host code.
Well i dont know how many set i would be getting in advance . It is possible that i might not get any.
Any thoughts on how can i do this i am attaching the kernel code here
kernel void threadABC(int startRange,out int a<> )
{
int X,Y,Z;
int A,B,C;
int gcdAB,gcdAC,gcdBC;
float N = 4093.0f;
//using the index of the output stream as the values for A,B,C
A = instance().x+startRange;
B = instance().y+startRange;
C = instance().z+startRange;
// intialising a to 0 so that when we filter the reuslts we can know that 0 means that
//location does not have a reuslt.
a=0;
gcdAB = findGcd(A,B);
gcdAC = findGcd(A,C);
gcdBC = findGcd(B,C);
if(gcdAB==1 && gcdAC==1 && gcdBC==1){
for( X = 3; X < 10; X++)
{
for( Y = 3; Y < 10; Y++)
{
for( Z = 3; Z < 10; Z++)
{
float sum = modulusPower((float)A,X)+modulusPower((float)B, Y);
float cpowerZ = modulusPower((float)C,Z);
sum = fmod(sum,N);
if(cpowerZ == sum){
// here the possible solution should be stored and returned to host code
//have to figure out the way to return the values of A,B,C,X,Y,Z to host
}
}
}
}
}
http://forums.amd.com/devforum/messageview.cfm?catid=328&threadid=133921&enterthread=y |
|