Skip to content

Commit

Permalink
Refactor math operations unit tests (#986)
Browse files Browse the repository at this point in the history
* rename `mathOps` to `math` unit test to match folder name like other tests
* merge `sincos` test target into `math` test
* move headers into src folder to remove relative includes
  • Loading branch information
BenjaminW3 authored Apr 27, 2020
1 parent 4a3d1c2 commit ade549f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 39 deletions.
3 changes: 1 addition & 2 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ add_subdirectory("core/")
add_subdirectory("event/")
add_subdirectory("idx/")
add_subdirectory("kernel/")
add_subdirectory("math/mathOps/")
add_subdirectory("math/sincos/")
add_subdirectory("math/")
add_subdirectory("mem/buf/")
add_subdirectory("mem/view/")
add_subdirectory("mem/p2p/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

set(_TARGET_NAME "mathOps")

set(_TARGET_NAME "math")

append_recursive_files_add_to_src_group("src/" "src/" "cpp" _FILES_SOURCE)
append_recursive_files_add_to_src_group("src/" "src/" "hpp" _FILES_HEADER)


message(STATUS "Disabling fast math options for math operation tests only.")
if(ALPAKA_ACC_GPU_CUDA_ENABLE)
list(REMOVE_ITEM
CUDA_NVCC_FLAGS "--ftz=true" "--prec-div=false" "--prec-sqrt=false" "--fmad=true" "--use_fast_math" "-use_fast_math")
Expand All @@ -25,10 +23,10 @@ if(ALPAKA_ACC_GPU_HIP_ENABLE)
HIP_NVCC_FLAGS "--ftz=true" "--prec-div=false" "--prec-sqrt=false" "--fmad=true" "--use_fast_math" "-use_fast_math")
endif()


alpaka_add_executable(
${_TARGET_NAME}
${_FILES_SOURCE})
${_FILES_SOURCE}
${_FILES_HEADER})
target_include_directories(
${_TARGET_NAME}
PRIVATE ${Boost_INCLUDE_DIRS})
Expand Down
24 changes: 0 additions & 24 deletions test/unit/math/sincos/CMakeLists.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#pragma once

#include "Defines.hpp"

#include <alpaka/test/acc/TestAccs.hpp>

#include <ostream>

namespace alpaka {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#pragma once

#include "Defines.hpp"

#include <random>
#include <limits>
#include <cassert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <iomanip>
#include <limits>


namespace alpaka {
namespace test {
namespace unit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#pragma once

#include "Defines.hpp"

#include <alpaka/alpaka.hpp>

#include <type_traits>

namespace alpaka {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "../include/Defines.hpp"
#include "../include/Buffer.hpp"
#include "../include/Functor.hpp"
#include "../include/DataGen.hpp"
#include "Defines.hpp"
#include "Buffer.hpp"
#include "Functor.hpp"
#include "DataGen.hpp"

#include <alpaka/test/acc/TestAccs.hpp>
#include <alpaka/test/queue/Queue.hpp>
Expand All @@ -28,7 +28,6 @@ struct TestKernel
typename TResults,
typename TFunctor,
typename TArgs>

ALPAKA_FN_ACC auto operator()(
TAcc const & acc,
TResults const & results,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ almost_equal(TAcc const & acc, FP x, FP y, int ulp)
|| alpaka::math::abs(acc, x-y) < std::numeric_limits<FP>::min();
}


class SinCosTestKernel
{
public:
Expand Down

0 comments on commit ade549f

Please sign in to comment.