VisualStudio shows an error when adding GpuManaged

2019-03-04 00:09发布

问题:

I get Fody/Alea: TODO Transform: ILLabel error in VS, when trying to compile following code:

static void Main(string[] args)
{
    var gpu = Gpu.Default;
    gpu.For(0, 100, idx => Do(idx));

    Console.ReadKey();
}

[GpuManaged]
public static void Do(int idx)
{
    bool isTrue = false;
    bool one = true;
    bool two = true;

    for (int i = 0; i < 10; i++)
    {
        if (isTrue)
        {
            if (one)
                continue;

            isTrue = false;
        }
        else
        {
            if (two)
                continue;

            isTrue = true;
        }
    }
}

The issue is only reproducible when putting the [GpuManaged] attribute. Also I have noticed that if you remove if (one) continue; and if (two) continue; then error disappears. How do I fix it?

The code was simplified a lot from my actual solution, but this should be enough to see the issue..

  • win 10 x64
  • alea 3.0.4
  • alea.fody 3.0.4
  • fsharp.core 4.3.4
  • geforce GT 710
标签: c# aleagpu