Module openj9.cuda
Package com.ibm.cuda

Class CudaKernel.Parameters

java.lang.Object
com.ibm.cuda.CudaKernel.Parameters
All Implemented Interfaces:
Cloneable
Enclosing class:
CudaKernel

public static final class CudaKernel.Parameters extends Object implements Cloneable
The Parameters class represents the actual parameters in a kernel launch.
  • Constructor Details

    • Parameters

      public Parameters(int count)
      Creates a new bundle of parameter values.
      Parameters:
      count - the number of values to be passed when the kernel is launched
      Throws:
      IllegalArgumentException - if the count is negative or greater than 64
    • Parameters

      public Parameters(Object... values)
      Creates a new bundle of parameter values.

      Each parameter value must be one of the following:

      • a boxed primitive value
      • a CudaBuffer object
      • null
      Parameters:
      values - the values to be passed when the kernel is launched
      Throws:
      IllegalArgumentException - if parameters contains any unsupported types
    • Parameters

      public Parameters(CudaKernel.Parameters that)
      Creates a copy of the given parameter block.
      Parameters:
      that - the parameter block to be copied
  • Method Details

    • add

      public CudaKernel.Parameters add(byte value)
      Appends a byte value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(char value)
      Appends a character value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(CudaBuffer value)
      Appends a buffer address to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched, or null to pass a null pointer
      Returns:
      this parameter list
      Throws:
      IllegalStateException - if the buffer has been closed (see CudaBuffer.close())
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(double value)
      Appends a double value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(float value)
      Appends a float value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(int value)
      Appends a integer value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(long value)
      Appends a long value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • add

      public CudaKernel.Parameters add(short value)
      Appends a short value to the list of parameter values.
      Parameters:
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if all positions already have values defined
    • clone

      public CudaKernel.Parameters clone()
      Creates a copy of this parameter block.
      Overrides:
      clone in class Object
      Returns:
      Object a shallow copy of this object.
    • set

      public CudaKernel.Parameters set(int index, byte value)
      Replaces the parameter at the specified index with the given byte value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, char value)
      Replaces the parameter at the specified index with the given character value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, CudaBuffer value)
      Replaces the parameter at the specified index with the given buffer address.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched, or null to pass a null pointer
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, double value)
      Replaces the parameter at the specified index with the given double value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, float value)
      Replaces the parameter at the specified index with the given float value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, int value)
      Replaces the parameter at the specified index with the given int value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, long value)
      Replaces the parameter at the specified index with the given long value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list
    • set

      public CudaKernel.Parameters set(int index, short value)
      Replaces the parameter at the specified index with a short value.
      Parameters:
      index - the index of the parameter to be set
      value - the value to be passed when the kernel is launched
      Returns:
      this parameter list
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= the size of this parameter list