Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthiasreumann/cttgt
Complex Tensor Contractions via TTGT
https://github.com/matthiasreumann/cttgt
Last synced: about 2 months ago
JSON representation
Complex Tensor Contractions via TTGT
- Host: GitHub
- URL: https://github.com/matthiasreumann/cttgt
- Owner: MatthiasReumann
- License: mit
- Created: 2023-04-27T08:25:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-05T06:14:11.000Z (over 1 year ago)
- Last Synced: 2024-10-15T22:41:09.499Z (3 months ago)
- Language: C++
- Homepage:
- Size: 18 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CTTGT
Complex Tensor Contractions via TTGT. Transposed with the help of HPTT. Complex matrix multiplication is achieved with BLIS.## Dependencies
* [BLIS](https://github.com/flame/blis)
* [HPTT](https://github.com/springer13/hptt)
* [MArray](https://github.com/devinamatthews/marray)## Usage
```cpp
#include
#include "ctgtt.hpp"const complex ALPHA = 1.0;
const complex BETA = 0.0;int main() {
int d1 = 200, d2 = 200, d3 = 200;
complex *A = nullptr, *B = nullptr, *C = nullptr;
ctgtt::utils::alloc_aligned(&A, d1 * d2);
ctgtt::utils::alloc_aligned(&B, d2 * d3);
ctgtt::utils::alloc_aligned(&C, d1 * d3);/*
set data ...
*/auto tensorA = ctgtt::CTensor({d1, d2}, A, ctgtt::COLUMN_MAJOR);
auto tensorB = ctgtt::CTensor({d2, d3}, B, ctgtt::COLUMN_MAJOR);
auto tensorC = ctgtt::CTensor({d1, d3}, C, ctgtt::COLUMN_MAJOR);ctgtt::contract(ALPHA, tensorA, "ab", tensorB, "cb", BETA, tensorC, "ac");
return 0;
}