Skip to content

Commit

Permalink
implemented suggested PR-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrude committed Apr 22, 2020
1 parent c07a10d commit 6f46a04
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 36 deletions.
36 changes: 18 additions & 18 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ cmake_minimum_required(VERSION 3.15)
# Add subdirectories.
################################################################################

ADD_SUBDIRECTORY("acc/")
ADD_SUBDIRECTORY("atomic/")
ADD_SUBDIRECTORY("block/shared/")
ADD_SUBDIRECTORY("block/sync/")
ADD_SUBDIRECTORY("core/")
ADD_SUBDIRECTORY("event/")
ADD_SUBDIRECTORY("idx/")
ADD_SUBDIRECTORY("kernel/")
ADD_SUBDIRECTORY("math/mathOps/")
ADD_SUBDIRECTORY("math/sincos/")
ADD_SUBDIRECTORY("mem/buf/")
ADD_SUBDIRECTORY("mem/view/")
ADD_SUBDIRECTORY("mem/p2p/")
ADD_SUBDIRECTORY("meta/")
ADD_SUBDIRECTORY("queue/")
ADD_SUBDIRECTORY("rand/")
ADD_SUBDIRECTORY("time/")
ADD_SUBDIRECTORY("vec/")
add_subdirectory("acc/")
add_subdirectory("atomic/")
add_subdirectory("block/shared/")
add_subdirectory("block/sync/")
add_subdirectory("core/")
add_subdirectory("event/")
add_subdirectory("idx/")
add_subdirectory("kernel/")
add_subdirectory("math/mathOps/")
add_subdirectory("math/sincos/")
add_subdirectory("mem/buf/")
add_subdirectory("mem/view/")
add_subdirectory("mem/p2p/")
add_subdirectory("meta/")
add_subdirectory("queue/")
add_subdirectory("rand/")
add_subdirectory("time/")
add_subdirectory("vec/")
14 changes: 7 additions & 7 deletions test/unit/math/mathOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

SET(_TARGET_NAME "mathOps")
set(_TARGET_NAME "mathOps")


append_recursive_files_add_to_src_group("src/" "src/" "cpp" _FILES_SOURCE)
Expand All @@ -26,22 +26,22 @@ if(ALPAKA_ACC_GPU_HIP_ENABLE)
endif()


ALPAKA_ADD_EXECUTABLE(
alpaka_add_executable(
${_TARGET_NAME}
${_FILES_SOURCE})
TARGET_INCLUDE_DIRECTORIES(
target_include_directories(
${_TARGET_NAME}
PRIVATE ${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(
target_link_libraries(
${_TARGET_NAME}
PRIVATE common)
SET_TARGET_PROPERTIES(
set_target_properties(
${_TARGET_NAME}
PROPERTIES
COMPILE_OPTIONS
$<$<CXX_COMPILER_ID:clang>:"-ffp-contract=off"> # ffp-contract: https://llvm.org/docs/CompileCudaWithLLVM.html#id5
)

SET_TARGET_PROPERTIES(${_TARGET_NAME} PROPERTIES FOLDER "test/unit")
set_target_properties(${_TARGET_NAME} PROPERTIES FOLDER "test/unit")

ADD_TEST(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME} ${_ALPAKA_TEST_OPTIONS})
add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME} ${_ALPAKA_TEST_OPTIONS})
10 changes: 5 additions & 5 deletions test/unit/math/mathOps/include/DataGen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ namespace math {
"Set of args must provide > 2 entries." );
constexpr auto max = std::numeric_limits< TData >::max();
constexpr auto low = std::numeric_limits< TData >::lowest();
std::default_random_engine eng{ seed };
std::default_random_engine eng{
static_cast< std::default_random_engine::result_type >( seed ) };

// These pseudo-random numbers are implementation/platform specific!
std::uniform_real_distribution< TData > dist(0,1000);
std::uniform_real_distribution< TData > distOne(-1,1);

for(size_t k = 0; k < TFunctor::arity_nr; ++k)
std::uniform_real_distribution< TData > dist( 0, 1000 );
std::uniform_real_distribution< TData > distOne( -1, 1 );
for( size_t k = 0; k < TFunctor::arity_nr; ++k )
{
bool matchedSwitch = false;
switch( functor.ranges[k] )
Expand Down
4 changes: 0 additions & 4 deletions test/unit/math/mathOps/include/Functor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace math {
auto execute( \
TAcc const & acc, \
TArgs const & ... args ) const \
-> decltype( ALPAKA_OP(acc, args... ) ) \
{ \
return ALPAKA_OP(acc, args... ); \
} \
Expand All @@ -62,7 +61,6 @@ namespace math {
auto execute( \
TAcc const & acc, \
TArgs const &... args ) const \
-> decltype( STD_OP( args... ) ) \
{ \
alpaka::ignore_unused( acc ); \
return STD_OP( args... ); \
Expand All @@ -77,7 +75,6 @@ namespace math {
auto operator()( \
ArgsItem<T, Arity::Unary> const & args, \
TAcc const & acc = nullptr) const \
-> decltype(execute(acc, args.arg[0])) \
{ \
return execute(acc, args.arg[0]); \
} \
Expand All @@ -91,7 +88,6 @@ namespace math {
auto operator()( \
ArgsItem<T, Arity::Binary> const & args, \
TAcc const & acc = nullptr) const \
-> decltype(execute(acc, args.arg[0], args.arg[1])) \
{ \
return execute(acc, args.arg[0], args.arg[1]); \
} \
Expand Down
5 changes: 3 additions & 2 deletions test/unit/math/mathOps/src/mathOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ struct TestKernel
//! @tparam TAcc Accelerator.
//! @tparam TFunctor Functor defined in Functor.hpp.
//! @param acc Accelerator given from alpaka.
//! @param functor Accesible with operator().
//! @param functor Accessible with operator().
ALPAKA_NO_HOST_ACC_WARNING
template<typename TAcc,
typename TResults,
typename TFunctor,
typename TArgs>

ALPAKA_FN_ACC auto operator()(
TAcc const & acc,
TResults const & results,
TFunctor const & functor,
TArgs const & args) const
TArgs const & args) const noexcept
-> void
{
for( size_t i = 0; i < TArgs::capacity; ++i )
Expand Down

0 comments on commit 6f46a04

Please sign in to comment.