Skip to content

Commit

Permalink
Re-add the hip fillmode functions
Browse files Browse the repository at this point in the history
They are in theory useless (values are cblas based), but for the sake of
symmetry with cublas codebase it is easier to have them.
  • Loading branch information
abouteiller committed Sep 5, 2024
1 parent 3301173 commit f7dac24
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/dplasmaaux_hip.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@
#include <hipsolver/hipsolver.h>
#include <rocsolver/rocsolver.h>

#include "dplasma/constants.h"

static inline hipblasSideMode_t dplasma_hipblas_side(int side) {
assert( (side == dplasmaRight) || (side == dplasmaLeft) );
return (side == dplasmaRight) ? HIPBLAS_SIDE_RIGHT : HIPBLAS_SIDE_LEFT;
}

static inline hipblasDiagType_t dplasma_hipblas_diag(int diag) {
assert( (diag == dplasmaNonUnit) || (diag == dplasmaUnit) );
return (diag == dplasmaNonUnit) ? HIPBLAS_DIAG_NON_UNIT : HIPBLAS_DIAG_UNIT;
}

static inline hipblasFillMode_t dplasma_hipblas_fill(int fill) {
assert( (fill == dplasmaLower) || (fill == dplasmaUpper) );
return (fill == dplasmaLower) ? HIPBLAS_FILL_MODE_LOWER : HIPBLAS_FILL_MODE_UPPER;
}

static inline hipblasOperation_t dplasma_hipblas_op(int trans) {
#if defined(PRECISION_d) || defined(PRECISION_s)
assert( (trans == dplasmaNoTrans) || (trans == dplasmaTrans) );
#else
assert( (trans == dplasmaNoTrans) || (trans == dplasmaTrans) || (trans == dplasmaConjTrans) );
#endif /* PRECISION_d || PRECISION_s */
return (trans == dplasmaConjTrans) ? HIPBLAS_OP_C: ((trans == dplasmaTrans) ? HIPBLAS_OP_T : HIPBLAS_OP_N);
}

extern parsec_info_id_t dplasma_dtd_hip_infoid;

typedef struct {
Expand Down

0 comments on commit f7dac24

Please sign in to comment.