Skip to content

Commit

Permalink
Merge pull request #327 from daineAMD/master
Browse files Browse the repository at this point in the history
Merge staging 4deab90 into master with GO from CQE
  • Loading branch information
daineAMD authored Mar 29, 2021
2 parents 00b0358 + d938d2c commit 727c8bc
Show file tree
Hide file tree
Showing 130 changed files with 5,293 additions and 3,888 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log for hipBLAS

## [hipBLAS 0.45.0 for ROCm 4.3.0]
### Added
- Added hipblasStatusToString

## [hipBLAS 0.44.0 for ROCm 4.2.0]
### Added
- Made necessary changes to work with rocBLAS' gemm_ex changes. When using rocBLAS backend, hipBLAS will query the preferable
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ include( ROCMInstallTargets )
include( ROCMPackageConfigHelpers )
include( ROCMInstallSymlinks )

set ( VERSION_STRING "0.44.0" )
set ( VERSION_STRING "0.45.0" )
rocm_setup_version( VERSION ${VERSION_STRING} )

if( NOT DEFINED $ENV{HIP_PATH})
Expand Down
227 changes: 115 additions & 112 deletions clients/benchmarks/client.cpp

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions clients/common/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,48 @@ std::string hipblas_exepath()
return pathstr;
}

/*****************
* local handles *
*****************/

hipblasLocalHandle::hipblasLocalHandle()
{
auto status = hipblasCreate(&m_handle);
if(status != HIPBLAS_STATUS_SUCCESS)
throw std::runtime_error(hipblasStatusToString(status));
}

hipblasLocalHandle::hipblasLocalHandle(const Arguments& arg)
: hipblasLocalHandle()
{
// for future customization of handle based on arguments, example from rocblas below

/*
auto status = rocblas_set_atomics_mode(m_handle, arg.atomics_mode);
if(status == rocblas_status_success)
{
// If the test specifies user allocated workspace, allocate and use it
if(arg.user_allocated_workspace)
{
if((hipMalloc)(&m_memory, arg.user_allocated_workspace) != hipSuccess)
throw std::bad_alloc();
status = rocblas_set_workspace(m_handle, m_memory, arg.user_allocated_workspace);
}
}
if(status != rocblas_status_success)
throw std::runtime_error(rocblas_status_to_string(status));
*/
}

hipblasLocalHandle::~hipblasLocalHandle()
{
if(m_memory)
(hipFree)(m_memory);
hipblasDestroy(m_handle);
}

#ifdef __cplusplus
extern "C" {
#endif
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 727c8bc

Please sign in to comment.