我正在尝试Gpu.Default.For
从 Alea GPU 库中使用,但我不断收到异常:
i32 is not a struct type error.
这个错误是什么意思,为什么我用这个简单的Gpu.Default.For
循环得到它?
for (Int32 j = 0; j <= TimePeriodArray.Length - 1; j++)
//Gpu.Default.For(0, TimePeriodArray.Length - 1, j =>
{
Int32 days = TimePeriodArray[j];
Double[] CalcResult = new Double[CloseArray.Length];
for (Int32 Index = days; Index <= CloseArray.Length - 1; Index++)
{
Gpu.Default.For(Index - 1, Index - days, i =>
{
CalcResult[Index] = CalcResult[Index] + CloseArray[i];
});
CalcResult[Index] = CalcResult[Index] / days;
}
CalcResultsList.Add(CalcResult);
//});
}