"...ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "01726081140bef58b9c64ca2e2978311bd621c56"
Commit eb2c0d30 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

sharedMemoryPerBlock now obtained from gpuContext

parent e69c8c66
...@@ -63,14 +63,6 @@ amoebaGpuContext amoebaGpuInit( _gpuContext* gpu ) ...@@ -63,14 +63,6 @@ amoebaGpuContext amoebaGpuInit( _gpuContext* gpu )
#endif #endif
amoebaGpu->numberOfSorWorkVectors = 4; amoebaGpu->numberOfSorWorkVectors = 4;
if( gpu->sm_version >= SM_20 ){
amoebaGpu->sharedMemoryPerBlock = 49152;
} else if( gpu->sm_version >= SM_12 ){
amoebaGpu->sharedMemoryPerBlock = 16384;
} else {
amoebaGpu->sharedMemoryPerBlock = 8192;
}
amoebaGpu->paddedNumberOfAtoms = gpu->sim.paddedNumberOfAtoms; amoebaGpu->paddedNumberOfAtoms = gpu->sim.paddedNumberOfAtoms;
amoebaGpu->amoebaSim.numberOfAtoms = gpu->natoms; amoebaGpu->amoebaSim.numberOfAtoms = gpu->natoms;
amoebaGpu->amoebaSim.paddedNumberOfAtoms = gpu->sim.paddedNumberOfAtoms; amoebaGpu->amoebaSim.paddedNumberOfAtoms = gpu->sim.paddedNumberOfAtoms;
...@@ -183,7 +175,9 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log ) ...@@ -183,7 +175,9 @@ void gpuPrintCudaAmoebaGmxSimulation(amoebaGpuContext amoebaGpu, FILE* log )
(void) fprintf( log, "\n\n" ); (void) fprintf( log, "\n\n" );
(void) fprintf( log, " gpuContext %p\n", amoebaGpu->gpuContext ); (void) fprintf( log, " gpuContext %p\n", amoebaGpu->gpuContext );
(void) fprintf( log, " log %p\n", amoebaGpu->log ); (void) fprintf( log, " log %p\n", amoebaGpu->log );
(void) fprintf( log, " sharedMemoryPerBlock %u\n", amoebaGpu->sharedMemoryPerBlock ); (void) fprintf( log, " sm_version %u\n", gpu->sm_version );
(void) fprintf( log, " device %u\n", gpu->device );
(void) fprintf( log, " sharedMemoryPerBlock %u\n", gpu->sharedMemoryPerBlock );
(void) fprintf( log, " pMapArray %p\n", amoebaGpu->pMapArray ); (void) fprintf( log, " pMapArray %p\n", amoebaGpu->pMapArray );
(void) fprintf( log, " dMapArray %p\n", amoebaGpu->dMapArray ); (void) fprintf( log, " dMapArray %p\n", amoebaGpu->dMapArray );
(void) fprintf( log, " bOutputBufferPerWarp %d\n", amoebaGpu->bOutputBufferPerWarp ); (void) fprintf( log, " bOutputBufferPerWarp %d\n", amoebaGpu->bOutputBufferPerWarp );
...@@ -3490,7 +3484,7 @@ tgx = 0; ...@@ -3490,7 +3484,7 @@ tgx = 0;
unsigned int getThreadsPerBlock( amoebaGpuContext amoebaGpu, unsigned int sharedMemoryPerThread ) unsigned int getThreadsPerBlock( amoebaGpuContext amoebaGpu, unsigned int sharedMemoryPerThread )
{ {
unsigned int grid = amoebaGpu->gpuContext->grid; unsigned int grid = amoebaGpu->gpuContext->grid;
unsigned int threadsPerBlock = (amoebaGpu->sharedMemoryPerBlock + grid -1)/(grid*sharedMemoryPerThread); unsigned int threadsPerBlock = (amoebaGpu->gpuContext->sharedMemoryPerBlock + grid -1)/(grid*sharedMemoryPerThread);
threadsPerBlock = threadsPerBlock < 1 ? 1 : threadsPerBlock; threadsPerBlock = threadsPerBlock < 1 ? 1 : threadsPerBlock;
threadsPerBlock *= grid; threadsPerBlock *= grid;
......
...@@ -47,8 +47,6 @@ struct _amoebaGpuContext { ...@@ -47,8 +47,6 @@ struct _amoebaGpuContext {
FILE* log; FILE* log;
unsigned int sharedMemoryPerBlock;
// diagnostic arrays // diagnostic arrays
MapIntFloat** pMapArray; MapIntFloat** pMapArray;
......
...@@ -1207,7 +1207,7 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu ) ...@@ -1207,7 +1207,7 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu )
" Ebuf=%u ixnCt=%lu workUnits=%u sm=%d device=%d sharedMemoryPerBlock=%u\n", " Ebuf=%u ixnCt=%lu workUnits=%u sm=%d device=%d sharedMemoryPerBlock=%u\n",
amoebaGpu->nonbondBlocks, threadsPerBlock, amoebaGpu->bOutputBufferPerWarp, amoebaGpu->nonbondBlocks, threadsPerBlock, amoebaGpu->bOutputBufferPerWarp,
sizeof(KirkwoodEDiffParticle), sizeof(KirkwoodEDiffParticle)*threadsPerBlock, sizeof(KirkwoodEDiffParticle), sizeof(KirkwoodEDiffParticle)*threadsPerBlock,
amoebaGpu->energyOutputBuffers, (*gpu->psInteractionCount)[0], gpu->sim.workUnits, gpu->sm_version, gpu->device, amoebaGpu->sharedMemoryPerBlock ); amoebaGpu->energyOutputBuffers, (*gpu->psInteractionCount)[0], gpu->sim.workUnits, gpu->sm_version, gpu->device, gpu->sharedMemoryPerBlock );
//gpuPrintCudaAmoebaGmxSimulation(amoebaGpu, amoebaGpu->log ); //gpuPrintCudaAmoebaGmxSimulation(amoebaGpu, amoebaGpu->log );
(void) fflush( amoebaGpu->log ); (void) fflush( amoebaGpu->log );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment