Class ClearCLKernel

    • Method Detail

      • getName

        public String getName()
        Returns kernel name
        Returns:
        kernel name
      • getSourceCode

        public String getSourceCode()
        Returns source code
        Returns:
        source code
      • getGlobalOffsets

        public long[] getGlobalOffsets()
        Return global offsets.
        Returns:
        global offsets
      • setGlobalOffsets

        public void setGlobalOffsets​(long... pGlobalOffsets)
        Sets the global offsets.
        Parameters:
        pGlobalOffsets - new global offsets
      • getGlobalSizes

        public long[] getGlobalSizes()
        returns the global sizes
        Returns:
        global sizes
      • setGlobalSizes

        public void setGlobalSizes​(long... pGlobalSizes)
        Sets the global sizes
        Parameters:
        pGlobalSizes - global sizes
      • setGlobalSizes

        public void setGlobalSizes​(ClearCLImageInterface pImage)
        Sets the global sizes to the dimensions of a image (1D, 2D, or 3D)
        Parameters:
        pImage - image
      • getLocalSizes

        public long[] getLocalSizes()
        Returns the local sizes.
        Returns:
        local sizes
      • setLocalSizes

        public void setLocalSizes​(long... pLocalSizes)
        Sets the local sizes.
        Parameters:
        pLocalSizes - local sizes
      • isArgumentCaching

        public boolean isArgumentCaching()
        Returns true if arguments are cached.
        Returns:
        true if caching active, false otherwise
      • setArgumentCaching

        public void setArgumentCaching​(boolean pArgumentCaching)
        Sets argument caching. This prevents resubmitting an argument which value is unchanged. Caching is on by default.
        Parameters:
        pArgumentCaching - true for cacging, false otherwise
      • clearArguments

        public void clearArguments()
        Clears arguments.
      • setArgument

        public void setArgument​(int pIndex,
                                Object pObject)
        Sets argument for a given argument index.
        Parameters:
        pIndex - argument index
        pObject - argument
      • getArgument

        public Object getArgument​(int pIndex)
        Return argument value for a given argument index.
        Parameters:
        pIndex - argument index
        Returns:
        value
      • setArguments

        public void setArguments​(Object... pArguments)
        Sets the kernel arguments for the next kernel run.
        Parameters:
        pArguments - list of arguments
      • setArgument

        public void setArgument​(String pArgumentName,
                                Object pObject)
        Sets argument for a given argument name. If argument is unknown for kernel, an exception is thrown.
        Parameters:
        pArgumentName - argument name
        pObject - argument
      • hasArgument

        public boolean hasArgument​(String pArgumentName)
      • getArgument

        public Object getArgument​(String pArgumentName)
        Return argument value for a given argument name.
        Parameters:
        pArgumentName - argument name
        Returns:
        value
      • setLocalMemoryArgument

        public void setLocalMemoryArgument​(String pArgumentName,
                                           net.haesleinhuepf.clij.coremem.enums.NativeTypeEnum pNativeTypeEnum,
                                           long pNumberOfElements)
        Sets a local memory argument for the kernel.
        Parameters:
        pArgumentName - argument name
        pNativeTypeEnum - native type for elements
        pNumberOfElements - number of elements
      • setOptionalArgument

        public boolean setOptionalArgument​(String pArgumentName,
                                           Object pObject)
        Sets optional argument for a given argument name.
        Parameters:
        pArgumentName - argument name
        pObject - argument
        Returns:
        true is argument set, false if argument unknown
      • run

        public void run()
        Executes kernel for current set of arguments on default queue (blocking call until kernel finishes).
        Specified by:
        run in interface Runnable
      • run

        public void run​(boolean pWaitToFinish)
        Executes kernel for current set of arguments on default queue.
        Parameters:
        pWaitToFinish - if true the call is blocking, false otherwise
      • run

        public void run​(ClearCLQueue pClearCLQueue,
                        boolean pWaitToFinish)
        Executes kernel for current set of arguments on provided queue. IMPORTANT: about blocking calls: there is a cost associated to waiting for a kernel to finish... If you execute several kernels in the same queue, you do no need to wait.
        Parameters:
        pClearCLQueue - queue
        pWaitToFinish - if true the call is blocking, false otherwise
      • isLogExecutionTime

        public boolean isLogExecutionTime()
        Returns true if execution times for this kernel should be logged.
        Returns:
        true if logging on.
      • setLogExecutionTime

        public void setLogExecutionTime​(boolean pLogExecutionTime)
        Sets whether this kernel should log its execution time.
        Parameters:
        pLogExecutionTime - true for logging