TypeInitializationException thrown by aleagpu

I am trying to use aleagpu, but I am getting a System.TypeInitializationException. I tried to solve what the problem was, but I could not find a solution, so please help. The program is the simplest:

class Klazz { private const int N = 100; private const int Length = 10000000; var gpu = Gpu.Default;// here is the Exception thrown public static void Unmanaged() { var data = new int[Length]; for (var k = 0; k < N; k++) gpu.For(0, data.Length, i => data[i] += 1); } } 

I assume that something is wrong with my installation because the program is a copied example from the aleagpu home page.

My system:

  • Windows 10
  • .NET v4.5.2
  • Community VS 2015 NVIDIA GPU Computing Toolkit CUDA v8.0

Alea is installed from NuGet on November 9th. 2016

  • Alea (3.0.1)
  • Alea.IL (2.2.0.3307)
  • Alea.CUDA (2.2.0.3307)
  • Alea.CUDA.IL (2.2.0.3307)
  • Alea.CUDA.Unbound (2.2.0.3307)

The variables in the PATH are correct.

I also tried AleaSample.CS.ParallelForAutoMemMgt with the same result.

+4
c # aleagpu
source share
2 answers

It turns out that aleagpu is written in F # , and when installing FSharp.Core, the program works. Thanks to Ghosthack for answering the question: Alea GPU tutorial does not compile on VS 2015 Update 2 with FSharp.Core 4.4.0.0

+4
source share

Also, make sure that you are either installing version 2.2 or version 3.x. For the new version 3.x, you need to install the Alea or Alea.Fody package [ https://www.nuget.org/packages/Alea/3.0.1†[1] and not mix with 2.2.

+1
source share

All Articles