-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `qreal` - `qindex` - `qcomp` The latter is a C/C++ agnostic complex scalar compatible with OpenMP, MPI, Thrust, cuQuantum, and given a CUDA-compatible wrapper Co-Authored-By: Ali Rezaei <Ali.Rezaei@ed.ac.uk>
- Loading branch information
1 parent
61dcd38
commit 4122a6e
Showing
5 changed files
with
259 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
/** @file | ||
* Functions for communicating and exchanging amplitudes between compute | ||
* nodes, when running in distributed mode, using the C MPI standard. | ||
*/ | ||
*/ | ||
|
||
#include "quest/include/modes.h" | ||
#include "quest/include/types.h" | ||
|
||
#if ENABLE_DISTRIBUTION | ||
#include <mpi.h> | ||
#endif | ||
|
||
|
||
|
||
/* | ||
* MPI COMPLEX TYPE FLAG | ||
*/ | ||
|
||
#if ENABLE_DISTRIBUTION | ||
|
||
#if (FLOAT_PRECISION == 1) | ||
#define MPI_QCOMP MPI_CXX_FLOAT_COMPLEX | ||
|
||
#elif (FLOAT_PRECISION == 2) | ||
#define MPI_QCOMP MPI_CXX_DOUBLE_COMPLEX | ||
|
||
// sometimes 'MPI_CXX_LONG_DOUBLE_COMPLEX' isn't defined | ||
#elif (FLOAT_PRECISION == 4) && defined(MPI_CXX_LONG_DOUBLE_COMPLEX) | ||
#define MPI_QCOMP MPI_CXX_LONG_DOUBLE_COMPLEX | ||
|
||
// in that case, fall back to the C type (identical memory layout) | ||
#else | ||
#define MPI_QCOMP MPI_C_LONG_DOUBLE_COMPLEX | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
/** @file | ||
* CPU OpenMP-accelerated definitions of the subroutines called by | ||
* accelerator.cpp. | ||
*/ | ||
*/ | ||
|
||
#include "quest/include/modes.h" | ||
#include "quest/include/types.h" | ||
|
||
#if ENABLE_MULTITHREADING | ||
#include <omp.h> | ||
#endif | ||
|
||
|
||
// inform OpenMP how to reduce qcomp instances (except on MSVC compilers) | ||
#if defined(ENABLE_MULTITHREADING) && !defined(_MSC_VER) | ||
#pragma omp declare reduction(+ : qcomp : omp_out += omp_in ) initializer( omp_priv = omp_orig ) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters