Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,12 @@ if(BUILD_CODE_COVERAGE)

COMMAND ${LLVM_COV_EXECUTABLE}
report
-object ./library/libhipblaslt-d.so.0.15
-object ./library/libhipblaslt-d.so.${hipblaslt_SOVERSION}
-instr-profile=./coverage_test.profdata
--ignore-filename-regex=.*/build/debug/.*
COMMAND ${LLVM_COV_EXECUTABLE}
show
-object ./library/libhipblaslt-d.so.0.15
-object ./library/libhipblaslt-d.so.${hipblaslt_SOVERSION}
-instr-profile=./coverage_test.profdata
-format=html -output-dir=coverage-report
--ignore-filename-regex=.*/build/debug/.*
Expand Down
10 changes: 10 additions & 0 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ target_compile_definitions( hipblaslt-test PRIVATE ROCM_USE_FLOAT16 HIPBLASLT_IN
target_compile_options(hipblaslt-test PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${COMMON_CXX_OPTIONS}>)
# target_compile_options does not go to linker like CMAKE_CXX_FLAGS does, so manually add

# We need to cover the inline functions in library when they are used in tests.
# If we don't do this, the coverage instrumentation in libhipblaslt-d.so
# does not record execution because the functions are inlined and not compiled separately.
if(BUILD_CODE_COVERAGE)
target_compile_options(hipblaslt-test PRIVATE
-fprofile-instr-generate
-fcoverage-mapping
)
endif()

if (BUILD_CUDA)
target_link_libraries( hipblaslt-test PRIVATE -llapack -lcblas )
else()
Expand Down
8 changes: 7 additions & 1 deletion clients/gtest/auxiliary_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ namespace
testing_aux_matmul_pref_init(arg);
else if(!strcmp(arg.function, "aux_matmul_alg_null_matmul"))
testing_aux_matmul_alg_null_matmul(arg);
else if(!strcmp(arg.function, "aux_mat_copy"))
testing_aux_mat_copy(arg);
else if(!strcmp(arg.function, "aux_auxiliary_func"))
testing_aux_auxiliary_func(arg);
else
FAIL() << "Internal error: Test called with unknown function: " << arg.function;
}
Expand Down Expand Up @@ -132,7 +136,9 @@ namespace
|| !strcmp(arg.function, "aux_matmul_plan_init")
|| !strcmp(arg.function, "aux_matmul_alg_null_matmul")
|| !strcmp(arg.function, "aux_matmul_pref_get_attr_bad_arg")
|| !strcmp(arg.function, "aux_matmul_pref_get_attr");
|| !strcmp(arg.function, "aux_matmul_pref_get_attr")
|| !strcmp(arg.function, "aux_mat_copy")
|| !strcmp(arg.function, "aux_auxiliary_func");
}

// Google Test name suffix based on parameters
Expand Down
10 changes: 10 additions & 0 deletions clients/gtest/auxiliary_gtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,14 @@ Tests:
transB: N
alpha: 1
beta: 0

- name: aux_mat_copy
category: pre_checkin
function:
- aux_mat_copy: *hpa_half_precision

- name: aux_auxiliary_func
category: pre_checkin
function:
- aux_auxiliary_func: *hpa_half_precision
...
344 changes: 328 additions & 16 deletions clients/include/testing_auxiliary.hpp

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion library/src/amd_detail/hipblaslt_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@
#endif
#include <rocblaslt.h>
#include <Debug.hpp>
hipblasStatus_t hipErrorToHIPBLASStatus(hipError_t status);

hipblasStatus_t RocBlasLtStatusToHIPStatus(rocblaslt_status_ status);
43 changes: 0 additions & 43 deletions library/src/amd_detail/rocblaslt/src/include/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,49 +105,6 @@ constexpr const char* rocblaslt_compute_type_string(rocblaslt_compute_type type)
}
}

constexpr const char* rocblaslt_transpose_letter(hipblasOperation_t op)
{
switch(op)
{
case HIPBLAS_OP_N:
return "N";
case HIPBLAS_OP_T:
return "T";
case HIPBLAS_OP_C:
return "C";
default:
return "invalidTranspose";
}
}
// Convert rocblaslt_status to string
constexpr const char* rocblaslt_status_to_string(rocblaslt_status status)
{
#define CASE(x) \
case x: \
return #x
switch(status)
{
CASE(rocblaslt_status_success);
CASE(rocblaslt_status_invalid_handle);
CASE(rocblaslt_status_not_implemented);
CASE(rocblaslt_status_invalid_pointer);
CASE(rocblaslt_status_invalid_size);
CASE(rocblaslt_status_memory_error);
CASE(rocblaslt_status_internal_error);
CASE(rocblaslt_status_invalid_value);
CASE(rocblaslt_status_arch_mismatch);
CASE(rocblaslt_status_zero_pivot);
CASE(rocblaslt_status_not_initialized);
CASE(rocblaslt_status_type_mismatch);
CASE(rocblaslt_status_requires_sorted_storage);
CASE(rocblaslt_status_continue);
}
#undef CASE
// We don't use default: so that the compiler warns us if any valid enums are
// missing from our switch. If the value is not a valid rocblaslt_status, we
// return this string.
return "<undefined rocblaslt_status value>";
}
template <typename>
static constexpr char rocblaslt_precision_string[] = "invalid";
template <>
Expand Down
30 changes: 9 additions & 21 deletions library/src/include/auxiliary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,21 @@ constexpr const char* hip_datatype_to_string(hipDataType type)
default:
return "non-supported type";
}
return "invalid";
}

// return precision string for hipDataType
HIPBLASLT_EXPORT
constexpr const char* hipblas_computetype_to_string(hipblasComputeType_t type)
{
switch(type)
{
case HIPBLAS_COMPUTE_16F:
return "f16_r";
case HIPBLAS_COMPUTE_32F:
return "f32_r";
case HIPBLAS_COMPUTE_32F_FAST_TF32:
return "xf32_r";
case HIPBLAS_COMPUTE_64F:
return "f64_r";
case HIPBLAS_COMPUTE_32I:
return "i32_r";
case HIPBLAS_COMPUTE_32F_FAST_16F:
return "f32_f16_r";
case HIPBLAS_COMPUTE_32F_FAST_16BF:
return "f32_bf16_r";
default:
return "non-supported compute type";
}
return "invalid";
return
type == HIPBLAS_COMPUTE_16F ? "f16_r" :
type == HIPBLAS_COMPUTE_32F ? "f32_r" :
type == HIPBLAS_COMPUTE_32F_FAST_TF32 ? "xf32_r" :
type == HIPBLAS_COMPUTE_64F ? "f64_r" :
type == HIPBLAS_COMPUTE_32I ? "i32_r" :
type == HIPBLAS_COMPUTE_32F_FAST_16F ? "f32_f16_r" :
type == HIPBLAS_COMPUTE_32F_FAST_16BF ? "f32_bf16_r" :
"non-supported compute type";
}

// clang-format off
Expand Down