Skip to content

maximilianbehr/hipexpm

Repository files navigation

hipexpm - Matrix Exponential Approximation using HIP

License: MIT GitHub Release DOI

Version: 2.0.0

Copyright: Maximilian Behr

License: The software is licensed under under MIT. See LICENSE for details.

hipexpm is a HIP library for the numerical approximation of the matrix exponential $e^A$.

hipexpm support single and double precision as well as real and complex matrices.

Functions Data
hipexpms_bufferSize, hipexpms real, single precision matrix
hipexpmd_bufferSize, hipexpmd real, double precision matrix
hipexpmc_bufferSize, hipexpmc complex, single precision matrix
hipexpmz_bufferSize, hipexpmz complex, double precision matrix

Available functions:

int hipexpms_bufferSize(const int n, size_t *d_bufferSize, size_t *h_bufferSize);
int hipexpms(const int n, const float *d_A, const int ldA, void *d_buffer, void *h_buffer, float *d_expmA, const int ldexpmA);
int hipexpmd_bufferSize(const int n, size_t *d_bufferSize, size_t *h_bufferSize);
int hipexpmd(const int n, const double *d_A, const int ldA, void *d_buffer, void *h_buffer, double *d_expmA, const int ldexpmA);
int hipexpmc_bufferSize(const int n, size_t *d_bufferSize, size_t *h_bufferSize);
int hipexpmc(const int n, const hipComplex *d_A, const int ldA, void *d_buffer, void *h_buffer, hipComplex *d_expmA, const int ldexpmA);
int hipexpmz_bufferSize(const int n, size_t *d_bufferSize, size_t *h_bufferSize);
int hipexpmz(const int n, const hipDoubleComplex *d_A, const int ldA, void *d_buffer, void *h_buffer, hipDoubleComplex *d_expmA, const int ldexpmA);

Algorithm

hipexpm implements the scaling and squaring method for the matrix exponential approximation.

The Scaling and Squaring Method for the Matrix Exponential Revisited Nicholas J. Higham SIAM Journal on Matrix Analysis and Applications 2005 26:4, 1179-1193

Installation

Prerequisites:

  • CMake >= 3.23
  • ROCm >= 6.0.2
  mkdir build && cd build
  cmake ..
  make
  make install

Usage and Examples

We provide examples for all supported matrix formats:

File Data
example_hipexpms.hip real, single precision matrix
example_hipexpmd.hip real, double precision matrix
example_hipexpmc.hip complex, single precision matrix
example_hipexpmz.hip complex, double precision matrix