예제 #1
0
        public static KernelResult Run(this JittedFunction function, dim3 gridDim, dim3 blockDim, IEnumerable<KernelArgument> args)
        {
            function.AssertNotNull();
            args = args ?? Seq.Empty<KernelArgument>().ToArray();
            CudaDriver.Ensure();

            var invocation = new KernelInvocation(function, args);
            return invocation.Launch(gridDim, blockDim);
        }
예제 #2
0
 public KernelResult Run(dim3 gridDim, dim3 blockDim, IEnumerable<KernelArgument> args)
 {
     var invocation = new KernelInvocation(this, args);
     return invocation.Launch(gridDim, blockDim);
 }
예제 #3
0
        public static Object Invoke(this JittedFunction function, dim3 gridDim, dim3 blockDim, IEnumerable<KernelArgument> args)
        {
            function.AssertNotNull();
            args = args ?? Seq.Empty<KernelArgument>().ToArray();
            CudaDriver.Ensure();

            var invocation = new KernelInvocation(function, args);
            var invocation_result = invocation.Launch(gridDim, blockDim);
            var result = invocation_result.Result;
            args.ForEach(arg => arg.Dispose());
            return result;
        }