m4rs-mt / ILGPU

ILGPU JIT Compiler for high-performance .Net GPU programs
http://www.ilgpu.net
Other
1.31k stars 115 forks source link

Version 0.10 has problem that was not with 0.9.2 #443

Closed AbedKarmi closed 3 years ago

AbedKarmi commented 3 years ago

it gives error "a ptx jit compilation failed" when executing the following line, when comment Maht.Pow and modulus %, it works!. previous version was ok.

var kernel = accelerator.LoadAutoGroupedStreamKernel<
    Index1,
    double,
    double,
    ArrayView<double>,
    char>(MathKernel);

 public static void MathKernel(Index1 index,                    // The global thread index (1D in this case)
                              double P,
                              double Q,
                              ArrayView<double> result,
                              char func)
        {
            double R = 1;

            switch (func)
            {
                case '+':
                    R = P + Q;
                    break;
                case '-':
                    R = P - Q;
                    break;
                case '*':
                    R = P * Q;
                    break;
                case '/':
                    R = P / Q;
                    break;
                case '^': R = Math.Pow(P , Q);
                     break;
                case '%':
                    R = P % Q; ;
                    break;
                default:
                    R = 0;
                    break;
            }
            result[0] = R;
        }
MoFtZ commented 3 years ago

@AbedKarmi I am currently assuming that you are using ILGPU v0.9.2 and ILGPU.Algorithms v0.9.2. Further, you upgraded to ILGPU v0.10.0, which is causing your a ptx jit compilation failed issue.

The reason is that ILGPU v0.10.0 is not compatible with ILGPU.Algorithms v0.9.2 - there was a breaking change in the ILGPU APIs.

You should either use:

Hope that helps.