Skip to content

Commit

Permalink
hic: Add hicDataType and fixup missing deallocation of buffer in test…
Browse files Browse the repository at this point in the history
…_hicsparse (#237)
  • Loading branch information
wdeconinck committed Dec 3, 2024
1 parent fa9523e commit 7d3d2fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hic/src/hic/hic_library_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions hic/tests/test_hicsparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 7d3d2fc

Please sign in to comment.