Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
Modules | Classes | Macros | Enumerations | Functions | Variables
Platforms

Platforms and platform-specific syntaxes. More...

Modules

 C++ Syntax
 
 CUDA Syntax
 
 OpenACC Syntax
 
 NVIDIA GPU
 

Classes

class  tinker::ThrustCache
 Device memory cache (allocator) for the Thrust Library. More...
 

Macros

#define TINKER_CUDART   1
 
#define TINKER_GPULANG_OPENACC   0
 
#define TINKER_GPULANG_CUDA   0
 

Enumerations

enum class  tinker::Platform { tinker::Platform::UNKNOWN = 0x000 , tinker::Platform::ACC = 0x001 , tinker::Platform::CUDA = 0x002 }
 

Functions

std::string tinker::cxxCompilerName ()
 Returns the name of the C++ compiler. More...
 
std::string tinker::accCompilerName ()
 Returns the name of the OpenACC compiler. More...
 
std::string tinker::cudaCompilerName ()
 Returns the name of the CUDA compiler. More...
 
void tinker::cudalibData (RcOp)
 Sets up the CUDA variables including but not limited to CUDA streams, CUDA library handles, CUDA memory buffers, and integer units for the OpenACC queues. More...
 
std::string tinker::exec (const std::string &cmd)
 Executes a command in shell and returns the output in a string. More...
 
void tinker::throwExceptionMissingFunction (const char *functionName, const char *file, int lineNum)
 
void tinker::gpuData (RcOp)
 Sets up the GPU card. More...
 
int tinker::gpuGridSize (int nthreadsPerBlock)
 
int tinker::gpuMaxNParallel (int idev)
 
void tinker::platformData (RcOp)
 

Variables

void * tinker::pinned_buf
 Preallocated pinned host memory. More...
 
void * tinker::dptr_buf
 Preallocated device memory. More...
 
int tinker::ndevice
 Total number of visible devices. More...
 
int tinker::idevice
 Device ID number in use. More...
 
Platform tinker::pltfm_config
 

Detailed Description

Platforms and platform-specific syntaxes.


Class Documentation

◆ tinker::ThrustCache

class tinker::ThrustCache

Device memory cache (allocator) for the Thrust Library.

The strategy of this allocator is as follows: it only expands the size of the allocated memory, and does not free the memory on calling deallocate(value_type*, size_t), until clear() is called.

Public Types

using value_type = char
 

Public Member Functions

 ThrustCache ()
 
value_typeallocate (ptrdiff_t)
 Expands and returns the allocated memory upon request. More...
 
void deallocate (value_type *, size_t)
 Does not do anything. More...
 
void clear ()
 Deallocates the memory. More...
 

Static Public Member Functions

static ThrustCacheinstance ()
 Returns the reference to the singleton object. More...
 
static void allocate ()
 Allocates the memory managed by the singleton object. More...
 
static void deallocate ()
 Deallocates the memory managed by the singleton object. More...
 

Member Typedef Documentation

◆ value_type

Constructor & Destructor Documentation

◆ ThrustCache()

tinker::ThrustCache::ThrustCache ( )

Member Function Documentation

◆ allocate() [1/2]

static void tinker::ThrustCache::allocate ( )
static

Allocates the memory managed by the singleton object.

◆ allocate() [2/2]

value_type * tinker::ThrustCache::allocate ( ptrdiff_t  )

Expands and returns the allocated memory upon request.

◆ clear()

void tinker::ThrustCache::clear ( )

Deallocates the memory.

◆ deallocate() [1/2]

static void tinker::ThrustCache::deallocate ( )
static

Deallocates the memory managed by the singleton object.

◆ deallocate() [2/2]

void tinker::ThrustCache::deallocate ( value_type ,
size_t   
)

Does not do anything.

◆ instance()

static ThrustCache & tinker::ThrustCache::instance ( )
static

Returns the reference to the singleton object.

Macro Definition Documentation

◆ TINKER_CUDART

#define TINKER_CUDART   1

Macro for the CUDA runtime-enabled GPU code. Defined to 0 when the code is compiled on the CPU platform.

◆ TINKER_GPULANG_CUDA

#define TINKER_GPULANG_CUDA   0

Macro for the CUDA GPU code. Defined to 0 when

  • the code is compiled on the CPU platform;
  • OpenACC code is in use on the GPU platform.

◆ TINKER_GPULANG_OPENACC

#define TINKER_GPULANG_OPENACC   0

Macro for the OpenACC GPU code. Defined to 0 when

  • the code is compiled on the CPU platform;
  • only the CUDA code is in use on the GPU platform.

Enumeration Type Documentation

◆ Platform

enum class tinker::Platform
strong

Flags for the major platforms.

Enumerator
UNKNOWN 

Flag for the unknown platform.

ACC 

Flag for the OpenACC platform.

CUDA 

Flag for the CUDA platform.

Function Documentation

◆ accCompilerName()

std::string tinker::accCompilerName ( )

Returns the name of the OpenACC compiler.

◆ cudaCompilerName()

std::string tinker::cudaCompilerName ( )

Returns the name of the CUDA compiler.

◆ cudalibData()

void tinker::cudalibData ( RcOp  )

Sets up the CUDA variables including but not limited to CUDA streams, CUDA library handles, CUDA memory buffers, and integer units for the OpenACC queues.

◆ cxxCompilerName()

std::string tinker::cxxCompilerName ( )

Returns the name of the C++ compiler.

◆ exec()

std::string tinker::exec ( const std::string &  cmd)

Executes a command in shell and returns the output in a string.

◆ gpuData()

void tinker::gpuData ( RcOp  )

Sets up the GPU card.

◆ gpuGridSize()

int tinker::gpuGridSize ( int  nthreadsPerBlock)
Parameters
nthreadsPerBlockDimension of the thread blocks.
Returns
Recommended dimension of the thread grids.

◆ gpuMaxNParallel()

int tinker::gpuMaxNParallel ( int  idev)
Parameters
idevDevice number.
Returns
Maximum number of parallel threads on the device.

◆ platformData()

void tinker::platformData ( RcOp  )

◆ throwExceptionMissingFunction()

void tinker::throwExceptionMissingFunction ( const char *  functionName,
const char *  file,
int  lineNum 
)

Variable Documentation

◆ dptr_buf

void* tinker::dptr_buf
extern

Preallocated device memory.

◆ idevice

int tinker::idevice
extern

Device ID number in use.

◆ ndevice

int tinker::ndevice
extern

Total number of visible devices.

◆ pinned_buf

void* tinker::pinned_buf
extern

Preallocated pinned host memory.

◆ pltfm_config

Platform tinker::pltfm_config
extern

Platform in use.