Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Classes | |
class | tinker::darray |
Device array. More... | |
class | tinker::GenericUnit< T, VERSION > |
Resource handle. Analogous to Fortran i/o unit represented by a signed integer. More... | |
struct | tinker::v1::EnableEnumBitMask< E > |
Direct mathematical calculation of enum class is prohibited in C++. More... | |
class | tinker::ResourceManagement |
Resource management. Allocates resources in the object constructor and deallocates resources in the object destructor. More... | |
struct | tinker::calc |
Bitmasks for MD. More... | |
Macros | |
#define | TINKER_ENABLE_ENUM_BITMASK(x) |
Explicitly enables mathematical calculation by casting enum class to integer. More... | |
Typedefs | |
using | tinker::RcOp = ResourceOperation |
using | tinker::RcMan = ResourceManagement |
Type alias. More... | |
Enumerations | |
enum class | tinker::ResourceOperation { tinker::ResourceOperation::DEALLOC = 0x001 , tinker::ResourceOperation::ALLOC = 0x002 , tinker::ResourceOperation::INIT = 0x004 } |
Functions | |
void | tinker::waitFor (int queue) |
Similar to OpenACC wait and CUDA stream synchronize. More... | |
void | tinker::deviceMemoryCopyinBytesAsync (void *dst, const void *src, size_t nbytes, int queue) |
Similar to OpenACC async copyin, copies data from host to device. More... | |
void | tinker::deviceMemoryCopyoutBytesAsync (void *dst, const void *src, size_t nbytes, int queue) |
Similar to OpenACC async copyout, copies data from device to host. More... | |
void | tinker::deviceMemoryCopyBytesAsync (void *dst, const void *src, size_t nbytes, int queue) |
Copies data between two pointers on device. More... | |
void | tinker::deviceMemoryZeroBytesAsync (void *dst, size_t nbytes, int queue) |
Writes zero bytes on device. More... | |
void | tinker::deviceMemoryDeallocate (void *ptr) |
Deallocates device pointer. More... | |
void | tinker::deviceMemoryAllocateBytes (void **pptr, size_t nbytes) |
Allocates device pointer. More... | |
template<class T > | |
void | tinker::v1::deviceMemoryCheckType () |
Sanity check. More... | |
template<class DT , class ST > | |
void | tinker::v1::deviceMemoryCopyin1dArray (DT *dst, const ST *src, size_t nelem, int q) |
Copies data to 1D array, host to device. More... | |
template<class DT , class ST > | |
void | tinker::v1::deviceMemoryCopyout1dArray (DT *dst, const ST *src, size_t nelem, int q) |
Copies data to 1D array, device to host. More... | |
template<class E > | |
constexpr std::enable_if< EnableEnumBitMask< E >::value, E >::type | tinker::operator| (E lhs, E rhs) |
template<class E > | |
constexpr bool | tinker::operator& (E lhs, E rhs) |
void | tinker::deviceData (RcOp) |
Set up and clean up device environment. More... | |
Variables | |
int | tinker::rc_flag |
Global bitmask. More... | |
class tinker::darray |
Device array.
Static Public Member Functions | |
template<class PTR > | |
static void | allocate (size_t nelem, PTR *pp) |
template<class PTR , class... PTRS> | |
static void | allocate (size_t nelem, PTR *pp, PTRS... pps) |
template<class PTR > | |
static void | deallocate (PTR p) |
template<class PTR , class... PTRS> | |
static void | deallocate (PTR p, PTRS... ps) |
template<class PTR > | |
static void | zero (int q, size_t nelem, PTR p) |
template<class PTR , class... PTRS> | |
static void | zero (int q, size_t nelem, PTR p, PTRS... ps) |
template<class PTR , class U > | |
static void | copyin (int q, size_t nelem, PTR dst, const U *src) |
template<class U , class PTR > | |
static void | copyout (int q, size_t nelem, U *dst, const PTR src) |
template<class PTR , class U > | |
static void | copy (int q, size_t nelem, PTR dst, const U *src) |
Copies data across two device memory pointers. More... | |
template<class PTR , class PTR2 > | |
static PtrTrait< PTR >::type | dotThenReturn (int q, size_t nelem, const PTR ptr, const PTR2 b) |
Calculates the dot product and returns the answer to the host. More... | |
template<class ANS , class PTR , class PTR2 > | |
static void | dot (int q, size_t nelem, ANS ans, const PTR ptr, const PTR2 ptr2) |
Calculates the dot product and saves the answer to pointer ans . More... | |
template<class FLT , class PTR > | |
static void | scale (int q, size_t nelem, FLT scal, PTR ptr) |
template<class FLT , class PTR , class... PTRS> | |
static void | scale (int q, size_t nelem, FLT scal, PTR ptr, PTRS... ptrs) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Copies data across two device memory pointers.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Calculates the dot product and saves the answer to pointer ans
.
|
inlinestatic |
Calculates the dot product and returns the answer to the host.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
class tinker::GenericUnit |
Resource handle. Analogous to Fortran i/o unit represented by a signed integer.
Public Member Functions | |
GenericUnit () | |
GenericUnit (int u) | |
operator int () const | |
bool | valid () const |
Whether the current unit is open. More... | |
void | close () |
Closes the current unit. More... | |
void | deviceptrUpdate (const T &hobj, int queue) |
Updates the object on device by an object on host. More... | |
const T & | operator* () const |
Gets the (const) reference to the object on host. More... | |
T & | operator* () |
Gets the (const) reference to the object on host. More... | |
const T * | operator-> () const |
Gets the (const) pointer to the object on host. More... | |
T * | operator-> () |
Gets the (const) pointer to the object on host. More... | |
const T * | deviceptr () const |
Gets (const) device pointer to the object. More... | |
T * | deviceptr () |
Gets (const) device pointer to the object. More... | |
Static Public Member Functions | |
static int | size () |
Gets the number of open units. More... | |
static void | clear () |
Releases all of the resources and reset size() to 0. More... | |
template<class DT = T> | |
static void | resize (int s) |
Resizes the capacity for the objects on host. More... | |
static GenericUnit | open () |
Returns a new unit, similar to opening a new Fortran i/o unit. More... | |
|
inline |
|
inline |
|
inlinestatic |
Releases all of the resources and reset size()
to 0.
|
inline |
Closes the current unit.
clear()
is called.
|
inline |
Gets (const) device pointer to the object.
|
inline |
Gets (const) device pointer to the object.
|
inline |
Updates the object on device by an object on host.
hobj | Reference to the object on host that can be accessed by the same unit number. |
queue | Device queue for the update. |
|
inlinestatic |
Returns a new unit, similar to opening a new Fortran i/o unit.
|
inline |
|
inline |
Gets the (const) reference to the object on host.
|
inline |
Gets the (const) reference to the object on host.
|
inline |
Gets the (const) pointer to the object on host.
|
inline |
Gets the (const) pointer to the object on host.
|
inlinestatic |
Resizes the capacity for the objects on host.
|
inlinestatic |
Gets the number of open units.
|
inline |
Whether the current unit is open.
struct tinker::v1::EnableEnumBitMask |
Direct mathematical calculation of enum class is prohibited in C++.
Static Public Attributes | |
static constexpr bool | value = false |
|
staticconstexpr |
class tinker::ResourceManagement |
Resource management. Allocates resources in the object constructor and deallocates resources in the object destructor.
To deallocate resource in reverse order of allocation, use named objects.
To deallocate resource in the same order of allocation, use unnamed objects.
Public Member Functions | |
ResourceManagement (void(*f)(RcOp), RcOp op) | |
~ResourceManagement () | |
f | Function to (de)allocate and/or initialize resource. |
op | Resource operation flag. |
tinker::ResourceManagement::~ResourceManagement | ( | ) |
struct tinker::calc |
Bitmasks for MD.
Public Types | |
using | V0 = Eng |
using | V1 = EngGradVir |
using | V3 = EngAlyz |
using | V4 = EngGrad |
using | V5 = Grad |
using | V6 = GradVir |
Static Public Attributes | |
static constexpr int | xyz = 0x001 |
Use coordinates. More... | |
static constexpr int | vel = 0x002 |
Use velocities. More... | |
static constexpr int | mass = 0x004 |
Use mass. More... | |
static constexpr int | traj = 0x008 |
Use multi-frame trajectory. More... | |
static constexpr int | energy = 0x010 |
Evaluate energy. More... | |
static constexpr int | grad = 0x020 |
Evaluate energy gradient. More... | |
static constexpr int | virial = 0x040 |
Evaluate virial tensor. More... | |
static constexpr int | analyz = 0x080 |
Evaluate number of interactions. More... | |
static constexpr int | md = 0x100 |
Run MD simulation. More... | |
static constexpr int | vmask = energy + grad + virial + analyz |
Bits mask to clear energy-irrelevant flags. More... | |
static constexpr int | v0 = energy |
Similar to Tinker energy routines. Energy only. More... | |
static constexpr int | v1 = energy + grad + virial |
static constexpr int | v3 = energy + analyz |
static constexpr int | v4 = energy + grad |
Energy and gradient. More... | |
static constexpr int | v5 = grad |
Gradient only. More... | |
static constexpr int | v6 = grad + virial |
Gradient and virial. More... | |
using tinker::calc::V0 = Eng |
using tinker::calc::V1 = EngGradVir |
using tinker::calc::V3 = EngAlyz |
using tinker::calc::V4 = EngGrad |
using tinker::calc::V5 = Grad |
using tinker::calc::V6 = GradVir |
|
staticconstexpr |
Evaluate number of interactions.
|
staticconstexpr |
Evaluate energy.
|
staticconstexpr |
Evaluate energy gradient.
|
staticconstexpr |
Use mass.
|
staticconstexpr |
Run MD simulation.
|
staticconstexpr |
Use multi-frame trajectory.
|
staticconstexpr |
Similar to Tinker energy routines. Energy only.
Similar to version 1 Tinker energy routines. Energy, gradient, and virial.
Similar to version 3 Tinker energy routines. Energy and number of interactions.
|
staticconstexpr |
Gradient only.
|
staticconstexpr |
Use velocities.
|
staticconstexpr |
Evaluate virial tensor.
Bits mask to clear energy-irrelevant flags.
|
staticconstexpr |
Use coordinates.
#define TINKER_ENABLE_ENUM_BITMASK | ( | x | ) |
Explicitly enables mathematical calculation by casting enum class to integer.
using tinker::RcMan = typedef ResourceManagement |
Type alias.
using tinker::RcOp = typedef ResourceOperation |
Type alias.
|
strong |
void tinker::deviceData | ( | RcOp | ) |
Set up and clean up device environment.
void tinker::deviceMemoryAllocateBytes | ( | void ** | pptr, |
size_t | nbytes | ||
) |
Allocates device pointer.
pptr | Pointer to the device pointer. |
nbytes | Number of bytes. |
void tinker::v1::deviceMemoryCheckType | ( | ) |
Sanity check.
void tinker::deviceMemoryCopyBytesAsync | ( | void * | dst, |
const void * | src, | ||
size_t | nbytes, | ||
int | queue | ||
) |
Copies data between two pointers on device.
dst | Destination device pointer. |
src | Source device pointer. |
nbytes | Number of bytes. |
queue | OpenACC queue. |
void tinker::v1::deviceMemoryCopyin1dArray | ( | DT * | dst, |
const ST * | src, | ||
size_t | nelem, | ||
int | q | ||
) |
Copies data to 1D array, host to device.
dst | Destination address. |
src | Source address. |
nelem | Number of elements to copy to the 1D device array. |
q | OpenACC queue. |
void tinker::deviceMemoryCopyinBytesAsync | ( | void * | dst, |
const void * | src, | ||
size_t | nbytes, | ||
int | queue | ||
) |
Similar to OpenACC async copyin, copies data from host to device.
dst | Device pointer. |
src | Host pointer. |
nbytes | Number of bytes. |
queue | OpenACC queue. |
void tinker::v1::deviceMemoryCopyout1dArray | ( | DT * | dst, |
const ST * | src, | ||
size_t | nelem, | ||
int | q | ||
) |
Copies data to 1D array, device to host.
dst | Destination address. |
src | Source address. |
nelem | Number of elements to copy to the 1D host array. |
q | OpenACC queue. |
void tinker::deviceMemoryCopyoutBytesAsync | ( | void * | dst, |
const void * | src, | ||
size_t | nbytes, | ||
int | queue | ||
) |
Similar to OpenACC async copyout, copies data from device to host.
dst | Host pointer. |
src | Device pointer. |
nbytes | Number of bytes. |
queue | OpenACC queue. |
void tinker::deviceMemoryDeallocate | ( | void * | ptr | ) |
Deallocates device pointer.
ptr | Device pointer. |
void tinker::deviceMemoryZeroBytesAsync | ( | void * | dst, |
size_t | nbytes, | ||
int | queue | ||
) |
Writes zero bytes on device.
dst | Device pointer. |
nbytes | Number of bytes. |
queue | OpenACC queue. |
|
constexpr |
|
constexpr |
void tinker::waitFor | ( | int | queue | ) |
Similar to OpenACC wait and CUDA stream synchronize.
queue | OpenACC queue. |
|
extern |
Global bitmask.