3 bug in cudafying

Feb 16, 2014 at 12:42 PM
Hi guys,

I am using Cudafy 1.22 in C# and VS2012 targetting OPENCL, I Found out these two problems that is inside of Cudafy codes:

1) FIRST:

Suppose you have the following struct:
public struct test
{
    public byte[] input;
}

[Cudafy]
public static void kernel1(byte[] b)
{
   //do something here
}

[Cudafy]
public static void kernel2(test t)
{
   kernel1(t.input);
}
I know about array in struct limitations in cudafy, lets forget about using it for now. Now if you try to cudafy the code, it gives you something like this:
struct test {
   byte* input; int inputLength0;
}

void kernel1(byte* b, int b_length)
{
}

void kernel2(struct test t)
{
   kernel1(t.input, inputLength0); <--- this line is WRONG, "inputLength0" should be "t.inputLength0" !!
}
2) SECOND:
If you put a GThread in the first parameter of a function, it does not included at output opencl code at all!


3) THIRD:
if you want to assign first element of array "input" inside that struct like this:
t.inpute[0] = 10;
it generates:
t.input = 10;  <--- this line is WRONG, it should be "t.input[0] = 10;"
I was playing with my code for 2 days, but couldn't find a solution to these problems.

Would you please take a look into cudafy source codes to fix this.

Thanks.
Feb 17, 2014 at 10:00 AM
Hi
I don't know about 2), but the others pretain a feature that, like you said, isn't supported by cudafy (with good reason!), so one can't really expect those to work, imo.
Or am I missing something?