1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
#ifndef HPC_MATVEC_IAMAX_H
#define HPC_MATVEC_IAMAX_H 1

#include <cassert>
#include <type_traits>
#include <hpc/ulmblas/iamax.h>
#include <hpc/matvec/isdensevector.h>

namespace hpc { namespace matvec {

template <typename VX>
typename std::enable_if<IsDenseVector<VX>::value,
         typename VX::Index>::type
iamax(const VX &x)
{
    return ulmblas::iamax(x.length, x.data, x.inc);
}

} } // namespace matvec, hpc

#endif // HPC_MATVEC_IAMAX_H