Advertisement
Guest User

Ubuntu 20.04 Lapacke 3.9.0 Stuck Bug

a guest
Apr 26th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <lapacke.h>
  2. #include <vector>
  3. #include <assert.h>
  4. #include <iostream>
  5. #include <random>
  6.  
  7. int main()
  8. {
  9.   lapack_int vers_major,
  10.              vers_minor,
  11.              vers_patch;
  12.  
  13.   LAPACK_ilaver(
  14.     &vers_major,
  15.     &vers_minor,
  16.     &vers_patch
  17.   );
  18.  
  19.   std::cout << "LAPACKE_VERSION: " << vers_major << "." << vers_minor << "." << vers_patch << std::endl;
  20.  
  21.   constexpr ptrdiff_t N = 40;
  22.  
  23.   std::vector<double> B;
  24.  
  25.   std::mt19937 rng(1337);
  26.   std::uniform_real_distribution<double> randFloat(-1,+1);
  27.  
  28.   for( ptrdiff_t i=N*N; i-- > 0; )
  29.     B.push_back( randFloat(rng) );
  30.  
  31.   std::vector<double> U = B,
  32.                       V = B,
  33.                       S(N, 0);
  34.  
  35.   std::cout << "running..." << std::flush;
  36.  
  37.   lapack_int info = LAPACKE_dgesdd(
  38.     LAPACK_COL_MAJOR, 'A', N,N,
  39.     &B[0], N, &S[0],
  40.     &U[0], N,
  41.     &V[0], N
  42.   );
  43.  
  44.   assert( 0 == info );
  45.   std::cout << " done!" << std::endl;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement