Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTX compilation failed with bytes #15

Closed
samy2 opened this issue Mar 4, 2019 · 2 comments
Closed

PTX compilation failed with bytes #15

samy2 opened this issue Mar 4, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@samy2
Copy link

samy2 commented Mar 4, 2019

Hi,
I tested today the master branch (commit cf83683).
All the bugs I reported are corrected (great work!), except this one :

    [Test]
    public void CompilationTest3()
    {
        using (var context = new Context())
        {
            using (var gpu = new CudaAccelerator(context, 0))
            {
                var method = GetType().GetMethod(nameof(Kernel3), BindingFlags.NonPublic | BindingFlags.Static);
                var compiledKernel = gpu.Backend.Compile(method, KernelSpecialization.Empty);
                var loadedKernel = gpu.LoadKernel(compiledKernel);
                loadedKernel.Dispose();
            }
        }
    }

    private static void Kernel3(GroupedIndex index, ArrayView<float> array)
    {
        byte b = 1;
        for (int i = 0; i < 2; i++)
        {
            if (b > 1)
            {
                array[0] = 1;
            }
            b = 2;
        }
    }

The exception I get : ILGPU.Runtime.Cuda.CudaException : 'a PTX JIT compilation failed'

@m4rs-mt m4rs-mt self-assigned this Mar 4, 2019
@m4rs-mt m4rs-mt added the bug label Mar 4, 2019
@m4rs-mt m4rs-mt added this to the v0.5.1 milestone Mar 4, 2019
@m4rs-mt
Copy link
Owner

m4rs-mt commented Mar 4, 2019

It turns out that the PTX backend still generates some invalid movement instructions (in this case for temporary registers). The problem will be fixed in the next commit.

BTW you can also use

using ILGPU.Runtime;
...
var kernel = gpu.LoadKernel<GroupedIndex, ArrayView<float>>(Kernel3);

to load your kernel. However, you cannot inspect the generated PTX code in this case.

m4rs-mt added a commit that referenced this issue Mar 4, 2019
@m4rs-mt m4rs-mt closed this as completed Mar 5, 2019
@samy2
Copy link
Author

samy2 commented Mar 5, 2019

I confirm that it works with the last commit! Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants