Campy
Campy copied to clipboard
CUDA error: invalid argument
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])));

It works in console, but failed in UnitTest project.

Got it. Thanks for point this out. Looks like a problem as a unit test, under Net Framework 461.
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
Sounds great, allocate larger memory is important for me to do my Machine Learning library.