Class CudaKernel.Parameters
java.lang.Object
com.ibm.cuda.CudaKernel.Parameters
- All Implemented Interfaces:
Cloneable
- Enclosing class:
CudaKernel
The
Parameters
class represents the actual parameters in
a kernel
launch.-
Constructor Summary
ConstructorDescriptionParameters
(int count) Creates a new bundle of parameter values.Creates a copy of the given parameter block.Parameters
(Object... values) Creates a new bundle of parameter values. -
Method Summary
Modifier and TypeMethodDescriptionadd
(byte value) Appends a byte value to the list of parameter values.add
(char value) Appends a character value to the list of parameter values.add
(double value) Appends a double value to the list of parameter values.add
(float value) Appends a float value to the list of parameter values.add
(int value) Appends a integer value to the list of parameter values.add
(long value) Appends a long value to the list of parameter values.add
(short value) Appends a short value to the list of parameter values.add
(CudaBuffer value) Appends a buffer address to the list of parameter values.clone()
Creates a copy of this parameter block.set
(int index, byte value) Replaces the parameter at the specified index with the given byte value.set
(int index, char value) Replaces the parameter at the specified index with the given character value.set
(int index, double value) Replaces the parameter at the specified index with the given double value.set
(int index, float value) Replaces the parameter at the specified index with the given float value.set
(int index, int value) Replaces the parameter at the specified index with the given int value.set
(int index, long value) Replaces the parameter at the specified index with the given long value.set
(int index, short value) Replaces the parameter at the specified index with a short value.set
(int index, CudaBuffer value) Replaces the parameter at the specified index with the given buffer address.
-
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
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
- ifparameters
contains any unsupported types
-
Parameters
Creates a copy of the given parameter block.- Parameters:
that
- the parameter block to be copied
-
-
Method Details
-
add
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
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
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
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
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
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
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
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
Creates a copy of this parameter block. -
set
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
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
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
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
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
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
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
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
-