From 7d3d2fc13c4d5f7a3b2d83daadedea19316b3672 Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Tue, 3 Dec 2024 12:56:05 +0000 Subject: [PATCH] hic: Add hicDataType and fixup missing deallocation of buffer in test_hicsparse (#237) --- hic/src/hic/hic_library_types.h | 3 +++ hic/tests/test_hicsparse.cc | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hic/src/hic/hic_library_types.h b/hic/src/hic/hic_library_types.h index 72c06adf5..cab842800 100644 --- a/hic/src/hic/hic_library_types.h +++ b/hic/src/hic/hic_library_types.h @@ -29,12 +29,15 @@ HIC_NAMESPACE_BEGIN #if HIC_BACKEND_CUDA constexpr decltype(CUDA_R_32F) HIC_R_32F = CUDA_R_32F; constexpr decltype(CUDA_R_64F) HIC_R_64F = CUDA_R_64F; + using hicDataType = cudaDataType; #elif HIC_BACKEND_HIP constexpr decltype(HIP_R_32F) HIC_R_32F = HIP_R_32F; constexpr decltype(HIP_R_64F) HIC_R_64F = HIP_R_64F; + using hicDataType = hipDataType; #elif HIC_BACKEND_DUMMY constexpr int HIC_R_32F = 0; constexpr int HIC_R_64F = 0; + using hicDataType = int; #else #error Unsupported hic backend. Please define HIC_BACKEND_CUDA or HIC_BACKEND_HIP or HIC_BACKEND_DUMMY #endif diff --git a/hic/tests/test_hicsparse.cc b/hic/tests/test_hicsparse.cc index 0d977ffaf..6827820f7 100644 --- a/hic/tests/test_hicsparse.cc +++ b/hic/tests/test_hicsparse.cc @@ -120,6 +120,7 @@ int test_hicsparseSpMV() { HIC_CALL( hicMalloc(&buffer, bufferSize) ); // Perform SpMV + // y = alpha * A * x + beta * y HICSPARSE_CALL( hicsparseSpMV( handle, HICSPARSE_OPERATION_NON_TRANSPOSE, @@ -283,6 +284,7 @@ int test_hicsparseSpMM() { } // Clean up + HIC_CALL(hicFree(buffer)); HIC_CALL(hicFree(dC)); HIC_CALL(hicFree(dB)); HIC_CALL(hicFree(dcolumn_indices));