CudaPmeSolverUtil.C File Reference

#include <stdio.h>
#include <algorithm>
#include <cuda_runtime.h>
#include "ComputeNonbondedUtil.h"
#include "ComputePmeCUDAMgr.h"
#include "CudaPmeSolver.h"
#include "CudaPmeSolverUtil.h"

Go to the source code of this file.

Functions

void CcdCallBacksReset (void *ignored, double curWallTime)
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)


Function Documentation

void CcdCallBacksReset ( void *  ignored,
double  curWallTime 
)

void writeComplexToDisk ( const float2 d_data,
const int  size,
const char *  filename,
cudaStream_t  stream 
)

Definition at line 14 of file CudaPmeSolverUtil.C.

References cudaCheck, x, and y.

00014                                                                                                          {
00015   fprintf(stderr, "writeComplexToDisk %d %s\n", size, filename);
00016   float2* h_data = new float2[size];
00017   copy_DtoH<float2>(d_data, h_data, size, stream);
00018   cudaCheck(cudaStreamSynchronize(stream));
00019   FILE *handle = fopen(filename, "w");
00020   for (int i=0;i < size;i++)
00021     fprintf(handle, "%f %f\n", h_data[i].x, h_data[i].y);
00022   fclose(handle);
00023   delete [] h_data;
00024 }

void writeHostComplexToDisk ( const float2 h_data,
const int  size,
const char *  filename 
)

Definition at line 26 of file CudaPmeSolverUtil.C.

References x, and y.

00026                                                                                         {
00027   FILE *handle = fopen(filename, "w");
00028   for (int i=0;i < size;i++)
00029     fprintf(handle, "%f %f\n", h_data[i].x, h_data[i].y);
00030   fclose(handle);
00031 }

void writeRealToDisk ( const float *  d_data,
const int  size,
const char *  filename,
cudaStream_t  stream 
)

Definition at line 33 of file CudaPmeSolverUtil.C.

References cudaCheck.

00033                                                                                                      {
00034   fprintf(stderr, "writeRealToDisk %d %s\n", size, filename);
00035   float* h_data = new float[size];
00036   copy_DtoH<float>(d_data, h_data, size, stream);
00037   cudaCheck(cudaStreamSynchronize(stream));
00038   FILE *handle = fopen(filename, "w");
00039   for (int i=0;i < size;i++)
00040     fprintf(handle, "%f\n", h_data[i]);
00041   fclose(handle);
00042   delete [] h_data;
00043 }


Generated on Thu Sep 21 01:17:15 2017 for NAMD by  doxygen 1.4.7