-
Notifications
You must be signed in to change notification settings - Fork 98
BLAS 1::nrminf
Jennifer Loe edited this page May 8, 2020
·
1 revision
Header File: KokkosBlas1_nrminf.hpp
Usage: nrm = KokkosBlas::nrminf(x);
KokkosBlas::nrminf(r,x);
Computes the max of all absolute values of x
.
template<class VectorX, class VectorY>
InnerProductSpaceTraits<VectorX::non_const_value_type>::mag_type
nrminf (const VectorX& X);
- VectorX: A rank-1
Kokkos::View
X.rank == 1
template<class ReturnVector, class VectorX>
void nrminf (const ReturnVector& R, const VectorX& X);
- ReturnVector: A rank-0 or rank-1
Kokkos::View
- VectorX: A rank-1 or rank-2
Kokkos::View
X.rank == R.rank + 1
R.extent(0) == X.extent(1)
ReturnVector::non_const_value_type == ReturnVector::value_type
#include<Kokkos_Core.hpp>
#include<KokkosBlas1_nrminf.hpp>
int main(int argc, char* argv[]) {
Kokkos::initialize();
int N = atoi(argv[1]);
Kokkos::View<double*> x("X",N);
Kokkos::deep_copy(x,3.0);
Kokkos::View<double> x_5(x,5);
Kokkos::deep_copy(x,-7.5);
double x_nrm = KokkosBlas::nrminf(x);
printf("X_nrm: %lf Expected: %lf Diff: %e\n",x_nrm,7.5,x_nrm-7.5);
Kokkos::finalize();
}