You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Empty array can't be given as an argument to kernel.
let mutable oclContext = OpenCLEvaluationContext()
let workGroupSize = 256
let workSize n = n - n % workGroupSize + workGroupSize
let len = 0
let command =
<@
fun (ndRange: _1D)
(xs: int[]) ->
let i = ndRange.GlobalID0
if i < len then xs.[i] <- 42
@>
let xs = Array.zeroCreate len
opencl {
do! RunCommand command <| fun kernelPrepare -> kernelPrepare (_1D(workSize len, workGroupSize)) xs
}
|> oclContext.RunSync
For the code above this exception is thrown:
Unhandled exception. Brahma.OpenCL.CLException: InvalidBufferSize
at Brahma.OpenCL.Commands.RunBase`1.ArrayToMem(Object data, Type t)
at Brahma.OpenCL.Commands.RunBase`1.ToIMem(Object arg)
at Brahma.OpenCL.Commands.RunBase`1.SetupArgument(Object sender, Int32 index, Object arg)
at lambda_method(Closure , Run`1 , Int32 , Object )
at Microsoft.FSharp.Collections.ArrayModule.IterateIndexed[T](FSharpFunc`2 action, T[] array) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\array.fs:line 332
at lambda_method(Closure , FSharpFunc`2 , Object[] )
at lambda_method(Closure , Unit , _1D , Int32[] )
at [email protected](FSharpFunc`2 kernelPrepare) in E:\Projects\GraphBLAS-sharp\src\app\Program.fs:line 28
at Brahma.FSharp.OpenCL.WorkflowBuilder.Basic.RunCommand@33-1.Invoke(OpenCLEvaluationContext _arg1)
at [email protected](OpenCLEvaluationContext env)
at [email protected](OpenCLEvaluationContext env)
at Brahma.FSharp.OpenCL.WorkflowBuilder.Basic.OpenCLEvaluationContext.RunSync[a](OpenCLEvaluationContext this, OpenCLEvaluation`1 _arg1)
at Program.main(String[] argv) in E:\Projects\GraphBLAS-sharp\src\app\Program.fs:line 27
Thus array emptyness check is required which is inconvenient.
The text was updated successfully, but these errors were encountered:
Empty array can't be given as an argument to kernel.
For the code above this exception is thrown:
Thus array emptyness check is required which is inconvenient.
The text was updated successfully, but these errors were encountered: