37 #ifndef __GPU_MANAGER_H__ 38 #define __GPU_MANAGER_H__ 50 #include "cuda_runtime.h" 52 #define gpuErrChk(ans) { gpuAssert((ans), __FILE__, __LINE__); } 54 inline void gpuAssert(cudaError_t code,
const char *file,
int line,
bool abort=
true)
56 if (code != cudaSuccess)
58 fprintf(stderr,
"GPU ERROR: %s %s %d\n", cudaGetErrorString(code), file, line);
59 if (abort) exit(code);
88 void copyDataToGPU(
const AmpVecs& a );
90 void calcAmplitudeAll(
const Amplitude* amp,
unsigned long long offset,
91 const vector< vector< int > >* pvPermutations );
93 void assembleTerms(
int iAmpInd,
int nFact,
int nPerm );
95 void copyAmpsFromGPU(
AmpVecs& a );
98 double calcSumLogIntensity(
const vector< complex< double > >& prodCoef,
99 const vector< vector< bool > >& cohMtx );
101 void calcIntegral(
GDouble* result,
int iAmp,
int jAmp,
int iNGenEvents );
108 while( ( 1 << iPow ) < iNEvents ) iPow++;
114 static bool m_cudaDisplay;
117 unsigned int m_iNParticles;
118 unsigned long long m_iNEvents;
119 unsigned long long m_iNTrueEvents;
120 unsigned int m_iNAmps;
123 unsigned long long m_iEventArrSize;
124 unsigned long long m_iTrueEventArrSize;
125 unsigned long long m_iAmpArrSize;
126 unsigned int m_iVArrSize;
148 unsigned int m_iDimGridX;
149 unsigned int m_iDimGridY;
150 unsigned int m_iDimThreadX;
151 unsigned int m_iDimThreadY;
153 unsigned int m_iNBlocks;
154 unsigned int m_iNThreads;
158 unsigned int m_devProp_major;
164 #endif //__GPU_MANAGER_H__
void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
static int calcNEventsGPU(int iNEvents)