Documentation
|
|
Functions | |
| array () | |
| Create non-dimensioned array (no data, undefined size) More... | |
| array (const dim4 &dims, dtype ty=f32) | |
| Allocate an array of a specified size with undefined contents. More... | |
| array (int d0, int d1, dtype ty=f32) | |
| Allocate a two-dimensional array of a specified size with undefined contents. More... | |
| array (int d0, int d1, int d2, dtype ty=f32) | |
| Allocate a three-dimensional (3D) array of a specified size with undefined contents. More... | |
| array (int d0, int d1, int d2, int d3, dtype ty=f32) | |
| Allocate a four-dimensional (4D) array of a specified size with undefined contents. More... | |
| array (const array &) | |
| Duplicate an existing array (copy constructor). More... | |
| array (const seq &s) | |
| Convert a seq object for use with arithmetic. More... | |
| template<typename ty > | |
| array (unsigned dim0, const ty *pointer, af_source_t src=afHost, unsigned ngfor=0) | |
| Create a column vector on the device using a host/device pointer. More... | |
| template<typename ty > | |
| array (unsigned dim0, unsigned dim1, const ty *pointer, af_source_t src=afHost, unsigned ngfor=0) | |
| Create a 2D array on the device using a host/device pointer. More... | |
| template<typename ty > | |
| array (unsigned dim0, unsigned dim1, unsigned dim2, const ty *pointer, af_source_t src=afHost, unsigned ngfor=0) | |
| Create a 3D array on the device using a host/device pointer. More... | |
| template<typename ty > | |
| array (unsigned dim0, unsigned dim1, unsigned dim2, unsigned dim3, const ty *pointer, af_source_t src=afHost, unsigned ngfor=0) | |
| Create a 4D array on the device using a host/device pointer. More... | |
| template<typename ty > | |
| array (const dim4 &dims, const ty *pointer, af_source_t src=afHost, unsigned ngfor=0) | |
| Create an array of specified size on the device using a host/device pointer. More... | |
| template<typename ty > | |
| static array | scalar (const ty value) |
| Push scalar value to the device. More... | |
| array | ( | ) |
Create non-dimensioned array (no data, undefined size)
Allocate an array of a specified size with undefined contents.
This can be useful when the dimensions of the array are calculated somewhere else within the code. The first parameter specifies the size of the array via dim4(). The second parameter is the type of the array. The default type is f32 or 4-byte single-precision floating point numbers.
| [in] | dims | size of the array |
| [in] | ty | optional label describing the data type (default is f32) |
Allocate a two-dimensional array of a specified size with undefined contents.
Declare a two-dimensional array by passing the number of rows and the number of columns as the first two parameters. The (optional) third parameter is the type of the array. The default type is f32 or 4-byte single-precision floating-point numbers.
| [in] | d0 | number of columns in the array |
| [in] | d1 | number of rows in the array |
| [in] | ty | optional label describing the data type (default is f32) |
Allocate a three-dimensional (3D) array of a specified size with undefined contents.
This is useful to quickly declare a three-dimensional array by passing the size as the first three parameters. The (optional) fourth parameter is the type of the array. The default type is f32 or 4-byte single-precision floating point numbers.
| [in] | d0 | first dimension of the array |
| [in] | d1 | second dimension of the array |
| [in] | d2 | third dimension of the array |
| [in] | ty | optional label describing the data type (default is f32) |
Allocate a four-dimensional (4D) array of a specified size with undefined contents.
This is useful to quickly declare a four-dimensional array by passing the size as the first four parameters. The (optional) fifth parameter is the type of the array. The default type is f32 or 4-byte floating point numbers.
| [in] | d0 | first dimension of the array |
| [in] | d1 | second dimension of the array |
| [in] | d2 | third dimension of the array |
| [in] | d3 | fourth dimension of the array |
| [in] | ty | optional label describing the data type (default is f32) |
| array | ( | const array & | ) |
| array | ( | const seq & | s | ) |
| array | ( | unsigned | dim0, |
| const ty * | pointer, | ||
| af_source_t | src = afHost, |
||
| unsigned | ngfor = 0 |
||
| ) |
Create a column vector on the device using a host/device pointer.
This function can be used to transfer data from a host or device pointer to an array object on the device with one column. The type of the array is automatically matched to the type of the data.
Depending on the specified size of the column vector, the data will be copied partially or completely. However, the user needs to be careful to ensure that the array size is not larger than the number of elements in the input buffer.
| [in] | dim0 | number of elements in the column vector |
| [in] | pointer | pointer (points to a buffer on the host/device) |
| [in] | src | source of the data (default is afHost, can also be afDevice) |
| [in] | ngfor | number of gfor tiles (default is ZERO) |
| array | ( | unsigned | dim0, |
| unsigned | dim1, | ||
| const ty * | pointer, | ||
| af_source_t | src = afHost, |
||
| unsigned | ngfor = 0 |
||
| ) |
Create a 2D array on the device using a host/device pointer.
This function copies data from the location specified by the pointer to a 2D array on the device. The data is arranged in "column-major" format (similar to that used by FORTRAN).
Note that this is an synchronous copy. The elements are not actually filled until this array is evaluated or used in the evaluation of some other expression that uses this array object.
| [in] | dim0 | number of rows |
| [in] | dim1 | number of columns |
| [in] | pointer | pointer (points to a buffer on the host/device) |
| [in] | src | source of the data (default is afHost, can also be afDevice) |
| [in] | ngfor | number of gfor tiles (default is ZERO) |
| array | ( | unsigned | dim0, |
| unsigned | dim1, | ||
| unsigned | dim2, | ||
| const ty * | pointer, | ||
| af_source_t | src = afHost, |
||
| unsigned | ngfor = 0 |
||
| ) |
Create a 3D array on the device using a host/device pointer.
This function copies data from the location specified by the pointer to a 3D array on the device. The data is arranged in "column-major" format (similar to that used by FORTRAN).
| [in] | dim0 | first dimension |
| [in] | dim1 | second dimension |
| [in] | dim2 | third dimension |
| [in] | pointer | pointer (points to a buffer on the host/device) |
| [in] | src | source of the data (default is afHost, can also be afDevice) |
| [in] | ngfor | number of gfor tiles (default is ZERO) |
| array | ( | unsigned | dim0, |
| unsigned | dim1, | ||
| unsigned | dim2, | ||
| unsigned | dim3, | ||
| const ty * | pointer, | ||
| af_source_t | src = afHost, |
||
| unsigned | ngfor = 0 |
||
| ) |
Create a 4D array on the device using a host/device pointer.
This function copies data from the location specified by the pointer to a 4D array on the device. The data is arranged in "column-major" format (similar to that used by FORTRAN).
| [in] | dim0 | first dimension |
| [in] | dim1 | second dimension |
| [in] | dim2 | third dimension |
| [in] | dim3 | fourth dimension |
| [in] | pointer | pointer (points to a buffer on the host/device) |
| [in] | src | source of the data (default is afHost, can also be afDevice) |
| [in] | ngfor | number of gfor tiles (default is ZERO) |
| array | ( | const dim4 & | dims, |
| const ty * | pointer, | ||
| af_source_t | src = afHost, |
||
| unsigned | ngfor = 0 |
||
| ) |
Create an array of specified size on the device using a host/device pointer.
This function copies data from the location specified by the pointer to a 1D/2D/3D/4D array on the device. The data is arranged in "column-major" format (similar to that used by FORTRAN).
| [in] | dims | vector data type containing the dimension of the array |
| [in] | pointer | pointer (points to a buffer on the host/device) |
| [in] | src | source of the data (default is afHost, can also be afDevice) |
| [in] | ngfor | number of gfor tiles (default is ZERO) |
|
static |
Push scalar value to the device.
This operation is useful for extracting elements inside an array for use as regular variables in device memory. The template parameter can be used to specify what type is extracted from this function.
Although useful in some cases, it is recommended not to use this too often. It is recommended to copy large amounts of data to the device when possible.
| [in] | value | The initial value of the array. |