Campy icon indicating copy to clipboard operation
Campy copied to clipboard

CUDA error: invalid argument

Open Oceania2018 opened this issue 7 years ago • 4 comments

            int n = 10;
            var rand = new Random();
            double[] x = new double[n];
            double[] y = new double[n];
            for (int i = 0; i < n; i++)
            {
                x[i] = rand.NextDouble();
            }

            Campy.Parallel.For(n, i => y[i] = 1 / (1 + Math.Pow(Math.E, -x[i])));

image

It works in console, but failed in UnitTest project.

Oceania2018 avatar Oct 05 '18 17:10 Oceania2018

image

Oceania2018 avatar Oct 05 '18 18:10 Oceania2018

Got it. Thanks for point this out. Looks like a problem as a unit test, under Net Framework 461.

kaby76 avatar Oct 06 '18 11:10 kaby76

The problem is the C# garbage collector--it needs to be rewritten for the GPU. I'll stub out the GC for now and fix up the allocator so it allocates a larger reserve, and expose that for you to fine tune. -Ken

kaby76 avatar Oct 06 '18 17:10 kaby76

Sounds great, allocate larger memory is important for me to do my Machine Learning library.

Oceania2018 avatar Oct 06 '18 18:10 Oceania2018