Repository: systemml Updated Branches: refs/heads/master f69047ea4 -> 5da8132ea
[SYSTEMML-445] Guard JCudaKernels with sysml.gpu.sync.postProcess flag Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/5da8132e Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/5da8132e Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/5da8132e Branch: refs/heads/master Commit: 5da8132ea8c165d6d1a65c2c293fc87aaa15a2a3 Parents: f69047e Author: Niketan Pansare <[email protected]> Authored: Wed Jan 31 21:38:29 2018 -0800 Committer: Niketan Pansare <[email protected]> Committed: Wed Jan 31 21:38:29 2018 -0800 ---------------------------------------------------------------------- .../sysml/runtime/instructions/gpu/context/JCudaKernels.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/5da8132e/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/JCudaKernels.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/JCudaKernels.java b/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/JCudaKernels.java index d22110d..181b08d 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/JCudaKernels.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/gpu/context/JCudaKernels.java @@ -27,6 +27,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.HashMap; +import org.apache.sysml.api.DMLScript; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.io.IOUtilFunctions; import org.apache.sysml.runtime.matrix.data.LibMatrixCUDA; @@ -110,7 +111,8 @@ public class JCudaKernels { checkResult(cuLaunchKernel(function, config.gridDimX, config.gridDimY, config.gridDimZ, config.blockDimX, config.blockDimY, config.blockDimZ, config.sharedMemBytes, config.stream, Pointer.to(kernelParams), null)); - JCuda.cudaDeviceSynchronize(); + if(DMLScript.SYNCHRONIZE_GPU) + JCuda.cudaDeviceSynchronize(); } public static void checkResult(int cuResult) throws DMLRuntimeException {
