Added test for implicit local function

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-05 18:10:16 +02:00
1 親 9533515fa6
コミット c706e64940
1ファイル変更
+14
+14
ファイルの表示
@@ -121,5 +121,19 @@ namespace ComputeSharp.Tests
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
}
[TestMethod]
public void StatelessLocalFunction()
{
using ReadWriteBuffer<float> buffer = Gpu.Default.AllocateReadWriteBuffer<float>(1);
float f(float x) => x * x;
Gpu.Default.For(1, id => buffer[0] = f(3));
float[] result = buffer.GetData();
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
}
}
}