From 542b05df8a1f7cd3f4b287082d0785c913281f31 Mon Sep 17 00:00:00 2001 From: Fahri Ali Rahman Date: Thu, 6 Jun 2024 21:45:51 +0700 Subject: [PATCH] fixes for hip compilations --- include/nmtools/array/as_static.hpp | 5 +- include/nmtools/array/eval/hip/context.hpp | 51 ++- include/nmtools/array/index/flip.hpp | 19 +- include/nmtools/array/index/reduce.hpp | 144 ++++++ include/nmtools/array/view/decorator.hpp | 3 + include/nmtools/array/view/indexing.hpp | 5 + include/nmtools/array/view/slice.hpp | 9 +- include/nmtools/array/view/ufunc/reduce.hpp | 126 +---- include/nmtools/assert.hpp | 2 + include/nmtools/platform/assert/hip.hpp | 28 ++ include/nmtools/testing/data/array/add.hpp | 3 + tests/cuda/array/matmul.cpp | 238 +++++----- tests/hip/CMakeLists.txt | 77 ++-- tests/hip/array/arange.cpp | 24 +- tests/hip/array/cumprod.cpp | 114 ++--- tests/hip/array/cumsum.cpp | 114 ++--- tests/hip/array/flip.cpp | 30 ++ tests/hip/array/full.cpp | 64 +-- tests/hip/array/matmul.cpp | 480 ++++++++++---------- tests/hip/array/mean.cpp | 34 +- tests/hip/array/ones.cpp | 76 ++-- tests/hip/array/prod.cpp | 244 +++++----- tests/hip/array/reductions/add.cpp | 6 +- tests/hip/array/reductions/multiply.cpp | 12 +- tests/hip/array/slice.cpp | 8 +- tests/hip/array/sum.cpp | 248 +++++----- tests/hip/array/ufuncs/add.cpp | 4 +- tests/hip/array/zeros.cpp | 76 ++-- tests/hip/composition/add_tanh.cpp | 4 +- tests/hip/composition/mean_subtract.cpp | 46 -- tests/hip/composition/reduce_add_divide.cpp | 4 +- 31 files changed, 1186 insertions(+), 1112 deletions(-) create mode 100644 include/nmtools/array/index/reduce.hpp create mode 100644 include/nmtools/platform/assert/hip.hpp delete mode 100644 tests/hip/composition/mean_subtract.cpp diff --git a/include/nmtools/array/as_static.hpp b/include/nmtools/array/as_static.hpp index 47caae66d..acf084edd 100644 --- a/include/nmtools/array/as_static.hpp +++ b/include/nmtools/array/as_static.hpp @@ -19,11 +19,12 @@ namespace nmtools::array auto operator()() const noexcept { - if constexpr (meta::is_dynamic_index_array_v) { + // TODO: return maybe when size > max_dim + if constexpr (meta::is_resizable_v) { using element_type = meta::get_element_type_t; using result_type = utl::static_vector; auto result = result_type{}; - result.resize(attribute.size()); + result.resize(nmtools::size(attribute)); for (size_t i=0; icopy_buffer(output_buffer,output); } - template - auto run(const function_t& f, output_array_t& output, const arg0_t& arg0, const args_t&...args) + template + auto map_to_device(const functional::functor_t& f) { + static_assert( meta::len_v == 0 ); + if constexpr (meta::is_same_v) { + return f; + } else { + constexpr auto N = meta::len_v; + auto attributes = meta::template_reduce([&](auto init, auto I){ + auto attribute = array::as_static(at(f.attributes,I)); + return utility::tuple_append(init,attribute); + }, nmtools_tuple{}); + return functional::functor_t{ + {f.fmap, f.operands, attributes} + }; + } + } // map_to_device + + template typename tuple, typename...functors_t, typename operands_t> + auto map_to_device(const functional::functor_composition_t,operands_t>& f) + { + static_assert( meta::len_v == 0 ); + auto functors = meta::template_reduce([&](auto init, auto I){ + auto functor = map_to_device(at(f.functors,I)); + return utility::tuple_append(init,functor); + }, nmtools_tuple{}); + return functional::functor_composition_t{functors}; + } // map_to_device + + template typename tuple, typename...operands_t> + auto run(const function_t& f, output_array_t& output, const tuple& operands) + { + #if 0 auto args_pack = [&](){ if constexpr (meta::is_tuple_v) { static_assert( sizeof...(args_t) == 0, "nmtools error" ); @@ -312,6 +342,23 @@ namespace nmtools::array::hip using sequence_t = meta::make_index_sequence>; this->run_(output,f,gpu_args_pack,sequence_t{}); + #else + constexpr auto N = sizeof...(operands_t); + auto device_operands = meta::template_reduce([&](auto init, auto index){ + const auto& arg_i = nmtools::at(operands,index); + if constexpr (meta::is_num_v) { + return utility::tuple_append(init,arg_i); + } else { + auto device_array = create_array(*arg_i); + return utility::tuple_append(init,device_array); + } + }, nmtools_tuple<>{}); + + // e.g. to convert dynamic allocation to static vector to run on device kernels + auto fn = map_to_device(f); + using sequence_t = meta::make_index_sequence>; + this->run_(output,fn,device_operands,sequence_t{}); + #endif } }; diff --git a/include/nmtools/array/index/flip.hpp b/include/nmtools/array/index/flip.hpp index 223e1c614..061f6d13a 100644 --- a/include/nmtools/array/index/flip.hpp +++ b/include/nmtools/array/index/flip.hpp @@ -56,22 +56,27 @@ namespace nmtools::meta > { static constexpr auto vtype = [](){ + using slice_t [[maybe_unused]] = nmtools_tuple; if constexpr ( + !is_index_v + || !(is_index_array_v || is_index_v || is_none_v) + ) { + using type = error::FLIP_SLICES_UNSUPPORTED; + return as_value_v; + } else if constexpr ( is_constant_index_v - && (is_index_array_v || is_index_v || is_none_v) ) { - using slice_t = nmtools_tuple; using type = nmtools_array; return as_value_v; } else if constexpr ( - is_index_v - && (is_index_array_v || is_index_v || is_none_v) + is_clipped_integer_v ) { - using slice_t = nmtools_tuple; + using type = nmtools_static_vector; + return as_value_v; + } else { + // TODO: use small_vector using type = nmtools_list; return as_value_v; - } else { - return as_value_v>; } }(); using type = type_t; diff --git a/include/nmtools/array/index/reduce.hpp b/include/nmtools/array/index/reduce.hpp new file mode 100644 index 000000000..bbe760a23 --- /dev/null +++ b/include/nmtools/array/index/reduce.hpp @@ -0,0 +1,144 @@ +#ifndef NMTOOLS_ARRAY_INDEX_REDUCE_HPP +#define NMTOOLS_ARRAY_INDEX_REDUCE_HPP + +#include "nmtools/meta.hpp" +#include "nmtools/array/shape.hpp" + +namespace nmtools::index +{ + struct reduction_slices_t {}; + + template + constexpr auto reduction_slices(const indices_t& indices_, const shape_type& src_shape, const axis_type& axis, keepdims_type keepdims) + { + using result_t = meta::resolve_optype_t; + + auto slices = result_t {}; + [[maybe_unused]] auto dim = len(src_shape); + if constexpr (meta::is_resizable_v) { + slices.resize(dim); + } + + // helper lambda to check if axis i is in the specified axis for reduction + auto in_axis = [&](auto i){ + if constexpr (meta::is_index_v && meta::is_pointer_v) { + return i==*axis; + } else if constexpr (meta::is_index_v) { + using common_t = meta::promote_index_t; + return (common_t)i==(common_t)axis; + } else { + auto f_predicate = [i](auto axis){ + using common_t = meta::promote_index_t; + return (common_t)i==(common_t)axis; + }; + // axis is index array (reducing on multiple axes), + // axis may be pointer, but can't provide convenience function + // since may decay bounded array to pointer + if constexpr (meta::is_pointer_v) { + auto found = index::where(f_predicate, *axis); + return static_cast(len(found)); + } else { + auto found = index::where(f_predicate, axis); + return static_cast(len(found)); + } + } + }; + + // use the same type as axis_type for loop index + constexpr auto idx_vtype = [](){ + if constexpr (meta::is_constant_index_array_v) { + // shortcut for now, just use int + return meta::as_value_v; + } else if constexpr (meta::is_index_array_v) { + using type = meta::get_element_type_t; + return meta::as_value_v; + } else if constexpr (meta::is_integer_v) { + return meta::as_value_v; + } else { + return meta::as_value_v; + } + }(); + using index_t = meta::get_index_element_type_t; + using idx_t [[maybe_unused]] = meta::type_t>>; + + // indices and the referenced array may have different dim, + // this variable track index for indices_ + auto ii = idx_t{0}; + constexpr auto DIM = meta::len_v; + if constexpr (DIM > 0) { + // here, len(slices) already matched the dimension of source array + meta::template_for([&](auto index){ + constexpr auto i = decltype(index)::value; + // take all elements at given axis + if (in_axis(i)) { + // note that src_shape maybe constant index array + at(slices,i) = { + static_cast(0) + , static_cast(at(src_shape,meta::ct_v))}; + // if keepdims is true, also increment indices index + if (keepdims) + ii++; + } + // use indices otherwise, just slice with index:index+1 + else { + auto s = at(indices_,ii++); + at(slices,i) = { + static_cast(s) + , static_cast(s+1)}; + } + }); + } else { + for (size_t i=0; i(0) + , static_cast(at(src_shape,i))}; + // if keepdims is true, also increment indices index + if (keepdims) + ii++; + } + // use indices otherwise, just slice with index:index+1 + else { + auto s = at(indices_,ii++); + at(slices,i) = { + static_cast(s) + , static_cast(s+1)}; + } + } + } + return slices; + } // reduction_slices +} // namespace nmtools::index + +namespace nmtools::meta +{ + template + struct resolve_optype< + void, index::reduction_slices_t, indices_t, shape_type, axis_type, keepdims_type + > { + static constexpr auto vtype = [](){ + constexpr auto DIM = len_v; + [[maybe_unused]] + constexpr auto B_DIM = bounded_size_v; + using slice_type = nmtools_array; + // TODO: handle unsupported types + // TODO: compile-time inference + if constexpr (DIM > 0) { + using type = nmtools_array; + return as_value_v; + } else if constexpr (!is_fail_v) { + using type = nmtools_static_vector; + return as_value_v; + } else { + // TODO: support small_vector + using type = nmtools_list; + return as_value_v; + } + }(); + using type = type_t; + }; // reduction_slices_t +} // namespace nmtools::meta + +#endif // NMTOOLS_ARRAY_INDEX_REDUCE_HPP \ No newline at end of file diff --git a/include/nmtools/array/view/decorator.hpp b/include/nmtools/array/view/decorator.hpp index d77f48a00..8ba0df6c2 100644 --- a/include/nmtools/array/view/decorator.hpp +++ b/include/nmtools/array/view/decorator.hpp @@ -344,6 +344,7 @@ namespace nmtools::view * - has index member function that transform indices */ + // TODO: remove #ifdef NMTOOLS_NO_BASE_ACCESS view_type view; decorator_t(const view_type& view) @@ -351,8 +352,10 @@ namespace nmtools::view {} #endif + #if 0 nmtools_func_attribute ~decorator_t() = default; + #endif /** * @brief return the shape of this array diff --git a/include/nmtools/array/view/indexing.hpp b/include/nmtools/array/view/indexing.hpp index 593b56a30..9f62f4a7b 100644 --- a/include/nmtools/array/view/indexing.hpp +++ b/include/nmtools/array/view/indexing.hpp @@ -122,6 +122,11 @@ namespace nmtools::view , indexer(indexer) {} + #if 0 + nmtools_func_attribute + ~indexing_t() = default; + #endif + constexpr auto operands() const noexcept { return nmtools_tuple{array}; diff --git a/include/nmtools/array/view/slice.hpp b/include/nmtools/array/view/slice.hpp index 240fb364d..6d7df418e 100644 --- a/include/nmtools/array/view/slice.hpp +++ b/include/nmtools/array/view/slice.hpp @@ -73,11 +73,10 @@ namespace nmtools::view if constexpr (meta::is_maybe_v) { using result_t = decltype(slice_t{unwrap(src_shape),unwrap(slices),unwrap(src_size)}); using return_t = nmtools_maybe; - if (static_cast(m_dst_shape)) { - return return_t{result_t{unwrap(src_shape),unwrap(slices),unwrap(src_size)}}; - } else { - return return_t{meta::Nothing}; - } + return (has_value(m_dst_shape) + ? return_t{result_t{unwrap(src_shape),unwrap(slices),unwrap(src_size)}} + : return_t{meta::Nothing} + ); } else { return slice_t{unwrap(src_shape),unwrap(slices),unwrap(src_size)}; } diff --git a/include/nmtools/array/view/ufunc/reduce.hpp b/include/nmtools/array/view/ufunc/reduce.hpp index 50db872e2..b3b6fa92e 100644 --- a/include/nmtools/array/view/ufunc/reduce.hpp +++ b/include/nmtools/array/view/ufunc/reduce.hpp @@ -22,129 +22,7 @@ #include "nmtools/array/view/ufunc/detail.hpp" #include "nmtools/utils/isequal.hpp" - -namespace nmtools::view::detail -{ - // TODO: move to index namespace - template - constexpr auto make_reduction_slices(const indices_t& indices_, const array_type& array, const axis_type& axis, keepdims_type keepdims) - { - // for now, assume axis is int and array is fixed_dim - // TODO: support reduce on dynamic dim array - using array_t = meta::remove_cvref_pointer_t; - using axis_t = meta::remove_cvref_pointer_t; - constexpr auto DIM = meta::fixed_dim_v; - [[maybe_unused]] const auto dim = detail::dim(array); - // type for slicing is DIMx2 where 2 represent start and stop - using size_type = nm_size_t; - constexpr auto slices_vtype = [=](){ - using slice_type = nmtools_array; - if constexpr (meta::is_fixed_dim_ndarray_v) { - using slices_type = nmtools_array; - return meta::as_value_v; - } else { - using slices_type = nmtools_list; - return meta::as_value_v; - } - }(); - using slices_type = meta::type_t; - auto slices = slices_type {}; - auto shape_ = detail::shape(array); - if constexpr (meta::is_resizable_v) { - slices.resize(dim); - } - - // helper lambda to check if axis i is in the specified axis for reduction - auto in_axis = [&](auto i){ - if constexpr (meta::is_index_v && meta::is_pointer_v) { - return i==*axis; - } else if constexpr (meta::is_index_v) { - using common_t = meta::promote_index_t; - return (common_t)i==(common_t)axis; - } else { - auto f_predicate = [i](auto axis){ - using common_t = meta::promote_index_t; - return (common_t)i==(common_t)axis; - }; - // axis is index array (reducing on multiple axes), - // axis may be pointer, but can't provide convenience function - // since may decay bounded array to pointer - if constexpr (meta::is_pointer_v) { - auto found = index::where(f_predicate, *axis); - return static_cast(len(found)); - } else { - auto found = index::where(f_predicate, axis); - return static_cast(len(found)); - } - } - }; - - // use the same type as axis_t for loop index - constexpr auto idx_vtype = [](){ - if constexpr (meta::is_constant_index_array_v) { - // shortcut for now, just use int - return meta::as_value_v; - } else if constexpr (meta::is_index_array_v) { - using type = meta::get_element_type_t; - return meta::as_value_v; - } else if constexpr (meta::is_integer_v) { - return meta::as_value_v; - } else { - return meta::as_value_v; - } - }(); - using index_t = meta::get_index_type_t; - using idx_t [[maybe_unused]] = meta::type_t>>; - - // indices and the referenced array may have different dim, - // this variable track index for indices_ - auto ii = idx_t{0}; - if constexpr (meta::is_fixed_dim_ndarray_v) { - // here, len(slices) already matched the dimension of source array - meta::template_for([&](auto index){ - constexpr auto i = decltype(index)::value; - // take all elements at given axis - if (in_axis(i)) { - // note that shape_ maybe constant index array - at(slices,i) = { - static_cast(0) - , static_cast(at(shape_,meta::ct_v))}; - // if keepdims is true, also increment indices index - if (keepdims) - ii++; - } - // use indices otherwise, just slice with index:index+1 - else { - auto s = at(indices_,ii++); - at(slices,i) = { - static_cast(s) - , static_cast(s+1)}; - } - }); - } else { - for (size_t i=0; i(0) - , static_cast(at(shape_,i))}; - // if keepdims is true, also increment indices index - if (keepdims) - ii++; - } - // use indices otherwise, just slice with index:index+1 - else { - auto s = at(indices_,ii++); - at(slices,i) = { - static_cast(s) - , static_cast(s+1)}; - } - } - } - return slices; - } // make_reduction_slices -} // namespace nmtools::view::detail +#include "nmtools/array/index/reduce.hpp" namespace nmtools::args { @@ -399,7 +277,7 @@ namespace nmtools::view // apply slice only works with fixed dim ndarray for now // TODO: support dynamic dim ndarray auto sliced = [&](){ - auto slices = detail::make_reduction_slices(indices_,array,axis,keepdims); + auto slices = index::reduction_slices(indices_,unwrap(detail::shape(array)),axis,keepdims); // this slice operates directly with the underlying array // which may be pointer if constexpr (meta::is_pointer_v) { diff --git a/include/nmtools/assert.hpp b/include/nmtools/assert.hpp index b66fffc30..706abc643 100644 --- a/include/nmtools/assert.hpp +++ b/include/nmtools/assert.hpp @@ -7,6 +7,8 @@ #include "nmtools/platform/assert/arduino.hpp" #elif defined(__CUDA__) #include "nmtools/platform/assert/cuda.hpp" +#elif defined(__HIP__) +#include "nmtools/platform/assert/hip.hpp" #elif defined(__OPENCL_VERSION__) #include "nmtools/platform/assert/opencl.hpp" #else diff --git a/include/nmtools/platform/assert/hip.hpp b/include/nmtools/platform/assert/hip.hpp new file mode 100644 index 000000000..ae0442333 --- /dev/null +++ b/include/nmtools/platform/assert/hip.hpp @@ -0,0 +1,28 @@ +#ifndef NMTOOLS_PLATFORM_ASSERT_HIP +#define NMTOOLS_PLATFORM_ASSERT_HIP + +#define nmtools_assert_optional(condition, message, return_type, ...) \ + if (!(condition)) return return_type{nmtools::meta::Nothing}; + +#define nmtools_make_optional(name, type) \ +using name [[maybe_unused]] = nmtools_maybe; + +#define nmtools_cassert(condition, ...) {} + +#ifdef NMTOOLS_USE_OPTIONAL +#undef nmtools_assert +#define nmtools_assert nmtools_assert_optional +#endif // NMTOOLS_USE_OPTIONAL + +#ifndef nmtools_assert +#define nmtools_assert nmtools_cassert +#endif // nmtools_assert + +#ifdef NMTOOLS_USE_OPTIONAL +#define nmtools_assert_prepare_type nmtools_make_optional +#else +#define nmtools_assert_prepare_type(name, type) \ +using name = type; +#endif // NMTOOLS_USE_OPTIONAL + +#endif // NMTOOLS_PLATFORM_ASSERT_HIP \ No newline at end of file diff --git a/include/nmtools/testing/data/array/add.hpp b/include/nmtools/testing/data/array/add.hpp index 23b65fa94..f42333169 100644 --- a/include/nmtools/testing/data/array/add.hpp +++ b/include/nmtools/testing/data/array/add.hpp @@ -259,6 +259,8 @@ NMTOOLS_TESTING_DECLARE_CASE(array, constexpr_reduce_add) NMTOOLS_TESTING_DECLARE_CASE(view, reduce_add) { + using namespace literals; + NMTOOLS_TESTING_DECLARE_ARGS(case1) { inline int8_t a[2][3][2] = { @@ -274,6 +276,7 @@ NMTOOLS_TESTING_DECLARE_CASE(view, reduce_add) } }; inline int8_t axis = 0; + inline auto axis_ct = 0_ct; NMTOOLS_CAST_ARRAYS(a) } NMTOOLS_TESTING_DECLARE_EXPECT(case1) diff --git a/tests/cuda/array/matmul.cpp b/tests/cuda/array/matmul.cpp index 2559ce5fa..c3057e6b7 100644 --- a/tests/cuda/array/matmul.cpp +++ b/tests/cuda/array/matmul.cpp @@ -35,7 +35,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("array::matmul")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto M = 4; auto N = 4; @@ -48,7 +48,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto M = 2; auto N = 2; @@ -61,7 +61,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto M = 4; auto N = 4; @@ -74,7 +74,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto M = 4; auto N = 4; @@ -87,7 +87,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto M = 4; auto N = 4; @@ -100,7 +100,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -113,7 +113,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -126,7 +126,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -139,7 +139,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -152,7 +152,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -165,7 +165,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -178,7 +178,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -191,7 +191,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 16; @@ -204,7 +204,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 19; @@ -217,7 +217,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 19; @@ -230,7 +230,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 19; @@ -243,7 +243,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 19; @@ -256,7 +256,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto M = 1; auto N = 19; @@ -269,7 +269,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto M = 16; auto N = 1; @@ -284,7 +284,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) //////////////////////////////////////////////////////////////////////////// -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 4; @@ -298,7 +298,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 4; @@ -312,7 +312,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 2; @@ -326,7 +326,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 4; @@ -340,7 +340,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 4; @@ -354,7 +354,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 4; @@ -368,7 +368,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -382,7 +382,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -396,7 +396,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -410,7 +410,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -424,7 +424,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -438,7 +438,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -452,7 +452,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -466,7 +466,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -480,7 +480,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -494,7 +494,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -508,7 +508,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -522,7 +522,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -536,7 +536,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 1; @@ -550,7 +550,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::float64; auto M = 16; @@ -568,7 +568,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 4; @@ -582,7 +582,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 4; @@ -596,7 +596,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 2; @@ -610,7 +610,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 4; @@ -624,7 +624,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 4; @@ -638,7 +638,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 4; @@ -652,7 +652,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -666,7 +666,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -680,7 +680,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -694,7 +694,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -708,7 +708,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -722,7 +722,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -736,7 +736,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -750,7 +750,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -764,7 +764,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -778,7 +778,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -792,7 +792,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -806,7 +806,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -820,7 +820,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 1; @@ -834,7 +834,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int32; auto M = 16; @@ -854,7 +854,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 4; @@ -868,7 +868,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 4; @@ -882,7 +882,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 2; @@ -896,7 +896,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 4; @@ -910,7 +910,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 4; @@ -924,7 +924,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 4; @@ -938,7 +938,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -952,7 +952,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -966,7 +966,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -980,7 +980,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -994,7 +994,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1008,7 +1008,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1022,7 +1022,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1036,7 +1036,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1050,7 +1050,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1064,7 +1064,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1078,7 +1078,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1092,7 +1092,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1106,7 +1106,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 1; @@ -1120,7 +1120,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int64; auto M = 16; @@ -1140,7 +1140,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 4; @@ -1154,7 +1154,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 4; @@ -1168,7 +1168,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 2; @@ -1182,7 +1182,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 4; @@ -1196,7 +1196,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 4; @@ -1210,7 +1210,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 4; @@ -1224,7 +1224,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1238,7 +1238,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1252,7 +1252,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1266,7 +1266,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1280,7 +1280,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1294,7 +1294,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1308,7 +1308,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1322,7 +1322,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1336,7 +1336,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1350,7 +1350,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1364,7 +1364,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1378,7 +1378,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1392,7 +1392,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 1; @@ -1406,7 +1406,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int16; auto M = 16; @@ -1424,7 +1424,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 4; @@ -1438,7 +1438,7 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 4; @@ -1452,7 +1452,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 2; @@ -1466,7 +1466,7 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 4; @@ -1480,7 +1480,7 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 4; @@ -1494,7 +1494,7 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 4; @@ -1508,7 +1508,7 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1522,7 +1522,7 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1536,7 +1536,7 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1550,7 +1550,7 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1564,7 +1564,7 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1578,7 +1578,7 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1592,7 +1592,7 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1606,7 +1606,7 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1620,7 +1620,7 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1634,7 +1634,7 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1648,7 +1648,7 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1662,7 +1662,7 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; @@ -1676,7 +1676,7 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 1; @@ -1690,7 +1690,7 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::cuda")) { auto dtype = nm::int8; auto M = 16; diff --git a/tests/hip/CMakeLists.txt b/tests/hip/CMakeLists.txt index 9a0c6bd0f..614bb83d5 100644 --- a/tests/hip/CMakeLists.txt +++ b/tests/hip/CMakeLists.txt @@ -79,10 +79,8 @@ set(NMTOOLS_HIP_TEST_SOURCES ${NMTOOLS_HIP_TEST_SOURCES} array/ufuncs/add.cpp array/ufuncs/multiply.cpp - # TODO: fix compile - # array/reductions/add.cpp - # TODO: fix compile - # array/reductions/multiply.cpp + array/reductions/add.cpp + array/reductions/multiply.cpp array/outer/add.cpp array/outer/multiply.cpp @@ -90,65 +88,42 @@ set(NMTOOLS_HIP_TEST_SOURCES ${NMTOOLS_HIP_TEST_SOURCES} array/accumulations/add.cpp array/accumulations/multiply.cpp - # TODO: fix runtime - # array/broadcast_to.cpp - # TODO: fix compile - # array/atleast_1d.cpp - # TODO: fix compile - # array/atleast_2d.cpp - # TODO: fix compile - # array/atleast_3d.cpp - # TODO: fix compile - # array/concatenate.cpp - # TODO: fix compile - # array/expand_dims.cpp - # TODO: fix compile - # array/flatten.cpp - # TODO: fix compile - # array/flip.cpp - # TODO: fix compile - # array/hstack.cpp - # TODO: fix runtime - # array/pad.cpp + array/broadcast_to.cpp + array/atleast_1d.cpp + array/atleast_2d.cpp + array/atleast_3d.cpp + array/concatenate.cpp + array/expand_dims.cpp + array/flatten.cpp + array/flip.cpp + array/hstack.cpp + array/pad.cpp # TODO: fix compile # array/pooling.cpp - # TODO: fix compile - # array/repeat.cpp - # TODO: fix runtime - # array/reshape.cpp - # array/resize.cpp - # TODO: fix compile - # array/slice.cpp - # TODO: fix compile - # array/squeeze.cpp - # TODO: fix compile - # array/tile.cpp - # TODO: fix compile - # array/transpose.cpp - # TODO: fix compile - # array/where.cpp - # TODO: fix compile - # array/moveaxis.cpp + array/repeat.cpp + array/reshape.cpp + array/resize.cpp + array/slice.cpp + array/squeeze.cpp + array/tile.cpp + array/transpose.cpp + array/where.cpp + array/moveaxis.cpp array/arange.cpp array/zeros.cpp array/ones.cpp array/full.cpp - # TODO: fix compile - # array/vstack.cpp + array/vstack.cpp - # TODO: fix compile - # array/sum.cpp + array/sum.cpp array/cumsum.cpp array/matmul.cpp - # TODO: fix compile - # array/prod.cpp + array/prod.cpp array/cumprod.cpp - # TODO: fix compile - # array/mean.cpp + array/mean.cpp composition/add_tanh.cpp - # composition/mean_subtract.cpp - # composition/reduce_add_divide.cpp + composition/reduce_add_divide.cpp ) ## TODO: support nvcc compilation diff --git a/tests/hip/array/arange.cpp b/tests/hip/array/arange.cpp index 8c1b52fae..a29f7097d 100644 --- a/tests/hip/array/arange.cpp +++ b/tests/hip/array/arange.cpp @@ -6,7 +6,7 @@ namespace nm = nmtools; namespace na = nm::array; -#define CUDA_ARANGE_SUBCASE(...) \ +#define HIP_ARANGE_SUBCASE(...) \ { \ auto expect = na::arange(__VA_ARGS__); \ auto result = na::arange(__VA_ARGS__, na::hip::default_context()); \ @@ -19,7 +19,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, arange, case_name); \ using namespace args; \ - CUDA_ARANGE_SUBCASE(__VA_ARGS__); \ + HIP_ARANGE_SUBCASE(__VA_ARGS__); \ } TEST_CASE("arange(case1)" * doctest::test_suite("array::arange")) @@ -28,7 +28,7 @@ TEST_CASE("arange(case1)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::float32; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case2)" * doctest::test_suite("array::arange")) @@ -37,7 +37,7 @@ TEST_CASE("arange(case2)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::float64; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case3)" * doctest::test_suite("array::arange")) @@ -46,7 +46,7 @@ TEST_CASE("arange(case3)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::int8; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case4)" * doctest::test_suite("array::arange")) @@ -55,7 +55,7 @@ TEST_CASE("arange(case4)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::int16; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case5)" * doctest::test_suite("array::arange")) @@ -64,7 +64,7 @@ TEST_CASE("arange(case5)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::int32; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case6)" * doctest::test_suite("array::arange")) @@ -73,7 +73,7 @@ TEST_CASE("arange(case6)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::int64; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case7)" * doctest::test_suite("array::arange")) @@ -82,7 +82,7 @@ TEST_CASE("arange(case7)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::uint8; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case8)" * doctest::test_suite("array::arange")) @@ -91,7 +91,7 @@ TEST_CASE("arange(case8)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::uint16; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case9)" * doctest::test_suite("array::arange")) @@ -100,7 +100,7 @@ TEST_CASE("arange(case9)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::uint32; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case10)" * doctest::test_suite("array::arange")) @@ -109,7 +109,7 @@ TEST_CASE("arange(case10)" * doctest::test_suite("array::arange")) auto stop = 128; auto step = 1; auto dtype = nm::uint64; - CUDA_ARANGE_SUBCASE(start,stop,step,dtype); + HIP_ARANGE_SUBCASE(start,stop,step,dtype); } TEST_CASE("arange(case3a)" * doctest::test_suite("array::arange")) diff --git a/tests/hip/array/cumprod.cpp b/tests/hip/array/cumprod.cpp index cc526d8df..6070f87f8 100644 --- a/tests/hip/array/cumprod.cpp +++ b/tests/hip/array/cumprod.cpp @@ -8,7 +8,7 @@ namespace nm = nmtools; namespace na = nm::array; namespace ix = nm::index; -#define CUDA_CUMPROD_SUBCASE(...) \ +#define HIP_CUMPROD_SUBCASE(...) \ { \ auto expect = na::cumprod(__VA_ARGS__); \ auto result = na::cumprod(__VA_ARGS__, na::hip::default_context()); \ @@ -21,7 +21,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, cumprod, case_name); \ using namespace args; \ - CUDA_CUMPROD_SUBCASE(__VA_ARGS__); \ + HIP_CUMPROD_SUBCASE(__VA_ARGS__); \ } TEST_CASE("cumprod(case1)" * doctest::test_suite("array::cumprod")) @@ -37,7 +37,7 @@ TEST_CASE("cumprod(case1)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -55,11 +55,11 @@ TEST_CASE("cumprod(case2)" * doctest::test_suite("array::cumprod") * doctest::ma auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -76,15 +76,15 @@ TEST_CASE("cumprod(case3)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -101,23 +101,23 @@ TEST_CASE("cumprod(case4)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -134,7 +134,7 @@ TEST_CASE("cumprod(case5)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -151,11 +151,11 @@ TEST_CASE("cumprod(case6)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -172,15 +172,15 @@ TEST_CASE("cumprod(case7)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -197,23 +197,23 @@ TEST_CASE("cumprod(case8)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -230,7 +230,7 @@ TEST_CASE("cumprod(case9)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -247,11 +247,11 @@ TEST_CASE("cumprod(case10)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -268,15 +268,15 @@ TEST_CASE("cumprod(case11)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -293,23 +293,23 @@ TEST_CASE("cumprod(case12)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -326,7 +326,7 @@ TEST_CASE("cumprod(case13)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -343,11 +343,11 @@ TEST_CASE("cumprod(case14)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -364,15 +364,15 @@ TEST_CASE("cumprod(case15)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -389,23 +389,23 @@ TEST_CASE("cumprod(case16)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -422,7 +422,7 @@ TEST_CASE("cumprod(case17)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -439,11 +439,11 @@ TEST_CASE("cumprod(case18)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -460,15 +460,15 @@ TEST_CASE("cumprod(case19)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } @@ -485,22 +485,22 @@ TEST_CASE("cumprod(case20)" * doctest::test_suite("array::cumprod")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMPROD_SUBCASE(input,axis,dtype); + HIP_CUMPROD_SUBCASE(input,axis,dtype); } } \ No newline at end of file diff --git a/tests/hip/array/cumsum.cpp b/tests/hip/array/cumsum.cpp index 93f602eb2..df7d0838f 100644 --- a/tests/hip/array/cumsum.cpp +++ b/tests/hip/array/cumsum.cpp @@ -8,7 +8,7 @@ namespace nm = nmtools; namespace na = nm::array; namespace ix = nm::index; -#define CUDA_CUMSUM_SUBCASE(...) \ +#define HIP_CUMSUM_SUBCASE(...) \ { \ auto expect = na::cumsum(__VA_ARGS__); \ auto result = na::cumsum(__VA_ARGS__, na::hip::default_context()); \ @@ -21,7 +21,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, cumsum, case_name); \ using namespace args; \ - CUDA_CUMSUM_SUBCASE(__VA_ARGS__); \ + HIP_CUMSUM_SUBCASE(__VA_ARGS__); \ } TEST_CASE("cumsum(case1)" * doctest::test_suite("array::cumsum")) @@ -37,7 +37,7 @@ TEST_CASE("cumsum(case1)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -54,11 +54,11 @@ TEST_CASE("cumsum(case2)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -75,15 +75,15 @@ TEST_CASE("cumsum(case3)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -100,23 +100,23 @@ TEST_CASE("cumsum(case4)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -133,7 +133,7 @@ TEST_CASE("cumsum(case5)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -150,11 +150,11 @@ TEST_CASE("cumsum(case6)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -171,15 +171,15 @@ TEST_CASE("cumsum(case7)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -196,23 +196,23 @@ TEST_CASE("cumsum(case8)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -229,7 +229,7 @@ TEST_CASE("cumsum(case9)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -246,11 +246,11 @@ TEST_CASE("cumsum(case10)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -267,15 +267,15 @@ TEST_CASE("cumsum(case11)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -292,23 +292,23 @@ TEST_CASE("cumsum(case12)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -325,7 +325,7 @@ TEST_CASE("cumsum(case13)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -342,11 +342,11 @@ TEST_CASE("cumsum(case14)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -363,15 +363,15 @@ TEST_CASE("cumsum(case15)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -388,23 +388,23 @@ TEST_CASE("cumsum(case16)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -421,7 +421,7 @@ TEST_CASE("cumsum(case17)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -438,11 +438,11 @@ TEST_CASE("cumsum(case18)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -459,15 +459,15 @@ TEST_CASE("cumsum(case19)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } @@ -484,22 +484,22 @@ TEST_CASE("cumsum(case20)" * doctest::test_suite("array::cumsum")) auto dtype = nm::None; { auto axis = 0; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 1; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 2; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 3; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } { auto axis = 4; - CUDA_CUMSUM_SUBCASE(input,axis,dtype); + HIP_CUMSUM_SUBCASE(input,axis,dtype); } } \ No newline at end of file diff --git a/tests/hip/array/flip.cpp b/tests/hip/array/flip.cpp index daf3b945a..8767e52c5 100644 --- a/tests/hip/array/flip.cpp +++ b/tests/hip/array/flip.cpp @@ -74,6 +74,8 @@ TEST_CASE("flip(case1)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case1, array_fs_hb, axis); FLIP_SUBCASE(case1, array_fs_db, axis); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIP_SUBCASE(case1, array_hs_fb, axis); FLIP_SUBCASE(case1, array_hs_hb, axis); FLIP_SUBCASE(case1, array_hs_db, axis); @@ -81,6 +83,7 @@ TEST_CASE("flip(case1)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case1, array_ds_fb, axis); FLIP_SUBCASE(case1, array_ds_hb, axis); FLIP_SUBCASE(case1, array_ds_db, axis); + #endif FLIP_SUBCASE(case1, array_ls_fb, axis); FLIP_SUBCASE(case1, array_ls_hb, axis); @@ -103,6 +106,8 @@ TEST_CASE("flip(case2)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case2, array_fs_hb, axis); FLIP_SUBCASE(case2, array_fs_db, axis); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIP_SUBCASE(case2, array_hs_fb, axis); FLIP_SUBCASE(case2, array_hs_hb, axis); FLIP_SUBCASE(case2, array_hs_db, axis); @@ -110,6 +115,7 @@ TEST_CASE("flip(case2)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case2, array_ds_fb, axis); FLIP_SUBCASE(case2, array_ds_hb, axis); FLIP_SUBCASE(case2, array_ds_db, axis); + #endif FLIP_SUBCASE(case2, array_ls_fb, axis); FLIP_SUBCASE(case2, array_ls_hb, axis); @@ -132,6 +138,8 @@ TEST_CASE("flip(case3)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case3, array_fs_hb, axis); FLIP_SUBCASE(case3, array_fs_db, axis); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIP_SUBCASE(case3, array_hs_fb, axis); FLIP_SUBCASE(case3, array_hs_hb, axis); FLIP_SUBCASE(case3, array_hs_db, axis); @@ -139,6 +147,7 @@ TEST_CASE("flip(case3)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case3, array_ds_fb, axis); FLIP_SUBCASE(case3, array_ds_hb, axis); FLIP_SUBCASE(case3, array_ds_db, axis); + #endif FLIP_SUBCASE(case3, array_ls_fb, axis); FLIP_SUBCASE(case3, array_ls_hb, axis); @@ -161,6 +170,8 @@ TEST_CASE("flip(case4)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case4, array_fs_hb, axis_a); FLIP_SUBCASE(case4, array_fs_db, axis_a); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIP_SUBCASE(case4, array_hs_fb, axis_a); FLIP_SUBCASE(case4, array_hs_hb, axis_a); FLIP_SUBCASE(case4, array_hs_db, axis_a); @@ -168,6 +179,7 @@ TEST_CASE("flip(case4)" * doctest::test_suite("array::flip")) FLIP_SUBCASE(case4, array_ds_fb, axis_a); FLIP_SUBCASE(case4, array_ds_hb, axis_a); FLIP_SUBCASE(case4, array_ds_db, axis_a); + #endif // FLIP_SUBCASE(case4, array_ls_fb, axis_a); // FLIP_SUBCASE(case4, array_ls_hb, axis_a); @@ -190,6 +202,8 @@ TEST_CASE("fliplr(case1)" * doctest::test_suite("array::fliplr") ) FLIPLR_SUBCASE(case1, array_fs_hb ); FLIPLR_SUBCASE(case1, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPLR_SUBCASE(case1, array_hs_fb ); FLIPLR_SUBCASE(case1, array_hs_hb ); FLIPLR_SUBCASE(case1, array_hs_db ); @@ -197,6 +211,7 @@ TEST_CASE("fliplr(case1)" * doctest::test_suite("array::fliplr") ) FLIPLR_SUBCASE(case1, array_ds_fb ); FLIPLR_SUBCASE(case1, array_ds_hb ); FLIPLR_SUBCASE(case1, array_ds_db ); + #endif FLIPLR_SUBCASE(case1, array_ls_fb ); FLIPLR_SUBCASE(case1, array_ls_hb ); @@ -219,6 +234,8 @@ TEST_CASE("fliplr(case2)" * doctest::test_suite("array::fliplr")) FLIPLR_SUBCASE(case2, array_fs_hb ); FLIPLR_SUBCASE(case2, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPLR_SUBCASE(case2, array_hs_fb ); FLIPLR_SUBCASE(case2, array_hs_hb ); FLIPLR_SUBCASE(case2, array_hs_db ); @@ -226,6 +243,7 @@ TEST_CASE("fliplr(case2)" * doctest::test_suite("array::fliplr")) FLIPLR_SUBCASE(case2, array_ds_fb ); FLIPLR_SUBCASE(case2, array_ds_hb ); FLIPLR_SUBCASE(case2, array_ds_db ); + #endif FLIPLR_SUBCASE(case2, array_ls_fb ); FLIPLR_SUBCASE(case2, array_ls_hb ); @@ -248,6 +266,8 @@ TEST_CASE("fliplr(case3)" * doctest::test_suite("array::fliplr")) FLIPLR_SUBCASE(case3, array_fs_hb ); FLIPLR_SUBCASE(case3, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPLR_SUBCASE(case3, array_hs_fb ); FLIPLR_SUBCASE(case3, array_hs_hb ); FLIPLR_SUBCASE(case3, array_hs_db ); @@ -255,6 +275,7 @@ TEST_CASE("fliplr(case3)" * doctest::test_suite("array::fliplr")) FLIPLR_SUBCASE(case3, array_ds_fb ); FLIPLR_SUBCASE(case3, array_ds_hb ); FLIPLR_SUBCASE(case3, array_ds_db ); + #endif FLIPLR_SUBCASE(case3, array_ls_fb ); FLIPLR_SUBCASE(case3, array_ls_hb ); @@ -277,6 +298,8 @@ TEST_CASE("flipud(case1)" * doctest::test_suite("array::flipud") ) FLIPUD_SUBCASE(case1, array_fs_hb ); FLIPUD_SUBCASE(case1, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPUD_SUBCASE(case1, array_hs_fb ); FLIPUD_SUBCASE(case1, array_hs_hb ); FLIPUD_SUBCASE(case1, array_hs_db ); @@ -284,6 +307,7 @@ TEST_CASE("flipud(case1)" * doctest::test_suite("array::flipud") ) FLIPUD_SUBCASE(case1, array_ds_fb ); FLIPUD_SUBCASE(case1, array_ds_hb ); FLIPUD_SUBCASE(case1, array_ds_db ); + #endif FLIPUD_SUBCASE(case1, array_ls_fb ); FLIPUD_SUBCASE(case1, array_ls_hb ); @@ -306,6 +330,8 @@ TEST_CASE("flipud(case2)" * doctest::test_suite("array::flipud")) FLIPUD_SUBCASE(case2, array_fs_hb ); FLIPUD_SUBCASE(case2, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPUD_SUBCASE(case2, array_hs_fb ); FLIPUD_SUBCASE(case2, array_hs_hb ); FLIPUD_SUBCASE(case2, array_hs_db ); @@ -313,6 +339,7 @@ TEST_CASE("flipud(case2)" * doctest::test_suite("array::flipud")) FLIPUD_SUBCASE(case2, array_ds_fb ); FLIPUD_SUBCASE(case2, array_ds_hb ); FLIPUD_SUBCASE(case2, array_ds_db ); + #endif FLIPUD_SUBCASE(case2, array_ls_fb ); FLIPUD_SUBCASE(case2, array_ls_hb ); @@ -335,6 +362,8 @@ TEST_CASE("flipud(case3)" * doctest::test_suite("array::flipud")) FLIPUD_SUBCASE(case3, array_fs_hb ); FLIPUD_SUBCASE(case3, array_fs_db ); + // TODO: fix, probably as_static doesn't work properly for flip args + #if 0 FLIPUD_SUBCASE(case3, array_hs_fb ); FLIPUD_SUBCASE(case3, array_hs_hb ); FLIPUD_SUBCASE(case3, array_hs_db ); @@ -342,6 +371,7 @@ TEST_CASE("flipud(case3)" * doctest::test_suite("array::flipud")) FLIPUD_SUBCASE(case3, array_ds_fb ); FLIPUD_SUBCASE(case3, array_ds_hb ); FLIPUD_SUBCASE(case3, array_ds_db ); + #endif FLIPUD_SUBCASE(case3, array_ls_fb ); FLIPUD_SUBCASE(case3, array_ls_hb ); diff --git a/tests/hip/array/full.cpp b/tests/hip/array/full.cpp index fad9dd25c..23f6b015c 100644 --- a/tests/hip/array/full.cpp +++ b/tests/hip/array/full.cpp @@ -6,7 +6,7 @@ namespace nm = nmtools; namespace na = nm::array; -#define CUDA_FULL_SUBCASE(...) \ +#define HIP_FULL_SUBCASE(...) \ { \ auto expect = na::full(__VA_ARGS__); \ auto result = na::full(__VA_ARGS__, na::hip::default_context()); \ @@ -19,185 +19,185 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, full, case_name); \ using namespace args; \ - CUDA_FULL_SUBCASE(__VA_ARGS__); \ + HIP_FULL_SUBCASE(__VA_ARGS__); \ } TEST_CASE("full(case1)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{128}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case2)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{1,128}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case3)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{64,2}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case4)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{16,4,2}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case5)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{8,2,4,2}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case6)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{2,4,1,2,4,2}; - CUDA_FULL_SUBCASE(shape,3.f); + HIP_FULL_SUBCASE(shape,3.f); } TEST_CASE("full(case7)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{128}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case8)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{1,128}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case9)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{64,2}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case10)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{16,4,2}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case11)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{8,2,4,2}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case12)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{2,4,1,2,4,2}; - CUDA_FULL_SUBCASE(shape,3.); + HIP_FULL_SUBCASE(shape,3.); } TEST_CASE("full(case13)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{128}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case14)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{1,128}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case15)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{64,2}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case16)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{16,4,2}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case17)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{8,2,4,2}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case18)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{2,4,1,2,4,2}; - CUDA_FULL_SUBCASE(shape,3ul); + HIP_FULL_SUBCASE(shape,3ul); } TEST_CASE("full(case19)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{128}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case20)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{1,128}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case21)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{64,2}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case22)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{16,4,2}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case23)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{8,2,4,2}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case24)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{2,4,1,2,4,2}; - CUDA_FULL_SUBCASE(shape,3l); + HIP_FULL_SUBCASE(shape,3l); } TEST_CASE("full(case25)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{128}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } TEST_CASE("full(case26)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{1,128}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } TEST_CASE("full(case27)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{64,2}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } TEST_CASE("full(case28)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{16,4,2}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } TEST_CASE("full(case29)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{8,2,4,2}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } TEST_CASE("full(case30)" * doctest::test_suite("array::full")) { auto shape = nmtools_array{2,4,1,2,4,2}; - CUDA_FULL_SUBCASE(shape,(uint8_t)3); + HIP_FULL_SUBCASE(shape,(uint8_t)3); } \ No newline at end of file diff --git a/tests/hip/array/matmul.cpp b/tests/hip/array/matmul.cpp index acc132640..d88c6a408 100644 --- a/tests/hip/array/matmul.cpp +++ b/tests/hip/array/matmul.cpp @@ -14,7 +14,7 @@ namespace meta = nm::meta; // TODO: fix to accept maybe type using nmtools::unwrap; -#define CUDA_TEST(fn,...) \ +#define HIP_TEST(fn,...) \ { \ auto expect = na::fn(__VA_ARGS__); \ auto result = na::fn(__VA_ARGS__,na::hip::default_context()); \ @@ -32,10 +32,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("array::matmul")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto M = 4; auto N = 4; @@ -45,10 +45,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto M = 2; auto N = 2; @@ -58,10 +58,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto M = 4; auto N = 4; @@ -71,10 +71,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto M = 4; auto N = 4; @@ -84,10 +84,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto M = 4; auto N = 4; @@ -97,10 +97,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -110,10 +110,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -123,10 +123,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -136,10 +136,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -149,10 +149,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -162,10 +162,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -175,10 +175,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -188,10 +188,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 16; @@ -201,10 +201,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 19; @@ -214,10 +214,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 19; @@ -227,10 +227,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 19; @@ -240,10 +240,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 19; @@ -253,10 +253,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto M = 1; auto N = 19; @@ -266,10 +266,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto M = 16; auto N = 1; @@ -279,12 +279,12 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K),lhs_shape); auto rhs = na::reshape(na::arange(K*N),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } //////////////////////////////////////////////////////////////////////////// -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 4; @@ -295,10 +295,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 4; @@ -309,10 +309,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 2; @@ -323,10 +323,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 4; @@ -337,10 +337,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 4; @@ -351,10 +351,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 4; @@ -365,10 +365,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -379,10 +379,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -393,10 +393,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -407,10 +407,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -421,10 +421,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -435,10 +435,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -449,10 +449,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -463,10 +463,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -477,10 +477,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -491,10 +491,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -505,10 +505,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -519,10 +519,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -533,10 +533,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 1; @@ -547,10 +547,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::float64; auto M = 16; @@ -561,14 +561,14 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } ///////////////////////////////////////////////////////////////////////// #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 4; @@ -579,10 +579,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 4; @@ -593,10 +593,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 2; @@ -607,10 +607,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 4; @@ -621,10 +621,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 4; @@ -635,10 +635,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 4; @@ -649,10 +649,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -663,10 +663,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -677,10 +677,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -691,10 +691,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -705,10 +705,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -719,10 +719,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -733,10 +733,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -747,10 +747,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -761,10 +761,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -775,10 +775,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -789,10 +789,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -803,10 +803,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -817,10 +817,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 1; @@ -831,10 +831,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int32; auto M = 16; @@ -845,7 +845,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } #endif @@ -854,7 +854,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 4; @@ -865,10 +865,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 4; @@ -879,10 +879,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 2; @@ -893,10 +893,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 4; @@ -907,10 +907,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 4; @@ -921,10 +921,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 4; @@ -935,10 +935,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -949,10 +949,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -963,10 +963,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -977,10 +977,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -991,10 +991,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1005,10 +1005,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1019,10 +1019,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1033,10 +1033,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1047,10 +1047,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1061,10 +1061,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1075,10 +1075,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1089,10 +1089,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1103,10 +1103,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 1; @@ -1117,10 +1117,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int64; auto M = 16; @@ -1131,7 +1131,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } #endif @@ -1140,7 +1140,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 4; @@ -1151,10 +1151,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 4; @@ -1165,10 +1165,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 2; @@ -1179,10 +1179,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 4; @@ -1193,10 +1193,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 4; @@ -1207,10 +1207,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 4; @@ -1221,10 +1221,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1235,10 +1235,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1249,10 +1249,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1263,10 +1263,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1277,10 +1277,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1291,10 +1291,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1305,10 +1305,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1319,10 +1319,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1333,10 +1333,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1347,10 +1347,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1361,10 +1361,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1375,10 +1375,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1389,10 +1389,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 1; @@ -1403,10 +1403,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int16; auto M = 16; @@ -1417,14 +1417,14 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } #endif #if 1 -TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 4; @@ -1435,10 +1435,10 @@ TEST_CASE("matmul(case1)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 4; @@ -1449,10 +1449,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 2; @@ -1463,10 +1463,10 @@ TEST_CASE("matmul(case1b)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 4; @@ -1477,10 +1477,10 @@ TEST_CASE("matmul(case1c)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 4; @@ -1491,10 +1491,10 @@ TEST_CASE("matmul(case1d)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 4; @@ -1505,10 +1505,10 @@ TEST_CASE("matmul(case1e)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1519,10 +1519,10 @@ TEST_CASE("matmul(case2)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1533,10 +1533,10 @@ TEST_CASE("matmul(case3)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1547,10 +1547,10 @@ TEST_CASE("matmul(case4)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1561,10 +1561,10 @@ TEST_CASE("matmul(case5)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1575,10 +1575,10 @@ TEST_CASE("matmul(case6)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1589,10 +1589,10 @@ TEST_CASE("matmul(case7)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1603,10 +1603,10 @@ TEST_CASE("matmul(case8)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1617,10 +1617,10 @@ TEST_CASE("matmul(case9)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1631,10 +1631,10 @@ TEST_CASE("matmul(case10)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1645,10 +1645,10 @@ TEST_CASE("matmul(case11)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1659,10 +1659,10 @@ TEST_CASE("matmul(case12)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1673,10 +1673,10 @@ TEST_CASE("matmul(case13)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 1; @@ -1687,10 +1687,10 @@ TEST_CASE("matmul(case14)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } -TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) +TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::hip")) { auto dtype = nm::int8; auto M = 16; @@ -1701,7 +1701,7 @@ TEST_CASE("matmul(case15)" * doctest::test_suite("matmul::x86_AVX")) auto lhs = na::reshape(na::arange(M*K,dtype),lhs_shape); auto rhs = na::reshape(na::arange(K*N,dtype),rhs_shape); - CUDA_TEST(matmul,unwrap(lhs),unwrap(rhs)); + HIP_TEST(matmul,unwrap(lhs),unwrap(rhs)); } #endif \ No newline at end of file diff --git a/tests/hip/array/mean.cpp b/tests/hip/array/mean.cpp index cae72a848..0a39446db 100644 --- a/tests/hip/array/mean.cpp +++ b/tests/hip/array/mean.cpp @@ -11,7 +11,7 @@ namespace ix = nm::index; // TODO: fix to accept maybe type using nmtools::unwrap; -#define CUDA_MEAN_SUBCASE(...) \ +#define HIP_MEAN_SUBCASE(...) \ { \ auto expect = na::mean(__VA_ARGS__); \ auto result = na::mean(__VA_ARGS__, na::hip::default_context()); \ @@ -24,7 +24,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, mean, case_name); \ using namespace args; \ - CUDA_MEAN_SUBCASE(__VA_ARGS__); \ + HIP_MEAN_SUBCASE(__VA_ARGS__); \ } TEST_CASE("mean(case1)" * doctest::test_suite("array::mean")) @@ -41,7 +41,7 @@ TEST_CASE("mean(case1)" * doctest::test_suite("array::mean")) auto keepdims = nm::True; { auto axis = 0; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } } @@ -59,11 +59,11 @@ TEST_CASE("mean(case2)" * doctest::test_suite("array::mean")) auto keepdims = nm::True; { auto axis = 0; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 1; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } } @@ -81,15 +81,15 @@ TEST_CASE("mean(case3)" * doctest::test_suite("array::mean")) auto keepdims = nm::True; { auto axis = 0; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 1; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 2; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } } @@ -107,19 +107,19 @@ TEST_CASE("mean(case4)" * doctest::test_suite("array::mean")) auto keepdims = nm::True; { auto axis = 0; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 1; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 2; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 3; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } } @@ -137,22 +137,22 @@ TEST_CASE("mean(case5)" * doctest::test_suite("array::mean")) auto keepdims = nm::True; { auto axis = 0; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 1; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 2; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 3; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } { auto axis = 4; - CUDA_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); + HIP_MEAN_SUBCASE(unwrap(input),axis,dtype,keepdims); } } \ No newline at end of file diff --git a/tests/hip/array/ones.cpp b/tests/hip/array/ones.cpp index 1cf072ec2..a34989813 100644 --- a/tests/hip/array/ones.cpp +++ b/tests/hip/array/ones.cpp @@ -6,7 +6,7 @@ namespace nm = nmtools; namespace na = nm::array; -#define CUDA_ONES_SUBCASE(...) \ +#define HIP_ONES_SUBCASE(...) \ { \ auto expect = na::ones(__VA_ARGS__); \ auto result = na::ones(__VA_ARGS__, na::hip::default_context()); \ @@ -19,257 +19,257 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, ones, case_name); \ using namespace args; \ - CUDA_ONES_SUBCASE(__VA_ARGS__); \ + HIP_ONES_SUBCASE(__VA_ARGS__); \ } TEST_CASE("ones(case1)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case13)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case14)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case15)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case16)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case17)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case18)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case2)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case3)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case4)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case5)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case6)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::float32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case7)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case8)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case9)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case10)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case11)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case12)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::float64; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case13)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case14)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case15)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case16)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case17)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case18)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int8; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case19)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case20)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case21)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case22)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case23)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case24)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int32; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case25)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{128}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case26)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case27)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case28)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case29)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } TEST_CASE("ones(case30)" * doctest::test_suite("array::ones")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int16; - CUDA_ONES_SUBCASE(shape,dtype); + HIP_ONES_SUBCASE(shape,dtype); } \ No newline at end of file diff --git a/tests/hip/array/prod.cpp b/tests/hip/array/prod.cpp index fc6c60627..93a01cfc5 100644 --- a/tests/hip/array/prod.cpp +++ b/tests/hip/array/prod.cpp @@ -8,7 +8,7 @@ namespace nm = nmtools; namespace na = nm::array; namespace ix = nm::index; -#define CUDA_PROD_SUBCASE(...) \ +#define HIP_PROD_SUBCASE(...) \ { \ auto expect = na::prod(__VA_ARGS__); \ auto result = na::prod(__VA_ARGS__, na::hip::default_context()); \ @@ -21,7 +21,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, prod, case_name); \ using namespace args; \ - CUDA_PROD_SUBCASE(__VA_ARGS__); \ + HIP_PROD_SUBCASE(__VA_ARGS__); \ } TEST_CASE("prod(case1)" * doctest::test_suite("array::prod")) @@ -39,7 +39,7 @@ TEST_CASE("prod(case1)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -59,11 +59,11 @@ TEST_CASE("prod(case2)" * doctest::test_suite("array::prod") * doctest::may_fail auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -83,27 +83,27 @@ TEST_CASE("prod(case3)" * doctest::test_suite("array::prod") * doctest::may_fail auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -122,63 +122,63 @@ TEST_CASE("prod(case4)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -197,7 +197,7 @@ TEST_CASE("prod(case5)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -216,11 +216,11 @@ TEST_CASE("prod(case6)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -239,27 +239,27 @@ TEST_CASE("prod(case7)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -278,63 +278,63 @@ TEST_CASE("prod(case8)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -353,7 +353,7 @@ TEST_CASE("prod(case9)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -372,11 +372,11 @@ TEST_CASE("prod(case10)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -395,27 +395,27 @@ TEST_CASE("prod(case11)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -434,63 +434,63 @@ TEST_CASE("prod(case12)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -509,7 +509,7 @@ TEST_CASE("prod(case13)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -528,11 +528,11 @@ TEST_CASE("prod(case14)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -551,27 +551,27 @@ TEST_CASE("prod(case15)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -590,63 +590,63 @@ TEST_CASE("prod(case16)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -665,7 +665,7 @@ TEST_CASE("prod(case17)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -684,11 +684,11 @@ TEST_CASE("prod(case18)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -707,27 +707,27 @@ TEST_CASE("prod(case19)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -746,62 +746,62 @@ TEST_CASE("prod(case20)" * doctest::test_suite("array::prod")) auto keepdims = nm::True; { auto axis = 0; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_PROD_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_PROD_SUBCASE(input,axis,dtype,initial,keepdims); } } \ No newline at end of file diff --git a/tests/hip/array/reductions/add.cpp b/tests/hip/array/reductions/add.cpp index 3b31512b4..0c657665b 100644 --- a/tests/hip/array/reductions/add.cpp +++ b/tests/hip/array/reductions/add.cpp @@ -47,9 +47,9 @@ TEST_CASE("reduce_add(case1)" * doctest::test_suite("array::add.reduce")) // REDUCE_ADD_SUBCASE( case1, a_d, axis, dtype, initial, keepdims ); // REDUCE_ADD_SUBCASE( case1, a_h, axis, dtype, initial, keepdims ); - // REDUCE_ADD_SUBCASE( case1, a_cs_fb, axis, dtype, initial, keepdims ); - // REDUCE_ADD_SUBCASE( case1, a_cs_hb, axis, dtype, initial, keepdims ); - // REDUCE_ADD_SUBCASE( case1, a_cs_db, axis, dtype, initial, keepdims ); + REDUCE_ADD_SUBCASE( case1, a_cs_fb, axis, dtype, initial, keepdims ); + REDUCE_ADD_SUBCASE( case1, a_cs_hb, axis, dtype, initial, keepdims ); + REDUCE_ADD_SUBCASE( case1, a_cs_db, axis, dtype, initial, keepdims ); REDUCE_ADD_SUBCASE( case1, a_fs_fb, axis, dtype, initial, keepdims ); REDUCE_ADD_SUBCASE( case1, a_fs_hb, axis, dtype, initial, keepdims ); diff --git a/tests/hip/array/reductions/multiply.cpp b/tests/hip/array/reductions/multiply.cpp index f85e33194..e43867694 100644 --- a/tests/hip/array/reductions/multiply.cpp +++ b/tests/hip/array/reductions/multiply.cpp @@ -47,9 +47,9 @@ TEST_CASE("reduce_multiply(case1)" * doctest::test_suite("array::multiply.reduce // REDUCE_MULTIPLY_SUBCASE( case1, a_d, axis, dtype, initial, keepdims ); // REDUCE_MULTIPLY_SUBCASE( case1, a_h, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case1, a_cs_fb, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case1, a_cs_hb, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case1, a_cs_db, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case1, a_cs_fb, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case1, a_cs_hb, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case1, a_cs_db, axis, dtype, initial, keepdims ); REDUCE_MULTIPLY_SUBCASE( case1, a_fs_fb, axis, dtype, initial, keepdims ); REDUCE_MULTIPLY_SUBCASE( case1, a_fs_hb, axis, dtype, initial, keepdims ); @@ -76,9 +76,9 @@ TEST_CASE("reduce_multiply(case2)" * doctest::test_suite("array::multiply.reduce // REDUCE_MULTIPLY_SUBCASE( case2, a_d, axis, dtype, initial, keepdims ); // REDUCE_MULTIPLY_SUBCASE( case2, a_h, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case2, a_cs_fb, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case2, a_cs_hb, axis, dtype, initial, keepdims ); - // REDUCE_MULTIPLY_SUBCASE( case2, a_cs_db, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case2, a_cs_fb, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case2, a_cs_hb, axis, dtype, initial, keepdims ); + REDUCE_MULTIPLY_SUBCASE( case2, a_cs_db, axis, dtype, initial, keepdims ); REDUCE_MULTIPLY_SUBCASE( case2, a_fs_fb, axis, dtype, initial, keepdims ); REDUCE_MULTIPLY_SUBCASE( case2, a_fs_hb, axis, dtype, initial, keepdims ); diff --git a/tests/hip/array/slice.cpp b/tests/hip/array/slice.cpp index 44e5e14d8..cd345db4b 100644 --- a/tests/hip/array/slice.cpp +++ b/tests/hip/array/slice.cpp @@ -20,7 +20,7 @@ inline auto name##_ls_db = nmtools::cast(name, nmtools::array::kind::ndarray_ls_ #include "nmtools/array/eval/hip.hpp" #include "nmtools/utils/apply_isclose.hpp" -#if not(defined(__CUDA__) && defined(__CUDA_ARCH__)) +#if not(defined(__HIP__) && defined(__HIP_ARCH__)) #include "nmtools/testing/data/array/slice.hpp" #endif @@ -47,7 +47,6 @@ SUBCASE(#case_name) \ NMTOOLS_ASSERT_APPLY_CLOSE( result, expect ); \ } -#if not(defined(__CUDA__) && defined(__CUDA_ARCH__)) TEST_CASE("slice(case1)" * doctest::test_suite("array::slice")) { // TODO: support data() for the following arrays @@ -66,10 +65,11 @@ TEST_CASE("slice(case1)" * doctest::test_suite("array::slice")) SLICE_SUBCASE(case1, array_hs_db, slice0, slice1, slice2); SLICE_SUBCASE(case1, array_ds_fb, slice0, slice1, slice2); - SLICE_SUBCASE(case1, array_ds_hb, slice0, slice1, slice2); - SLICE_SUBCASE(case1, array_ds_db, slice0, slice1, slice2); + // SLICE_SUBCASE(case1, array_ds_hb, slice0, slice1, slice2); + // SLICE_SUBCASE(case1, array_ds_db, slice0, slice1, slice2); } +#if 0 TEST_CASE("slice(case2)" * doctest::test_suite("array::slice")) { // TODO: support data() for the following arrays diff --git a/tests/hip/array/sum.cpp b/tests/hip/array/sum.cpp index 48cb89e48..5a679abc6 100644 --- a/tests/hip/array/sum.cpp +++ b/tests/hip/array/sum.cpp @@ -8,7 +8,7 @@ namespace nm = nmtools; namespace na = nm::array; namespace ix = nm::index; -#define CUDA_SUM_SUBCASE(...) \ +#define HIP_SUM_SUBCASE(...) \ { \ auto expect = na::sum(__VA_ARGS__); \ auto result = na::sum(__VA_ARGS__, na::hip::default_context()); \ @@ -21,7 +21,7 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, sum, case_name); \ using namespace args; \ - CUDA_SUM_SUBCASE(__VA_ARGS__); \ + HIP_SUM_SUBCASE(__VA_ARGS__); \ } TEST_CASE("sum(case1)" * doctest::test_suite("array::sum")) @@ -39,7 +39,7 @@ TEST_CASE("sum(case1)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -58,19 +58,19 @@ TEST_CASE("sum(case2)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -89,27 +89,27 @@ TEST_CASE("sum(case3)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -128,63 +128,63 @@ TEST_CASE("sum(case4)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -203,7 +203,7 @@ TEST_CASE("sum(case5)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -222,11 +222,11 @@ TEST_CASE("sum(case6)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -245,27 +245,27 @@ TEST_CASE("sum(case7)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -284,63 +284,63 @@ TEST_CASE("sum(case8)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -359,7 +359,7 @@ TEST_CASE("sum(case9)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -378,11 +378,11 @@ TEST_CASE("sum(case10)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -401,27 +401,27 @@ TEST_CASE("sum(case11)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -440,63 +440,63 @@ TEST_CASE("sum(case12)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -515,7 +515,7 @@ TEST_CASE("sum(case13)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -534,11 +534,11 @@ TEST_CASE("sum(case14)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -557,27 +557,27 @@ TEST_CASE("sum(case15)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -596,63 +596,63 @@ TEST_CASE("sum(case16)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -671,7 +671,7 @@ TEST_CASE("sum(case17)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -690,11 +690,11 @@ TEST_CASE("sum(case18)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -713,27 +713,27 @@ TEST_CASE("sum(case19)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } @@ -752,62 +752,62 @@ TEST_CASE("sum(case20)" * doctest::test_suite("array::sum")) auto keepdims = nm::True; { auto axis = 0; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 1; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 2; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 3; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = 4; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,1}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{0,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,2}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{1,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,3}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{2,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } { auto axis = nmtools_array{3,4}; - CUDA_SUM_SUBCASE(input,axis,dtype,initial,keepdims); + HIP_SUM_SUBCASE(input,axis,dtype,initial,keepdims); } } \ No newline at end of file diff --git a/tests/hip/array/ufuncs/add.cpp b/tests/hip/array/ufuncs/add.cpp index 2726990fa..7f7c6c7e2 100644 --- a/tests/hip/array/ufuncs/add.cpp +++ b/tests/hip/array/ufuncs/add.cpp @@ -37,7 +37,7 @@ SUBCASE(#case_name) \ NMTOOLS_ASSERT_CLOSE( result, expect ); \ } -#define CUDA_ADD_SUBCASE(...) \ +#define HIP_ADD_SUBCASE(...) \ { \ auto result = na::add(__VA_ARGS__, na::hip::default_context()); \ auto expect = na::add(__VA_ARGS__); \ @@ -93,5 +93,5 @@ TEST_CASE("add(case1)" * doctest::test_suite("array::add")) auto lhs = na::reshape(lhs_flat,lhs_shape); auto rhs = na::reshape(rhs_flat,rhs_shape); - CUDA_ADD_SUBCASE( lhs, rhs ); + HIP_ADD_SUBCASE( lhs, rhs ); } \ No newline at end of file diff --git a/tests/hip/array/zeros.cpp b/tests/hip/array/zeros.cpp index 0220f0129..d12040bd8 100644 --- a/tests/hip/array/zeros.cpp +++ b/tests/hip/array/zeros.cpp @@ -6,7 +6,7 @@ namespace nm = nmtools; namespace na = nm::array; -#define CUDA_ZEROS_SUBCASE(...) \ +#define HIP_ZEROS_SUBCASE(...) \ { \ auto expect = na::zeros(__VA_ARGS__); \ auto result = na::zeros(__VA_ARGS__, na::hip::default_context()); \ @@ -19,257 +19,257 @@ SUBCASE(#case_name) \ { \ NMTOOLS_TESTING_USE_CASE(array, zeros, case_name); \ using namespace args; \ - CUDA_ZEROS_SUBCASE(__VA_ARGS__); \ + HIP_ZEROS_SUBCASE(__VA_ARGS__); \ } TEST_CASE("zeros(case1)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case13)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case14)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case15)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case16)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case17)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case18)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case2)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case3)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case4)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case5)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case6)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::float32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case7)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case8)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case9)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case10)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case11)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case12)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::float64; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case13)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case14)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case15)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case16)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case17)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case18)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int8; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case19)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case20)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case21)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case22)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case23)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case24)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int32; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case25)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{128}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case26)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{1,128}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case27)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{64,2}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case28)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{16,4,2}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case29)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{8,2,4,2}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } TEST_CASE("zeros(case30)" * doctest::test_suite("array::zeros")) { auto shape = nmtools_array{2,4,1,2,4,2}; auto dtype = nm::int16; - CUDA_ZEROS_SUBCASE(shape,dtype); + HIP_ZEROS_SUBCASE(shape,dtype); } \ No newline at end of file diff --git a/tests/hip/composition/add_tanh.cpp b/tests/hip/composition/add_tanh.cpp index 1cfc0be24..32fa91fcf 100644 --- a/tests/hip/composition/add_tanh.cpp +++ b/tests/hip/composition/add_tanh.cpp @@ -14,7 +14,7 @@ namespace ix = nmtools::index; namespace fn = nmtools::functional; namespace view = nm::view; -#define CUDA_SUBCASE(...) \ +#define HIP_SUBCASE(...) \ { \ auto result = na::eval(__VA_ARGS__, na::hip::default_context()); \ auto expect = na::eval(__VA_ARGS__); \ @@ -36,5 +36,5 @@ TEST_CASE("add_tanh(case1)" * doctest::test_suite("array::add_tanh")) auto x = view::add(a,0.5f); auto y = view::tanh(x); - CUDA_SUBCASE( y ); + HIP_SUBCASE( y ); } \ No newline at end of file diff --git a/tests/hip/composition/mean_subtract.cpp b/tests/hip/composition/mean_subtract.cpp deleted file mode 100644 index 73dfef3bd..000000000 --- a/tests/hip/composition/mean_subtract.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "nmtools/array/array/mean.hpp" -#include "nmtools/array/array/ufuncs/subtract.hpp" -#include "nmtools/array/array/arange.hpp" -#include "nmtools/array/array/reshape.hpp" -#include "nmtools/array/eval/hip.hpp" -#include "nmtools/testing/doctest.hpp" -#include "nmtools/testing/data/array/arange.hpp" - -namespace nm = nmtools; -namespace na = nmtools::array; -namespace ix = nmtools::index; -namespace fn = nmtools::functional; -namespace view = nm::view; - -namespace composition -{ - template - constexpr auto mean_subtract(const array_t& array, const axis_t& axis, dtype_t dtype=dtype_t{}) - { - // must keep dimension to properly subtract - auto a = view::mean(array,axis,dtype,nmtools::True); - auto b = view::subtract(array,a); - return b; - } // mean_subtract -} // composition - -TEST_CASE("mean_subtract(case1)" * doctest::test_suite("mean_subtract")) -{ - auto shape = nmtools_array{128}; - auto numel = ix::product(shape); - auto start = 0; - auto stop = start+numel; - auto step = 1; - auto dtype = nm::float32; - - auto input = na::reshape(na::arange(start,stop,step,dtype),shape); - auto axis = 0; - auto array = composition::mean_subtract(input,axis,dtype); -} - -TEST_CASE("mean" * doctest::test_suite("get_graph")) -{ - auto nodes = nmtools_tuple{fn::alias,fn::alias,fn::reduce_add,fn::divide}; - /* operand list */ - auto adjacency_list = nmtools_tuple{nm::None,nm::None,nmtools_array{0},nmtools_array{2,1}}; -} \ No newline at end of file diff --git a/tests/hip/composition/reduce_add_divide.cpp b/tests/hip/composition/reduce_add_divide.cpp index 4ed2fa4c5..df373f1a8 100644 --- a/tests/hip/composition/reduce_add_divide.cpp +++ b/tests/hip/composition/reduce_add_divide.cpp @@ -12,7 +12,7 @@ namespace ix = nmtools::index; namespace fn = nmtools::functional; namespace view = nm::view; -#define CUDA_SUBCASE(...) \ +#define HIP_SUBCASE(...) \ { \ auto result = na::eval(__VA_ARGS__, na::hip::default_context()); \ auto expect = na::eval(__VA_ARGS__); \ @@ -40,5 +40,5 @@ TEST_CASE("reduce_add_divide(case1)" * doctest::test_suite("array::reduce_add_di auto x = view::reduce_add(lhs,axis,dtype,initial,keepdims); auto y = view::divide(x,divisor); - CUDA_SUBCASE( y ); + HIP_SUBCASE( y ); } \ No newline at end of file