Skip to content

Commit

Permalink
closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrieleCocco committed Jan 31, 2016
1 parent 532aab8 commit c54eced
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/FSCL.Compiler.Tests/DynamicDefineTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ let ``Can compile module kernel using module field from inside and outside modul
let compiler, a, b, c, size, wrapper = GetData()

let insideResult = KernelModule.Compile(compiler, size, a, b, c)
Assert.NotNull(insideResult)
Assert.IsNotEmpty((insideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines)
Assert.IsNotNull(insideResult)
Assert.IsFalse((insideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines.Count = 0)
Assert.AreEqual(FirstConstDefineValue(insideResult, None), 10.0f)
let outsideResult = compiler.Compile<IKernelExpression>(<@ KernelModule.VectorAddModule(size, a, b, c) @>)
Assert.NotNull(outsideResult)
Assert.IsNotEmpty((outsideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines)
Assert.IsNotNull(outsideResult)
Assert.IsFalse((outsideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines.Count = 0)
Assert.AreEqual(FirstConstDefineValue(outsideResult, None), 10.0f)

let log, success = TestUtil.TryCompileOpenCL((insideResult.KFGRoot :?> KFGKernelNode).Module)
Expand All @@ -170,7 +170,7 @@ let ``Can compile kernel using instance field from inside and outside instance``
let compiler, a, b, c, size, wrapper = GetData()

let insideResult = wrapper.CompileVectorAddUsingField(compiler, size, a, b, c)
Assert.IsNotEmpty((insideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines)
Assert.IsFalse((insideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines.Count = 0)
Assert.AreEqual(FirstConstDefineValue(insideResult, Some(wrapper)), 10.0f)
let outsideResult = compiler.Compile<IKernelExpression>(<@ wrapper.VectorAddUsingField(size, a, b, c) @>)
Assert.IsNotEmpty((outsideResult.KFGRoot :?> KFGKernelNode).Module.ConstantDefines)
Expand Down
2 changes: 1 addition & 1 deletion tests/FSCL.Compiler.Tests/KernelCompilationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,6 @@ let ``compile in a maths sin``() =
let a = Array.zeroCreate<float32> 10
let b = Array.zeroCreate<float32> 10
let ws = WorkSize(10L)
let result = compiler.Compile(<@ sinIt(a,b,ws) @>) :?> IKernelExpression
let result = compiler.Compile<IKernelExpression>(<@ sinIt(a,b,ws) @>)
let code = (result.KFGRoot :?> KFGKernelNode).Module.Code.Value
Assert.That(code, Contains.Substring("sin(a[i])"))

0 comments on commit c54eced

Please sign in to comment.