1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
#ifndef ULMBLAS_IMPL_LAPACK_LAENV_TCC
#define ULMBLAS_IMPL_LAPACK_LAENV_TCC 1

#include <cassert>
#include <cstring>
#include <ulmblas/impl/lapack/laenv.h>

namespace ulmBLAS {

template <typename T>
long
laenv(long        spec,
      const char  *name,
      const char  *opts,
      long        n1,
      long        n2,
      long        n3,
      long        n4)
{
    long result = -1;

    switch (spec) {
//
//      optimal blocksize
//
        case 1:
            result = 32;
            if (strcmp(name, "GETRF")==0) {
                result = 64;
            }
            break;

//
//      minimal blocksize
//
        case 2:
            result = 2;
            break;

//
//      crossover point
//
        case 3:
            result = 32;
            break;

//
//      DEPRECATED: number of shifts used in the nonsymmetric eigenvalue
//                  routines
//
        case 4:
            assert(0);
            break;
//
//      12 <= pec<= 16: hseqr or one of its subroutines ..
//
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
            break;

        default:
            assert(0);
            result = -1;
            break;

    }

    assert(result!=-1);
    return result;
}

// namespace ulmBLAS

#endif // ULMBLAS_IMPL_LAPACK_LAENV_TCC