#include <cuda.h>
#include <cufft.h>
#include <stdio.h>
#include "PmeSolverUtil.h"
#include "CudaUtils.h"
#include "CudaPmeSolverUtilKernel.h"
#include "ReductionMgr.h"
#include "HipDefines.h"
 
Go to the source code of this file.
 | 
| void  | writeComplexToDisk (const float2 *d_data, const int size, const char *filename, cudaStream_t stream) | 
|   | 
| void  | writeHostComplexToDisk (const float2 *h_data, const int size, const char *filename) | 
|   | 
| void  | writeRealToDisk (const float *d_data, const int size, const char *filename, cudaStream_t stream) | 
|   | 
◆ cufftCheck
      
        
          | #define cufftCheck | 
          ( | 
            | 
          stmt | ) | 
           | 
        
      
 
Value:do {                                            \
  cufftResult err = stmt;                                               \
  if (err != CUFFT_SUCCESS) {                                           \
        char msg[128];  \
          sprintf(msg, "%s in file %s, function %s\n", #stmt,__FILE__,__FUNCTION__); \
          cudaDie(msg); \
  }                                                                     \
} while(0)
 
Definition at line 29 of file CudaPmeSolverUtil.h.
Referenced by CudaFFTCompute::backward(), CudaPmeOneDevice::compute(), CudaPmeOneDevice::CudaPmeOneDevice(), CudaFFTCompute::forward(), CudaFFTCompute::~CudaFFTCompute(), and CudaPmeOneDevice::~CudaPmeOneDevice().
 
 
◆ writeComplexToDisk()
      
        
          | void writeComplexToDisk  | 
          ( | 
          const float2 *  | 
          d_data,  | 
        
        
           | 
           | 
          const int  | 
          size,  | 
        
        
           | 
           | 
          const char *  | 
          filename,  | 
        
        
           | 
           | 
          cudaStream_t  | 
          stream  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 27 of file CudaPmeSolverUtil.C.
References cudaCheck.
   28   fprintf(stderr, 
"writeComplexToDisk %d %s\n", size, filename);
    29   float2* h_data = 
new float2[size];
    30   copy_DtoH<float2>(d_data, h_data, size, stream);
    32   FILE *handle = fopen(filename, 
"w");
    33   for (
int i=0;i < size;i++)
    34     fprintf(handle, 
"%f %f\n", h_data[i].x, h_data[i].y);
 
 
 
 
◆ writeHostComplexToDisk()
      
        
          | void writeHostComplexToDisk  | 
          ( | 
          const float2 *  | 
          h_data,  | 
        
        
           | 
           | 
          const int  | 
          size,  | 
        
        
           | 
           | 
          const char *  | 
          filename  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 39 of file CudaPmeSolverUtil.C.
   40   FILE *handle = fopen(filename, 
"w");
    41   for (
int i=0;i < size;i++)
    42     fprintf(handle, 
"%f %f\n", h_data[i].x, h_data[i].y);
  
 
 
◆ writeRealToDisk()
      
        
          | void writeRealToDisk  | 
          ( | 
          const float *  | 
          d_data,  | 
        
        
           | 
           | 
          const int  | 
          size,  | 
        
        
           | 
           | 
          const char *  | 
          filename,  | 
        
        
           | 
           | 
          cudaStream_t  | 
          stream  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 46 of file CudaPmeSolverUtil.C.
References cudaCheck.
   47   fprintf(stderr, 
"writeRealToDisk %d %s\n", size, filename);
    48   float* h_data = 
new float[size];
    49   copy_DtoH<float>(d_data, h_data, size, stream);
    51   FILE *handle = fopen(filename, 
"w");
    52   for (
int i=0;i < size;i++)
    53     fprintf(handle, 
"%f\n", h_data[i]);