J'ai démarré un nouveau projet d'application de console VS2017 C# et ai installé Alea et Alea.Fody à partir du gestionnaire de paquets. Exécution d'un morceau de code échantillon du site Web m'a donné l'exception suivante.Alea 3.0.3 Exemple de programme C# se bloquant en référence à F # System.TypeInitializationException
System.TypeInitializationException se sont produits HResult = 0x80131534 message = Le type initialiseur pour 'Alea.GlobalImplicitMemoryTracker' a lancé une exception. Source = Alea STACKTRACE: à Alea.GlobalImplicitMemoryTracker.GetInManagedFlag() à gputest.Program.DelegateWithClosureGpu() à gputest.Program.Main (String [] args) dans c: \ Users \ myuser \ documents \ Visual Studio 2017 \ Projects \ gputest \ gputest \ Program.cs: ligne 14
exception interne 1: TypeInitializationException: l'initialiseur de type pour 'A.cf5aded17df9f7cc4c132234dda010fa7' a généré une exception.
Exception interne 2: FileNotFoundException: Impossible de charger le fichier ou l'assembly 'FSharp.Core, Version = 4.4.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a' ou une de ses dépendances. Le système ne peut pas trouver le fichier spécifié.
Voici l'intégralité du programme.
using Alea;
using Alea.Parallel;
using System.Linq;
namespace gputest
{
class Program
{
private const int Length = 1000000;
static void Main(string[] args)
{
DelegateWithClosureGpu();
}
[GpuManaged]
public static void DelegateWithClosureGpu()
{
var arg1 = Enumerable.Range(0, Length).ToArray();
var arg2 = Enumerable.Range(0, Length).ToArray();
var result = new int[Length];
Gpu.Default.For(0, result.Length, i => result[i] = arg1[i] + arg2[i]);
var expected = arg1.Zip(arg2, (x, y) => x + y);
//Assert.That(result, Is.EqualTo(expected));
}
}
}