Package org.apfloat.aparapi
Class ColumnTwoPassFNTStrategy
java.lang.Object
org.apfloat.internal.AbstractStepFNTStrategy
org.apfloat.internal.TwoPassFNTStrategy
org.apfloat.aparapi.ColumnTwoPassFNTStrategy
- All Implemented Interfaces:
Parallelizable,NTTStrategy
Two-pass NTT implementation that processes the data in the columns of the matrix.
This transform only works together with an NTTStepStrategy implementation
that processes the data in columns instead of rows.
Note that if the data size is too big compared to the maximum available memory then the data is read from disk in too thin slices and the level of parallelism may become too small for the GPU, ruining the performance. The GPU global size i.e. the number of columns read from the data matrix to memory at one time should be at least 1024.
- Since:
- 1.8.3
- Version:
- 1.8.3
- Author:
- Mikko Tommila
-
Field Summary
Fields inherited from class org.apfloat.internal.AbstractStepFNTStrategy
stepStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ArrayAccessgetColumns(DataStorage dataStorage, int startColumn, int columns, int rows) Get a block of column data.protected ArrayAccessgetRows(DataStorage dataStorage, int startRow, int rows, int columns) Get a block of row data.protected voidmultiplyElements(ArrayAccess arrayAccess, int startRow, int startColumn, int rows, int columns, long length, long totalTransformLength, boolean isInverse, int modulus) Multiply each matrix element(i, j)bywi * j / totalTransformLength.Methods inherited from class org.apfloat.internal.TwoPassFNTStrategy
inverseTransform, transform, transformColumns, transformRowsMethods inherited from class org.apfloat.internal.AbstractStepFNTStrategy
getTransformLength, inverseTransform, transform
-
Constructor Details
-
ColumnTwoPassFNTStrategy
Basic constructor.- Parameters:
stepStrategy- A step strategy that can process data in columns.
-
-
Method Details
-
getColumns
Description copied from class:TwoPassFNTStrategyGet a block of column data. The data may be transposed, depending on the implementation.- Overrides:
getColumnsin classTwoPassFNTStrategy- Parameters:
dataStorage- The data storage.startColumn- The starting column where data is read.columns- The number of columns of data to read.rows- The number of rows of data to read. This should be equivalent to n1, number of rows in the matrix.- Returns:
- Access to an array of size
columnsxrowscontaining the data.
-
getRows
Description copied from class:TwoPassFNTStrategyGet a block of row data. The data may be transposed, depending on the implementation.- Overrides:
getRowsin classTwoPassFNTStrategy- Parameters:
dataStorage- The data storage.startRow- The starting row where data is read.rows- The number of rows of data to read.columns- The number of columns of data to read. This should be equivalent to n2, number of columns in the matrix.- Returns:
- Access to an array of size
columnsxrowscontaining the data.
-
multiplyElements
protected void multiplyElements(ArrayAccess arrayAccess, int startRow, int startColumn, int rows, int columns, long length, long totalTransformLength, boolean isInverse, int modulus) Description copied from class:TwoPassFNTStrategyMultiply each matrix element(i, j)bywi * j / totalTransformLength. The matrix size is n1 x n2.- Overrides:
multiplyElementsin classTwoPassFNTStrategy- Parameters:
arrayAccess- The memory array to multiply.startRow- Which row in the whole matrix the starting row in thearrayAccessis.startColumn- Which column in the whole matrix the starting column in thearrayAccessis.rows- The number of rows in thearrayAccessto multiply.columns- The number of columns in the matrix (= n2).length- The length of data in the matrix being transformed.totalTransformLength- The total transform length, for the scaling factor. Used only for the inverse case.isInverse- If the multiplication is done for the inverse transform or not.modulus- Index of the modulus.
-