An Example of EVD using Arm Performance Libraries chbevd_2stage

I am trying to implement the EVD using Arm Performance Libraries.

I have referred to the ARM PL user manual and the LAPACK documentation, but I am unable to operate it. I am using chbevd_2stage to compute the eigenvalues and eigenvectors. Here is the ARM PL manual: chbevd_2stage

Could you provide me with a simple example? Thank you!

#define N 8

armpl_singlecomplex_t h_cov_arm[N * N] = {
    {4140.65f, -2.24197e-06f}, {137.897f, 3938.01f}, {-158.647f, -1241.86f}, {-1936.52f, 2616.06f},
    {-743.871f, 2664.88f}, {623.323f, -4050.98f}, {-1115.17f, 1268.56f}, {-1067.13f, 133.398f},
    {137.897f, -3938.01f}, {4154.02f, 3.32665e-06f}, {-1563.14f, -967.872f}, {2961.04f, 2489.75f},
    {3325.31f, 1229.58f}, {-3941.03f, -737.05f}, {1463.98f, 2163.99f}, {-995.137f, 1257.28f},
    {-158.647f, 1241.86f}, {-1563.14f, 967.872f}, {3843.31f, -2.39818e-07f}, {-2763.36f, 255.503f},
    {-2805.64f, 1415.83f}, {1326.26f, 228.303f}, {-3621.11f, -722.38f}, {584.441f, -3733.83f},
    {-1936.52f, -2616.06f}, {2961.04f, -2489.75f}, {-2763.36f, -255.503f}, {4067.95f, -3.1887e-06f},
    {3742.5f, -1311.93f}, {-2992.45f, 1599.3f}, {3214.86f, 1165.23f}, {-611.432f, 2481.71f},
    {-743.871f, -2664.88f}, {3325.31f, -1229.58f}, {-2805.64f, -1415.83f}, {3742.5f, 1311.94f},
    {4021.9f, -3.66673e-06f}, {-2973.91f, 342.678f}, {2854.54f, 2360.54f}, {-1725.97f, 2476.39f},
    {623.323f, 4050.98f}, {-3941.03f, 737.05f}, {1326.26f, -228.303f}, {-2992.45f, -1599.3f},
    {-2973.91f, -342.678f}, {4204.25f, 3.96076e-06f}, {-1613.83f, -1059.15f}, {-198.559f, -1266.46f},
    {-1115.17f, -1268.56f}, {1463.98f, -2163.99f}, {-3621.11f, 722.38f}, {3214.86f, -1165.23f},
    {2854.54f, -2360.54f}, {-1613.83f, 1059.15f}, {3900.07f, -1.04732e-06f}, {171.296f, 3648.69f},
    {-1067.13f, -133.398f}, {-995.137f, -1257.28f}, {584.441f, 3733.84f}, {-611.432f, -2481.71f},
    {-1725.97f, -2476.39f}, {-198.559f, 1266.46f}, {171.296f, -3648.69f}, {3863.89f, -2.28193e-06f}
};


void ver_armpl(armpl_singlecomplex_t *cov_arm) {
    armpl_int_t n = N;
    armpl_int_t kd = N - 1;
    armpl_int_t ldab = N;

    float w[N];
    armpl_singlecomplex_t z[N * N];


    armpl_int_t lwork = -1, lrwork = -1, liwork = -1, info;
    armpl_singlecomplex_t work_query;
    float rwork_query;

    chbevd_2stage_("V", "U", &n, &kd, cov_arm, &ldab, w, z, &n,
                   &work_query, &lwork, &rwork_query, &lrwork, NULL, &liwork, &info);

    if (info != 0) {
        // Handle error, such as logging or returning
        fprintf(stderr, "Error in workspace query: %d\n", info);
        return;
    }
}

int main() {
    ver_armpl(h_cov_arm);
    
    return 0;
}


Sorry, I can't paste the code with plugin. :(

  • Hi Weiwei,

    The option JOBZ = 'V' is not supported in the current version of the library, as specified in the ARM PL manual, with a copy below.
    Because you need the eigenvectors, you can use chbevd which support the option JOBZ = 'V'. 
    Also if the bandwidth of the matrix is not significantly smaller than the matrix dimension, it is better to use cheevd. 
     

    JOBZ
    Input parameter.
    
    JOBZ is CHARACTER*1
    
    = 'N': Compute eigenvalues only;
    
    = 'V': Compute eigenvalues and eigenvectors. Not available in this release.