Class CLProgram

    • Method Detail

      • build

        public CLProgram build()
        Builds this program for all devices associated with the context.
        Returns:
        this
      • build

        public CLProgram build​(CLBuildListener listener)
        Builds this program for all devices associated with the context.
        Parameters:
        listener - A listener who is notified when the program was built.
        Returns:
        this
        See Also:
        CLBuildListener
      • build

        public CLProgram build​(CLDevice... devices)
        Builds this program for the given devices.
        Parameters:
        devices - A list of devices this program should be build on or null for all devices of its context.
        Returns:
        this
      • build

        public CLProgram build​(CLBuildListener listener,
                               CLDevice... devices)
        Builds this program for the given devices.
        Parameters:
        listener - A listener who is notified when the program was built.
        devices - A list of devices this program should be build on or null for all devices of its context.
        Returns:
        this
        See Also:
        CLBuildListener
      • build

        public CLProgram build​(String options)
        Builds this program for all devices associated with the context using the specified build options.
        Returns:
        this
        See Also:
        CLProgram.CompilerOptions
      • build

        public CLProgram build​(String options,
                               CLDevice... devices)
        Builds this program for the given devices and with the specified build options. In case this program was already built and there are kernels associated with this program they will be released first before rebuild.
        Parameters:
        devices - A list of devices this program should be build on or null for all devices of its context.
        Returns:
        this
        See Also:
        CLProgram.CompilerOptions
      • build

        public CLProgram build​(CLBuildListener listener,
                               String options,
                               CLDevice... devices)
        Builds this program for the given devices and with the specified build options. In case this program was already built and there are kernels associated with this program they will be released first before rebuild.
        Parameters:
        devices - A list of devices this program should be build on or null for all devices of its context.
        listener - A listener who is notified when the program was built.
        Returns:
        this
        See Also:
        CLProgram.CompilerOptions, CLBuildListener
      • createCLKernel

        public CLKernel createCLKernel​(String kernelName)
        Creates a kernel with the specified kernel name.
      • createCLKernels

        public Map<String,​CLKernel> createCLKernels()
        Creates all kernels of this program and stores them a Map with the kernel name as key.
      • release

        public void release()
        Releases this program with its kernels.
        Specified by:
        release in interface CLResource
      • getCLDevices

        public CLDevice[] getCLDevices()
        Returns all devices associated with this program.
      • getBuildLog

        public String getBuildLog()
        Returns the build log of this program on all devices. The contents of the log are implementation dependent.
      • getBuildStatus

        public Map<CLDevice,​CLProgram.Status> getBuildStatus()
        Returns the build status enum of this program for each device as Map.
      • isExecutable

        public boolean isExecutable()
        Returns true if the build status 'BUILD_SUCCESS' for at least one device of this program exists.
      • getBuildLog

        public String getBuildLog​(CLDevice device)
        Returns the build log for this program on the specified device. The contents of the log are implementation dependent log can be an empty String.
      • getBuildStatus

        public CLProgram.Status getBuildStatus​(CLDevice device)
        Returns the build status enum for this program on the specified device.
      • setNoSource

        public void setNoSource()
        Must set this if the program is created from binary so we know not to call getSource(), which can SIGSEGV on Macs if there is no source.
      • getSource

        public String getSource()
        Returns the source code of this program. Note: sources are not cached, each call of this method calls into Open
      • getBinaries

        public Map<CLDevice,​byte[]> getBinaries()
        Returns the binaries for this program in an ordered Map containing the device as key and the program binaries as value.
      • optionsOf

        public static String optionsOf​(String... options)
        Utility method which builds a properly seperated option string.
      • define

        public static String define​(String name)
        Utility method for defining macros as build options (Returns "-D name").
      • define

        public static String define​(String name,
                                    Object value)
        Utility method for defining macros as build options (Returns "-D name=value").
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • close

        @Deprecated
        public final void close()
        Deprecated.
        This method is not intended to be called from client code.
        Implementation detail, satisfying AutoCloseable. Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface AutoCloseable
        See Also:
        AutoCloseable