ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
common_cuda.cu File Reference
#include "errorhandling.hpp"
#include "utils.cuh"
#include "utils.hpp"
#include <cuda.h>
#include <cuda_runtime.h>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <string>
#include <utility>

Go to the source code of this file.

Functions

static std::basic_ostream< char > & operator<< (std::basic_ostream< char > &os, const dim3 &dim)
 
static std::basic_ostream< char > & operator<< (std::basic_ostream< char > &os, cudaError_t CU_err)
 
void cuda_check_errors_exit (const dim3 &block, const dim3 &grid, const char *function, const char *file, unsigned int line)
 In case of error during a CUDA operation, print the error message and exit.
 
void cuda_safe_mem_exit (cudaError_t CU_err, const char *file, unsigned int line)
 In case of error during CUDA memory allocation and memory copy, print the error message and exit.
 

Variables

cudaStream_t stream [1]
 CUDA streams for parallel computing on CPU and GPU.
 

Function Documentation

◆ cuda_check_errors_exit()

void cuda_check_errors_exit ( const dim3 &  block,
const dim3 &  grid,
const char *  function,
const char *  file,
unsigned int  line 
)

In case of error during a CUDA operation, print the error message and exit.

Definition at line 48 of file common_cuda.cu.

References block().

Referenced by assign_charges(), and assign_forces().

◆ cuda_safe_mem_exit()

void cuda_safe_mem_exit ( cudaError_t  CU_err,
const char *  file,
unsigned int  line 
)

In case of error during CUDA memory allocation and memory copy, print the error message and exit.

Parameters
CU_errcuda error code
file.cu file were the error took place
lineline of the file were the error took place

Definition at line 61 of file common_cuda.cu.

◆ operator<<() [1/2]

static std::basic_ostream< char > & operator<< ( std::basic_ostream< char > &  os,
const dim3 &  dim 
)
static

Definition at line 34 of file common_cuda.cu.

Referenced by Utils::MemcpyOArchive::operator&().

◆ operator<<() [2/2]

static std::basic_ostream< char > & operator<< ( std::basic_ostream< char > &  os,
cudaError_t  CU_err 
)
static

Definition at line 34 of file common_cuda.cu.

Variable Documentation

◆ stream

cudaStream_t stream[1]

CUDA streams for parallel computing on CPU and GPU.

Definition at line 34 of file common_cuda.cu.

Referenced by GpuParticleData::Storage::copy_particles_to_device(), cuda_init(), cuda_set_device(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::getInnerSweep(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::getInnerSweep(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::getOuterSweep(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::getOuterSweep(), walberla::pystencils::CollideSweepDoublePrecisionLeesEdwardsCUDA::getSweep(), walberla::pystencils::CollideSweepDoublePrecisionThermalizedCUDA::getSweep(), walberla::pystencils::CollideSweepSinglePrecisionLeesEdwardsCUDA::getSweep(), walberla::pystencils::CollideSweepSinglePrecisionThermalizedCUDA::getSweep(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::getSweep(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::getSweep(), walberla::pystencils::InitialPDFsSetterDoublePrecisionCUDA::getSweep(), walberla::pystencils::InitialPDFsSetterSinglePrecisionCUDA::getSweep(), walberla::pystencils::StreamSweepDoublePrecisionCUDA::getSweep(), walberla::pystencils::StreamSweepSinglePrecisionCUDA::getSweep(), walberla::pystencils::CollideSweepDoublePrecisionLeesEdwardsCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepDoublePrecisionThermalizedCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepSinglePrecisionLeesEdwardsCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepSinglePrecisionThermalizedCUDA::getSweepOnCellInterval(), walberla::pystencils::InitialPDFsSetterDoublePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::InitialPDFsSetterSinglePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::StreamSweepDoublePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::StreamSweepSinglePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepDoublePrecisionLeesEdwardsCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepDoublePrecisionThermalizedCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepSinglePrecisionLeesEdwardsCUDA::getSweepOnCellInterval(), walberla::pystencils::CollideSweepSinglePrecisionThermalizedCUDA::getSweepOnCellInterval(), walberla::pystencils::InitialPDFsSetterDoublePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::InitialPDFsSetterSinglePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::StreamSweepDoublePrecisionCUDA::getSweepOnCellInterval(), walberla::pystencils::StreamSweepSinglePrecisionCUDA::getSweepOnCellInterval(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::inner(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::inner(), walberla::pystencils::CollideSweepDoublePrecisionLeesEdwardsCUDA::operator()(), walberla::pystencils::CollideSweepDoublePrecisionThermalizedCUDA::operator()(), walberla::pystencils::CollideSweepSinglePrecisionLeesEdwardsCUDA::operator()(), walberla::pystencils::CollideSweepSinglePrecisionThermalizedCUDA::operator()(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::operator()(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::operator()(), walberla::pystencils::InitialPDFsSetterDoublePrecisionCUDA::operator()(), walberla::pystencils::InitialPDFsSetterSinglePrecisionCUDA::operator()(), walberla::pystencils::StreamSweepDoublePrecisionCUDA::operator()(), walberla::pystencils::StreamSweepSinglePrecisionCUDA::operator()(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::outer(), walberla::lbm::Dynamic_UBB_single_precisionCUDA::outer(), walberla::lbm::Dynamic_UBB_double_precisionCUDA::run(), and walberla::lbm::Dynamic_UBB_single_precisionCUDA::run().