A module for handling scratch memory for matrix multiplication. The purpose of this module is to avoid having to allocate memory on the heap during a matrix multiply, and to manage the underlying hash table.
Construct Matrix Memory Pool object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
||
real(kind=NTREAL), | intent(in), | optional | :: | sparsity_in | Estimated sparsity (optional). |
The matrix to construct.
Construct Matrix Memory Pool object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
||
real(kind=NTREAL), | intent(in), | optional | :: | sparsity_in | Estimated sparsity (optional). |
The matrix to construct.
Subroutine wrapper for the constructor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lr), | TARGET | :: | this | The matrix to construct. |
||
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
||
real(kind=NTREAL), | intent(in), | optional | :: | sparsity_in | Estimated sparsity (optional). |
Subroutine wrapper for the constructor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lc), | TARGET | :: | this | The matrix to construct. |
||
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
||
real(kind=NTREAL), | intent(in), | optional | :: | sparsity_in | Estimated sparsity (optional). |
A destructor for a matrix memory pool
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lr), | intent(inout) | :: | this | The matrix being destructed. |
A destructor for a matrix memory pool
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lc), | intent(inout) | :: | this | The matrix being destructed. |
Checks if a given memory pool has been validly allocated to handle the given parameters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lr), | intent(in) | :: | this | The memory pool to check. |
||
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
true if the memory pool is valid.
Checks if a given memory pool has been validly allocated to handle Checks if a given memory pool has been validly allocated to handle the given parameters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lc), | intent(in) | :: | this | The memory pool to check. |
||
integer, | intent(in) | :: | columns | Number of columns in the matrix. |
||
integer, | intent(in) | :: | rows | Number of rows in the matrix. |
true if the memory pool is valid.
Sets the expected sparsity of the matrix, which helps with hashing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lr), | intent(inout), | TARGET | :: | this | The memory pool to set the sparsity of. |
|
real(kind=NTREAL), | intent(in) | :: | sparsity | The sparsity value. |
Sets the expected sparsity of the matrix, which helps with hashing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MatrixMemoryPool_lc), | intent(inout), | TARGET | :: | this | The memory pool to set the sparsity of. |
|
real(kind=NTREAL), | intent(in) | :: | sparsity | The sparsity value. |
A memory pool datatype that can be reused for matrix matrix multiplication. this is to prevent excessive alloc/dealloc.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | columns | Shape of matrix: columns |
|||
integer, | public | :: | rows | Shape of matrix: rows |
|||
type(Triplet_r), | public, | DIMENSION(:), ALLOCATABLE | :: | pruned_list | storage for actual values added to the matrix. |
||
real(kind=NTREAL), | public, | DIMENSION(:,:), ALLOCATABLE | :: | value_array | storage for potential values added to the matrix. |
||
logical, | public, | DIMENSION(:,:), ALLOCATABLE | :: | dirty_array | true if an element has been pushed to this part of the matrix. |
||
integer, | public, | DIMENSION(:,:), ALLOCATABLE | :: | hash_index | Storage space for indices, hashed. |
||
integer, | public, | DIMENSION(:,:), ALLOCATABLE | :: | inserted_per_bucket | Internal storage space for amount of items added to a bucket. |
||
integer, | public | :: | hash_size | Size of the buckets. |
private function ConstructMatrixMemoryPool_lr(columns, rows, sparsity_in) | Construct Matrix Memory Pool object. |
A memory pool datatype that can be reused for matrix matrix multiplication. this is to prevent excessive alloc/dealloc.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | columns | Shape of matrix: columns |
|||
integer, | public | :: | rows | Shape of matrix: rows |
|||
type(Triplet_c), | public, | DIMENSION(:), ALLOCATABLE | :: | pruned_list | storage for actual values added to the matrix. |
||
complex(kind=NTCOMPLEX), | public, | DIMENSION(:,:), ALLOCATABLE | :: | value_array | storage for potential values added to the matrix. |
||
logical, | public, | DIMENSION(:,:), ALLOCATABLE | :: | dirty_array | true if an element has been pushed to this part of the matrix. |
||
integer, | public, | DIMENSION(:,:), ALLOCATABLE | :: | hash_index | Storage space for indices, hashed. |
||
integer, | public, | DIMENSION(:,:), ALLOCATABLE | :: | inserted_per_bucket | Internal storage space for amount of items added to a bucket. |
||
integer, | public | :: | hash_size | Size of the buckets. |
private function ConstructMatrixMemoryPool_lc(columns, rows, sparsity_in) | Construct Matrix Memory Pool object. |