Skip to content
Snippets Groups Projects
Commit 320b5916 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed old tests for CUDA reduction

New tests are in src/UnitTests/Containers/
parent b393305b
No related branches found
No related tags found
Loading
set( headers tnlCudaTester.h
tnlCudaReductionTester.h )
if( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( tnlCudaTest${mpiExt} ${headers} tnlCudaTest.cu )
TARGET_LINK_LIBRARIES( tnlCudaTest${mpiExt} ${CPPUNIT_LIBRARIES}
tnl${mpiExt} )
CUDA_ADD_EXECUTABLE( tnl-reduction-test${mpiExt} ${headers} reduction-test.cu )
TARGET_LINK_LIBRARIES( tnl-reduction-test${mpiExt} ${CPPUNIT_LIBRARIES}
tnl${mpiExt} )
endif()
/***************************************************************************
reduction-test.cu - description
-------------------
begin : Mar 20, 2013
copyright : (C) 2013 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#include "CudaReductionTester.h"
#include "../../tnlUnitTestStarter.h"
int main( int argc, char* argv[] )
{
if( ! tnlUnitTestStarter :: run< CudaReductionTester >() )
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
This diff is collapsed.
/***************************************************************************
Devices::CudaTest.cu - description
-------------------
begin : Mar 20, 2013
copyright : (C) 2013 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#include "tnlCudaTester.h"
#include "../../tnlUnitTestStarter.h"
int main( int argc, char* argv[] )
{
if( ! tnlUnitTestStarter :: run< tnlCudaTester >() )
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
/***************************************************************************
Devices::CudaTester.h - description
-------------------
begin : Mar 20, 2013
copyright : (C) 2013 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#ifndef tnlCudaTESTER_H_
#define tnlCudaTESTER_H_
#include <TNL/tnlConfig.h>
#ifdef HAVE_CPPUNIT
#include <cppunit/TestSuite.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestCase.h>
#include <cppunit/Message.h>
#include <TNL/Devices/Cuda.h>
#ifdef HAVE_CUDA
__global__ void simpleKernel()
{
int tIdx = threadIdx. x;
tIdx ++;
}
#endif
using namespace TNL;
class Devices::CudaTester : public CppUnit :: TestCase
{
public:
Devices::CudaTester(){};
virtual
~Devices::CudaTester(){};
static CppUnit :: Test* suite()
{
CppUnit :: TestSuite* suiteOfTests = new CppUnit :: TestSuite( "Devices::CudaTester" );
CppUnit :: TestResult result;
suiteOfTests -> addTest( new CppUnit :: TestCaller< Devices::CudaTester >(
"deviceTest",
&Devices::CudaTester :: deviceTest )
);
return suiteOfTests;
};
void deviceTest()
{
#ifdef HAVE_CUDA
dim3 blockSize, gridSize;
blockSize. x = 1;
gridSize. x = 1;
simpleKernel<<< gridSize, blockSize >>>();
if( ! TNL_CHECK_CUDA_DEVICE )
{
std::cerr << "Test with simple kernel failed. It seems that the CUDA device does not work properly." << std::endl;
CPPUNIT_ASSERT( false );
}
#endif
CPPUNIT_ASSERT( true );
};
};
#else
class tnlCudaTester
{};
#endif /* HAVE_CPPUNIT */
#endif /* Devices::CudaTESTER_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment