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

Adding CUDA prefix sum unit test.

parent 6f0209ca
No related branches found
No related tags found
1 merge request!32Expression templates 2
...@@ -274,7 +274,7 @@ struct CudaPrefixSumKernelLauncher ...@@ -274,7 +274,7 @@ struct CudaPrefixSumKernelLauncher
/**** /****
* \brief Starts prefix sum in CUDA. * \brief Starts prefix sum in CUDA.
* *
* \tparam Operation operation to be peformed on particular elements - addition usually * \tparam Operation operation to be performed on particular elements - addition usually
* \tparam VolatileOperation - volatile version of Operation * \tparam VolatileOperation - volatile version of Operation
* \param size is number of elements to be scanned * \param size is number of elements to be scanned
* \param blockSize is CUDA block size * \param blockSize is CUDA block size
...@@ -282,7 +282,7 @@ struct CudaPrefixSumKernelLauncher ...@@ -282,7 +282,7 @@ struct CudaPrefixSumKernelLauncher
* \param deviceOutput is pointer to resulting array, can be the same as input * \param deviceOutput is pointer to resulting array, can be the same as input
* \param operation is instance of Operation * \param operation is instance of Operation
* \param volatileOperation is instance of VolatileOperation * \param volatileOperation is instance of VolatileOperation
* \param zero is neutral element for fiven Operation * \param zero is neutral element for given Operation
*/ */
template< typename Operation, template< typename Operation,
typename VolatileOperation > typename VolatileOperation >
......
IF( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( CudaPrefixSumTest CudaPrefixSumTest.cu
OPTIONS ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( CudaPrefixSumTest ${GTEST_BOTH_LIBRARIES} )
ADD_TEST( CudaPrefixSumTest ${EXECUTABLE_OUTPUT_PATH}/CudaPrefixSumTest${CMAKE_EXECUTABLE_SUFFIX} )
ENDIF()
/***************************************************************************
CudaPrefixSumTest.cu - description
-------------------
begin : Jun 6, 2019
copyright : (C) 2019 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
/////
// NOTE: This test serves mainly for testing CUDA prefix sum when more than
// one CUDA grid is used. To avoid allocation of extremely large vectors and to
// speed-up this unit test, we decrease the grid size artificialy.
#pragma once
#ifdef HAVE_GTEST
#include <limits>
#include <TNL/Experimental/Arithmetics/Quad.h>
#include <TNL/Containers/Vector.h>
#include <TNL/Containers/VectorView.h>
#include "VectorTestSetup.h"
#include "gtest/gtest.h"
using namespace TNL;
using namespace TNL::Containers;
using namespace TNL::Containers::Algorithms;
using namespace TNL::Arithmetics;
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