Record Class CLEnvironmentOptions

java.lang.Object
java.lang.Record
foundry.veil.api.opencl.CLEnvironmentOptions
Record Components:
version - The minimum required version
deviceMask - The mask for what types of devices should be used
requireCompiler - Whether the device needs to be able to compile program sources
requireOpenGL - Whether the device needs to be able to support a mixed OpenGL/OpenCL environment

public record CLEnvironmentOptions(CLEnvironmentOptions.CLVersion version, int deviceMask, boolean requireCompiler, boolean requireOpenGL) extends Record
Defines requirements for an OpenCL environment when requesting one from VeilOpenCL.
  • Field Details

  • Constructor Details

    • CLEnvironmentOptions

      public CLEnvironmentOptions(CLEnvironmentOptions.CLVersion version, int deviceMask, boolean requireCompiler, boolean requireOpenGL)
      Creates an instance of a CLEnvironmentOptions record class.
      Parameters:
      version - the value for the version record component
      deviceMask - the value for the deviceMask record component
      requireCompiler - the value for the requireCompiler record component
      requireOpenGL - the value for the requireOpenGL record component
  • Method Details

    • testDevice

      public boolean testDevice(VeilOpenCL.DeviceInfo deviceInfo)
      Tests if the specified device follows the required options specified.
      Parameters:
      deviceInfo - The device to test
      Returns:
      Whether the device has all requirements
    • builder

      public static CLEnvironmentOptions.Builder builder()
      Returns:
      A new builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • version

      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • deviceMask

      public int deviceMask()
      Returns the value of the deviceMask record component.
      Returns:
      the value of the deviceMask record component
    • requireCompiler

      public boolean requireCompiler()
      Returns the value of the requireCompiler record component.
      Returns:
      the value of the requireCompiler record component
    • requireOpenGL

      public boolean requireOpenGL()
      Returns the value of the requireOpenGL record component.
      Returns:
      the value of the requireOpenGL record component