Skip to content
Snippets Groups Projects
Commit 42cb733f authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Tuning CUDA traversers.

parent ed4f9974
No related branches found
No related tags found
No related merge requests found
...@@ -68,9 +68,10 @@ class TestGridEntity ...@@ -68,9 +68,10 @@ class TestGridEntity
}; };
__global__ void testKernel( const tnlTestGrid* grid ) template< typename GridType, typename GridEntity >
__global__ void testKernel( const GridType* grid )
{ {
TestGridEntity entity( *grid ); GridEntity entity( *grid );
} }
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
...@@ -81,7 +82,8 @@ int main( int argc, char* argv[] ) ...@@ -81,7 +82,8 @@ int main( int argc, char* argv[] )
dim3 cudaGridSize( gridXSize / 16 + ( gridXSize % 16 != 0 ), dim3 cudaGridSize( gridXSize / 16 + ( gridXSize % 16 != 0 ),
gridYSize / 16 + ( gridYSize % 16 != 0 ) ); gridYSize / 16 + ( gridYSize % 16 != 0 ) );
typedef tnlTestGrid GridType; //typedef tnlTestGrid GridType;
typedef tnlGrid< 2, double, tnlCuda > GridType;
typedef typename GridType::VertexType VertexType; typedef typename GridType::VertexType VertexType;
typedef typename GridType::CoordinatesType CoordinatesType; typedef typename GridType::CoordinatesType CoordinatesType;
GridType grid; GridType grid;
...@@ -93,7 +95,7 @@ int main( int argc, char* argv[] ) ...@@ -93,7 +95,7 @@ int main( int argc, char* argv[] )
auto t_start = std::chrono::high_resolution_clock::now(); auto t_start = std::chrono::high_resolution_clock::now();
while( iteration < 1000 ) while( iteration < 1000 )
{ {
testKernel<<< cudaGridSize, cudaBlockSize >>>( cudaGrid ); testKernel< GridType, typename GridType::Cell ><<< cudaGridSize, cudaBlockSize >>>( cudaGrid );
cudaThreadSynchronize(); cudaThreadSynchronize();
iteration++; iteration++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment