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

Illegal memory access with double[,] ab=new double[2,2] #86

Closed
GeoBIM2020 opened this issue Apr 30, 2020 · 3 comments
Closed

Illegal memory access with double[,] ab=new double[2,2] #86

GeoBIM2020 opened this issue Apr 30, 2020 · 3 comments
Labels
feature A new feature (or feature request)

Comments

@GeoBIM2020
Copy link

I have a kernel using multiple array, "illegal memory access.." is thrown when running after updating to 0.8-beta2. It worked before with version released on March 10. Doesn't the latest version support multiple array in kernel? or because of some other problem? I have attached the test project to see if anyone can replicate the problem. Thanks!

internal static void TestKernel(ArrayView array1
)
{
double[,] ab = new double[2, 2];
for (int ielem = Grid.GlobalIndex.X; ielem < array1.Length; ielem +=
WindowsFormsApp1.zip
GridExtensions.GridStrideLoopStride)
{
ab[0, 1] = array1[ielem];
ab[0, 0] = array1[ielem];
}
}

@MoFtZ
Copy link
Collaborator

MoFtZ commented Apr 30, 2020

@toolwtech, I can reproduce your issue. My guess is that ILGPU does not currently support multi-dimensional arrays.

When I changed the kernel to one-dimension, it works for me.

internal static void TestKernel(ArrayView<double> array1)
{
    double[] ab = new double[4];
    for (int ielem = Grid.GlobalIndex.X; ielem < array1.Length; ielem += GridExtensions.GridStrideLoopStride)
    {
        ab[0] = array1[ielem];
        ab[1] = array1[ielem];
    }
}

@m4rs-mt
Copy link
Owner

m4rs-mt commented Apr 30, 2020

@toolwtech The new compiler release uses a completely different code-generation path leveraging different code optimization transformations. Support for array values has always been considered to be in an "alpha" state so far. However, the new version ensures valid code generation for single-dimensional arrays. We are going to extend these officially supported array features in the near future 🔢

@m4rs-mt m4rs-mt added the feature A new feature (or feature request) label Apr 30, 2020
@GeoBIM2020
Copy link
Author

Got you, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature (or feature request)
Projects
None yet
Development

No branches or pull requests

3 participants