Added tests for captured functions
このコミットが含まれているのは:
1 親
f7de2a2c65
コミット
541f0b425c
3ファイル変更
+40
-2
検索条件に一致するファイルはありません
@@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
namespace ComputeSharp.Tests
|
||||
{
|
||||
[TestClass]
|
||||
[TestCategory("IntrinsicTests")]
|
||||
[TestCategory("Intrinsics")]
|
||||
public class IntrinsicTests
|
||||
{
|
||||
[TestMethod]
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace ComputeSharp.Tests
|
||||
{
|
||||
[TestClass]
|
||||
[TestCategory("StaticFunctions")]
|
||||
public class StaticFunctionsTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void FloatToFloatFunc()
|
||||
{
|
||||
using ReadWriteBuffer<float> buffer = Gpu.Default.AllocateReadWriteBuffer<float>(1);
|
||||
|
||||
Func<float, float> square = StaticMethodsContainer.Square;
|
||||
|
||||
Gpu.Default.For(1, id => buffer[0] = square(3));
|
||||
|
||||
float[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InternalFloatToFloatFunc()
|
||||
{
|
||||
using ReadWriteBuffer<float> buffer = Gpu.Default.AllocateReadWriteBuffer<float>(1);
|
||||
|
||||
Func<float, float> square = StaticMethodsContainer.InternalSquare;
|
||||
|
||||
Gpu.Default.For(1, id => buffer[0] = square(3));
|
||||
|
||||
float[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace ComputeSharp.Tests
|
||||
}
|
||||
|
||||
[TestClass]
|
||||
[TestCategory("StaticMethodsTests")]
|
||||
[TestCategory("StaticMethods")]
|
||||
public class StaticMethodsTests
|
||||
{
|
||||
[TestMethod]
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする