Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Functions | |
template<class T > | |
T | tinker::reduceSum (const T *gpu_a, size_t nelem, int queue) |
Sum over all of the elements of an 1D array. More... | |
template<class HT , size_t HN, class DPTR > | |
void | tinker::reduceSum2 (HT(&h_ans)[HN], DPTR v, size_t nelem, int queue) |
Sum over all of the elements of a 2D array. More... | |
template<class T > | |
void | tinker::reduceSumOnDevice (T *dp_ans, const T *a, size_t nelem, int queue) |
Sum over all of the elements of an 1D array. This routine will save the result on the device memory in an asynchronous/non-blocking manner. A valid device pointer is required for the result on the device. More... | |
template<class HT , size_t HN, class DPTR > | |
void | tinker::reduceSum2OnDevice (HT(&dref)[HN], DPTR v, size_t nelem, int queue) |
Sum over all of the elements of a 2D array. This routine will save the result on the device memory in an asynchronous/non-blocking manner. A valid device array is required for the result on device. More... | |
template<class T > | |
T | tinker::dotProd (const T *a, const T *b, size_t nelem, int queue) |
Dot product of two linear arrays. More... | |
template<class T > | |
void | tinker::dotProd (T *ans, const T *a, const T *b, size_t nelem, int queue) |
Dot product of two linear arrays. More... | |
template<class T > | |
void | tinker::scaleArray (T *dst, T scal, size_t nelem, int queue) |
Multiply all of the elements in an 1D array by a scalar. More... | |
T tinker::dotProd | ( | const T * | a, |
const T * | b, | ||
size_t | nelem, | ||
int | queue | ||
) |
Dot product of two linear arrays.
\[ DotProduct = \sum_i^n a_i \cdot b_i \]
void tinker::dotProd | ( | T * | ans, |
const T * | a, | ||
const T * | b, | ||
size_t | nelem, | ||
int | queue | ||
) |
Dot product of two linear arrays.
T tinker::reduceSum | ( | const T * | gpu_a, |
size_t | nelem, | ||
int | queue | ||
) |
Sum over all of the elements of an 1D array.
\[ Sum = \sum_i^n a_i \]
void tinker::reduceSum2 | ( | HT(&) | h_ans[HN], |
DPTR | v, | ||
size_t | nelem, | ||
int | queue | ||
) |
Sum over all of the elements of a 2D array.
In Fortran syntax:
\[ Ans(k) = \sum_i^n v(k,i), 1 \le k \le HN \]
In C++ syntax:
\[ Ans[k] = \sum_i^n v[i][k], 0 \le k < HN \]
void tinker::reduceSum2OnDevice | ( | HT(&) | dref[HN], |
DPTR | v, | ||
size_t | nelem, | ||
int | queue | ||
) |
Sum over all of the elements of a 2D array. This routine will save the result on the device memory in an asynchronous/non-blocking manner. A valid device array is required for the result on device.
Fortran syntax:
\[ Ans(k) = \sum_i^n v(k,i), 1 \le k \le HN \]
C++ syntax:
\[ Ans[k] = \sum_i^n v[i][k], 0 \le k < HN \]
HT | Type of the array element. |
HN | Length of the result array. |
DPTR | Type of the 2D array. |
dref | Reference to the device array that stores the reduced result. |
v | Device pointer to the 2D array. |
nelem | Number of elements. |
queue | OpenACC queue. |
void tinker::reduceSumOnDevice | ( | T * | dp_ans, |
const T * | a, | ||
size_t | nelem, | ||
int | queue | ||
) |
Sum over all of the elements of an 1D array. This routine will save the result on the device memory in an asynchronous/non-blocking manner. A valid device pointer is required for the result on the device.
\[ Sum = \sum_i^n a_i \]
dp_ans | Device pointer used to store the reduction result. |
a | Device pointer to the array. |
nelem | Number of elements. |
queue | OpenACC queue. |
void tinker::scaleArray | ( | T * | dst, |
T | scal, | ||
size_t | nelem, | ||
int | queue | ||
) |
Multiply all of the elements in an 1D array by a scalar.
\[ a_i = c \cdot a_i \]