- 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
TheParametersclass represents the actual parameters in akernellaunch.
-
-
Constructor Summary
Constructors Constructor Description Parameters(int count)Creates a new bundle of parameter values.Parameters(CudaKernel.Parameters that)Creates a copy of the given parameter block.Parameters(Object... values)Creates a new bundle of parameter values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CudaKernel.Parametersadd(byte value)Appends a byte value to the list of parameter values.CudaKernel.Parametersadd(char value)Appends a character value to the list of parameter values.CudaKernel.Parametersadd(double value)Appends a double value to the list of parameter values.CudaKernel.Parametersadd(float value)Appends a float value to the list of parameter values.CudaKernel.Parametersadd(int value)Appends a integer value to the list of parameter values.CudaKernel.Parametersadd(long value)Appends a long value to the list of parameter values.CudaKernel.Parametersadd(short value)Appends a short value to the list of parameter values.CudaKernel.Parametersadd(CudaBuffer value)Appends a buffer address to the list of parameter values.CudaKernel.Parametersclone()Creates a copy of this parameter block.CudaKernel.Parametersset(int index, byte value)Replaces the parameter at the specified index with the given byte value.CudaKernel.Parametersset(int index, char value)Replaces the parameter at the specified index with the given character value.CudaKernel.Parametersset(int index, double value)Replaces the parameter at the specified index with the given double value.CudaKernel.Parametersset(int index, float value)Replaces the parameter at the specified index with the given float value.CudaKernel.Parametersset(int index, int value)Replaces the parameter at the specified index with the given int value.CudaKernel.Parametersset(int index, long value)Replaces the parameter at the specified index with the given long value.CudaKernel.Parametersset(int index, short value)Replaces the parameter at the specified index with a short value.CudaKernel.Parametersset(int index, CudaBuffer value)Replaces the parameter at the specified index with the given buffer address.
-
-
-
Constructor Detail
-
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- ifparameterscontains 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 Detail
-
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 (seeCudaBuffer.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.
-
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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched, or null to pass a null pointer- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= 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 setvalue- the value to be passed when the kernel is launched- Returns:
- this parameter list
- Throws:
IndexOutOfBoundsException- ifindex< 0 orindex>= the size of this parameter list
-
-