1#ifndef MODULE_DEVICE_H_
2#define MODULE_DEVICE_H_
14template <
typename Device>
52 const std::string& basis_type);
63int stringCmp(
const void* a,
const void* b);
66int set_device_by_rank(
const MPI_Comm mpi_comm = MPI_COMM_WORLD);
71template <
typename Device>
77template <
typename Device>
83#if defined(__CUDA) || defined(__ROCM)
85void print_device_info<base_device::DEVICE_GPU>(
const base_device::DEVICE_GPU *ctx, std::ofstream &ofs_device);
88void record_device_memory<base_device::DEVICE_GPU>(
const base_device::DEVICE_GPU* dev, std::ofstream& ofs_device, std::string str,
size_t size);
98#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 && !defined(__CUDA_ON_DCU)
99static __inline__ __device__
double atomicAdd(
double* address,
double val)
101 unsigned long long int* address_as_ull = (
unsigned long long int*)address;
102 unsigned long long int old = *address_as_ull, assumed;
106 old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val + __longlong_as_double(assumed)));
109 }
while (assumed != old);
110 return __longlong_as_double(old);
#define T
Definition exp.cpp:237
base_device::AbacusDevice_t get_device_type(const Device *dev)
std::string get_current_precision(const float *var)
Definition device.cpp:36
AbacusDevice_t
Definition types.h:12
string device_flag
Definition pw_test.cpp:13