Skip to content

Commit

Permalink
Merge commit '4deab90'
Browse files Browse the repository at this point in the history
  • Loading branch information
daineAMD committed Mar 29, 2021
2 parents 8003b0b + 4deab90 commit d938d2c
Show file tree
Hide file tree
Showing 114 changed files with 4,183 additions and 3,607 deletions.
134 changes: 69 additions & 65 deletions clients/benchmarks/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ struct perf_blas<T, U, std::enable_if_t<std::is_same<T, float>{} || std::is_same
void operator()(const Arguments& arg)
{
static const func_map fmap = {
// L1
{"asum", testing_asum<T>},
{"asum_batched", testing_asum_batched<T>},
{"asum_strided_batched", testing_asum_strided_batched<T>},
Expand All @@ -330,46 +331,43 @@ struct perf_blas<T, U, std::enable_if_t<std::is_same<T, float>{} || std::is_same
{"dot", testing_dot<T>},
{"dot_batched", testing_dot_batched<T>},
{"dot_strided_batched", testing_dot_strided_batched<T>},
{"iamax", testing_amax<T>},
{"iamax_batched", testing_amax_batched<T>},
{"iamax_strided_batched", testing_amax_strided_batched<T>},
{"iamin", testing_amin<T>},
{"iamin_batched", testing_amin_batched<T>},
{"iamin_strided_batched", testing_amin_strided_batched<T>},
{"nrm2", testing_nrm2<T>},
{"nrm2_batched", testing_nrm2_batched<T>},
{"nrm2_strided_batched", testing_nrm2_strided_batched<T>},
{"swap", testing_swap<T>},
{"swap_batched", testing_swap_batched<T>},
{"swap_strided_batched", testing_swap_strided_batched<T>},
{"scal", testing_scal<T>},
{"scal_batched", testing_scal_batched<T>},
{"scal_strided_batched", testing_scal_strided_batched<T>},

// L2
{"gbmv", testing_gbmv<T>},
{"gbmv_batched", testing_gbmv_batched<T>},
{"gbmv_strided_batched", testing_gbmv_strided_batched<T>},
{"gemv", testing_gemv<T>},
{"gemv_batched", testing_gemv_batched<T>},
{"gemv_strided_batched", testing_gemv_strided_batched<T>},
{"ger", testing_ger<T, false>},
{"ger_batched", testing_ger_batched<T, false>},
{"ger_strided_batched", testing_ger_strided_batched<T, false>},
/*{"set_get_vector", testing_set_get_vector<T>},
{"set_get_matrix", testing_set_get_matrix<T>},
{"set_get_matrix_async", testing_set_get_matrix_async<T>},
// L1
{"iamax", testing_iamax<T>},
{"iamax_batched", testing_iamax_batched<T>},
{"iamax_strided_batched", testing_iamax_strided_batched<T>},
{"iamin", testing_iamin<T>},
{"iamin_batched", testing_iamin_batched<T>},
{"iamin_strided_batched", testing_iamin_strided_batched<T>},
{"nrm2", testing_nrm2<T>},
{"nrm2_batched", testing_nrm2_batched<T>},
{"nrm2_strided_batched", testing_nrm2_strided_batched<T>},
{"rotm", testing_rotm<T>},
{"rotm_batched", testing_rotm_batched<T>},
{"rotm_strided_batched", testing_rotm_strided_batched<T>},
{"rotmg", testing_rotmg<T>},
{"rotmg_batched", testing_rotmg_batched<T>},
{"rotmg_strided_batched", testing_rotmg_strided_batched<T>},
// L2
{"gbmv", testing_gbmv<T>},
{"gbmv_batched", testing_gbmv_batched<T>},
{"gbmv_strided_batched", testing_gbmv_strided_batched<T>},
{"geam", testing_geam<T>},
{"geam_batched", testing_geam_batched<T>},
{"geam_strided_batched", testing_geam_strided_batched<T>},
*/
{"gemv", testing_gemv<T>},
{"gemv_batched", testing_gemvBatched<T>},
{"gemv_strided_batched", testing_gemvStridedBatched<T>},
/*
{"ger", testing_ger<T, false>},
{"ger_batched", testing_ger_batched<T, false>},
{"ger_strided_batched", testing_ger_strided_batched<T, false>},
{"spr", testing_spr<T>},
{"spr_batched", testing_spr_batched<T>},
{"spr_strided_batched", testing_spr_strided_batched<T>},
Expand Down Expand Up @@ -401,6 +399,9 @@ struct perf_blas<T, U, std::enable_if_t<std::is_same<T, float>{} || std::is_same
{"trmv_batched", testing_trmv_batched<T>},
{"trmv_strided_batched", testing_trmv_strided_batched<T>},
// L3
{"geam", testing_geam<T>},
{"geam_batched", testing_geam_batched<T>},
{"geam_strided_batched", testing_geam_strided_batched<T>},
{"dgmm", testing_dgmm<T>},
{"dgmm_batched", testing_dgmm_batched<T>},
{"dgmm_strided_batched", testing_dgmm_strided_batched<T>},
Expand Down Expand Up @@ -493,6 +494,7 @@ struct perf_blas<
void operator()(const Arguments& arg)
{
static const func_map map = {
// L1
{"asum", testing_asum<T>},
{"asum_batched", testing_asum_batched<T>},
{"asum_strided_batched", testing_asum_strided_batched<T>},
Expand All @@ -508,56 +510,58 @@ struct perf_blas<
{"dotc", testing_dotc<T>},
{"dotc_batched", testing_dotc_batched<T>},
{"dotc_strided_batched", testing_dotc_strided_batched<T>},
{"iamax", testing_amax<T>},
{"iamax_batched", testing_amax_batched<T>},
{"iamax_strided_batched", testing_amax_strided_batched<T>},
{"iamin", testing_amin<T>},
{"iamin_batched", testing_amin_batched<T>},
{"iamin_strided_batched", testing_amin_strided_batched<T>},
{"nrm2", testing_nrm2<T>},
{"nrm2_batched", testing_nrm2_batched<T>},
{"nrm2_strided_batched", testing_nrm2_strided_batched<T>},
{"swap", testing_swap<T>},
{"swap_batched", testing_swap_batched<T>},
{"swap_strided_batched", testing_swap_strided_batched<T>},
{"scal", testing_scal<T>},
{"scal_batched", testing_scal_batched<T>},
{"scal_strided_batched", testing_scal_strided_batched<T>},

// L2
{"gemv", testing_gemv<T>},
{"gemv_batched", testing_gemv_batched<T>},
{"gemv_strided_batched", testing_gemv_strided_batched<T>},
{"gbmv", testing_gbmv<T>},
{"gbmv_batched", testing_gbmv_batched<T>},
{"gbmv_strided_batched", testing_gbmv_strided_batched<T>},
{"geru", testing_ger<T, false>},
{"geru_batched", testing_ger_batched<T, false>},
{"geru_strided_batched", testing_ger_strided_batched<T, false>},
{"gerc", testing_ger<T, true>},
{"gerc_batched", testing_ger_batched<T, true>},
{"gerc_strided_batched", testing_ger_strided_batched<T, true>},
{"hbmv", testing_hbmv<T>},
{"hbmv_batched", testing_hbmv_batched<T>},
{"hbmv_strided_batched", testing_hbmv_strided_batched<T>},
{"hemv", testing_hemv<T>},
{"hemv_batched", testing_hemv_batched<T>},
{"hemv_strided_batched", testing_hemv_strided_batched<T>},
{"her", testing_her<T>},
{"her_batched", testing_her_batched<T>},
{"her_strided_batched", testing_her_strided_batched<T>},
{"her2", testing_her2<T>},
{"her2_batched", testing_her2_batched<T>},
{"her2_strided_batched", testing_her2_strided_batched<T>},
{"hpmv", testing_hpmv<T>},
{"hpmv_batched", testing_hpmv_batched<T>},
{"hpmv_strided_batched", testing_hpmv_strided_batched<T>},
{"hpr", testing_hpr<T>},
{"hpr_batched", testing_hpr_batched<T>},
{"hpr_strided_batched", testing_hpr_strided_batched<T>},
{"hpr2", testing_hpr2<T>},
{"hpr2_batched", testing_hpr2_batched<T>},
{"hpr2_strided_batched", testing_hpr2_strided_batched<T>},
/*
{"iamax", testing_iamax<T>},
{"iamax_batched", testing_iamax_batched<T>},
{"iamax_strided_batched", testing_iamax_strided_batched<T>},
{"iamin", testing_iamin<T>},
{"iamin_batched", testing_iamin_batched<T>},
{"iamin_strided_batched", testing_iamin_strided_batched<T>},
{"nrm2", testing_nrm2<T>},
{"nrm2_batched", testing_nrm2_batched<T>},
{"nrm2_strided_batched", testing_nrm2_strided_batched<T>},
// L2
{"gbmv", testing_gbmv<T>},
{"gbmv_batched", testing_gbmv_batched<T>},
{"gbmv_strided_batched", testing_gbmv_strided_batched<T>},
{"gemv", testing_gemv<T>},
{"gemv_batched", testing_gemv_batched<T>},
{"gemv_strided_batched", testing_gemv_strided_batched<T>},
{"geru", testing_ger<T, false>},
{"geru_batched", testing_ger_batched<T, false>},
{"geru_strided_batched", testing_ger_strided_batched<T, false>},
{"gerc", testing_ger<T, true>},
{"gerc_batched", testing_ger_batched<T, true>},
{"gerc_strided_batched", testing_ger_strided_batched<T, true>},
{"hbmv", testing_hbmv<T>},
{"hbmv_batched", testing_hbmv_batched<T>},
{"hbmv_strided_batched", testing_hbmv_strided_batched<T>},
{"hemv", testing_hemv<T>},
{"hemv_batched", testing_hemv_batched<T>},
{"hemv_strided_batched", testing_hemv_strided_batched<T>},
{"her", testing_her<T>},
{"her_batched", testing_her_batched<T>},
{"her_strided_batched", testing_her_strided_batched<T>},
{"her2", testing_her2<T>},
{"her2_batched", testing_her2_batched<T>},
{"her2_strided_batched", testing_her2_strided_batched<T>},
{"hpmv", testing_hpmv<T>},
{"hpmv_batched", testing_hpmv_batched<T>},
{"hpmv_strided_batched", testing_hpmv_strided_batched<T>},
{"hpr", testing_hpr<T>},
{"hpr_batched", testing_hpr_batched<T>},
{"hpr_strided_batched", testing_hpr_strided_batched<T>},
{"hpr2", testing_hpr2<T>},
{"hpr2_batched", testing_hpr2_batched<T>},
{"hpr2_strided_batched", testing_hpr2_strided_batched<T>},
{"spr", testing_spr<T>},
{"spr_batched", testing_spr_batched<T>},
{"spr_strided_batched", testing_spr_strided_batched<T>},
Expand Down
3 changes: 2 additions & 1 deletion clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ########################################################################
# Copyright 2016-2020 Advanced Micro Devices, Inc.
# Copyright 2016-2021 Advanced Micro Devices, Inc.
# ########################################################################

# set( Boost_DEBUG ON )
Expand Down Expand Up @@ -39,6 +39,7 @@ include_directories(${GTEST_INCLUDE_DIRS})

set(hipblas_test_source
hipblas_gtest_main.cpp
auxiliary_gtest.cpp
set_get_pointer_mode_gtest.cpp
set_get_vector_gtest.cpp
set_get_matrix_gtest.cpp
Expand Down
22 changes: 22 additions & 0 deletions clients/gtest/auxiliary_gtest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* ************************************************************************
* Copyright 2016-2021 Advanced Micro Devices, Inc.
*
* ************************************************************************ */

#include "utility.h"
#include <gtest/gtest.h>
#include <math.h>
#include <stdexcept>
#include <vector>

namespace
{

TEST(hipblas_auxiliary, statusToString)
{
EXPECT_EQ(0,
strcmp("HIPBLAS_STATUS_ALLOC_FAILED",
hipblasStatusToString(HIPBLAS_STATUS_ALLOC_FAILED)));
}

} // namespace
14 changes: 10 additions & 4 deletions clients/gtest/axpy_ex_gtest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ************************************************************************
* dotright 2016 Advanced Micro Devices, Inc.
* Copyright 2016-2021 Advanced Micro Devices, Inc.
*
* ************************************************************************ */

Expand Down Expand Up @@ -74,9 +74,11 @@ const int batch_count_range[] = {-1, 0, 1, 2, 10};

// Supported rocBLAS configs
const vector<vector<hipblasDatatype_t>> precisions{
// No cuBLAS support
// No cuBLAS support
#ifndef __HIP_PLATFORM_NVCC__
{HIPBLAS_R_16F, HIPBLAS_R_16F, HIPBLAS_R_16F, HIPBLAS_R_16F},
{HIPBLAS_R_16F, HIPBLAS_R_16F, HIPBLAS_R_16F, HIPBLAS_R_32F},
#endif

{HIPBLAS_R_32F, HIPBLAS_R_16F, HIPBLAS_R_16F, HIPBLAS_R_32F},
{HIPBLAS_R_32F, HIPBLAS_R_32F, HIPBLAS_R_32F, HIPBLAS_R_32F},
Expand Down Expand Up @@ -144,6 +146,8 @@ TEST_P(axpy_ex_gtest, axpy_ex)
}
}

#ifndef __HIP_PLATFORM_NVCC__

TEST_P(axpy_ex_gtest, axpy_batched_ex)
{
Arguments arg = setup_axpy_ex_arguments(GetParam());
Expand All @@ -157,7 +161,7 @@ TEST_P(axpy_ex_gtest, axpy_batched_ex)
}
else
{
EXPECT_EQ(HIPBLAS_STATUS_NOT_SUPPORTED, status); // for CUDA
EXPECT_EQ(HIPBLAS_STATUS_SUCCESS, status); // fail
}
}
}
Expand All @@ -175,11 +179,13 @@ TEST_P(axpy_ex_gtest, axpy_strided_batched_ex)
}
else
{
EXPECT_EQ(HIPBLAS_STATUS_NOT_SUPPORTED, status); // for CUDA
EXPECT_EQ(HIPBLAS_STATUS_SUCCESS, status); // fail
}
}
}

#endif

// Values is for a single item; ValuesIn is for an array
// notice we are using vector of vector
// so each elment in xxx_range is a avector,
Expand Down
Loading

0 comments on commit d938d2c

Please sign in to comment.