Class JCudaKernels

  • java.lang.Object
    • org.apache.sysml.runtime.instructions.gpu.context.JCudaKernels

  • public class JCudaKernels
    extends Object
    Utility class that allows LibMatrixCUDA as well as JCudaObject to invoke custom CUDA kernels. The utility org.apache.sysml.runtime.instructions.gpu.context.JCudaKernels simplifies the launching of the kernels. For example: to launch a kernel copyUpperToLowerTriangleDense<<1,1,32,32>>(jcudaDenseMatrixPtr, dim, dim*dim) , the user has to call: kernels.launchKernel("copyUpperToLowerTriangleDense", new ExecutionConfig(1,1,32,32), jcudaDenseMatrixPtr, dim, dim*dim)
    • Constructor Detail

      • JCudaKernels

        public JCudaKernels()
                     throws DMLRuntimeException
        Loads the kernels in the file ptxFileName. Though cubin files are also supported, we will stick with ptx file as they are target-independent similar to Java's .class files.
        DMLRuntimeException - if DMLRuntimeException occurs
    • Method Detail

      • shutdown

        public void shutdown()
        Performs cleanup actions such as unloading the module
      • launchKernel

        public void launchKernel(String name,
                                 ExecutionConfig config,
                                 Object... arguments)
                          throws DMLRuntimeException
        Setups the kernel parameters and launches the kernel using cuLaunchKernel API. This function currently supports two dimensional grid and blocks.
        name - name of the kernel
        config - execution configuration
        arguments - can be of type Pointer, long, double, float and int
        DMLRuntimeException - if DMLRuntimeException occurs

Copyright © 2017 The Apache Software Foundation. All rights reserved.