Guest User

Untitled

a guest
Jul 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. template < typename type_elt >
  2. template < class T >
  3. INLINE
  4. Matrix< type_elt, host >&
  5. Matrix< type_elt, host >::operator =( T Expr ) throw() {
  6.  
  7. // #pragma omp parallel for
  8. for ( int i = 0; i < m_size; i++) {
  9. m_data[ i ] = GetBase< type_elt >( Expr, i );
  10. }
  11. return *this;
  12. }
  13.  
  14. #include <iostream>
  15. #include <cmath>
  16. #include "matrix.hpp"
  17. #include "clock.hpp"
  18.  
  19. #define TYPE int
  20. #define BIG (sqrt(947483646 / sizeof( TYPE )))
  21. #define SMALL 6
  22. #define IMG_SIZE 1920, 160
  23.  
  24. using namespace mat;
  25. using namespace std;
  26.  
  27.  
  28. int main(int argc, char** argv) {
  29. Matrix< TYPE, host > m1(BIG);
  30. Matrix< TYPE, host > m2(BIG);
  31. Matrix< TYPE, host > m3(BIG);
  32.  
  33. Clock c;
  34. m1.pMemset( 2 );
  35. m2.pMemset( 2 );
  36. m3 = m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2 + m1 + m2;
  37. cout << c << endl;
  38.  
  39. return 0;
  40. }
Add Comment
Please, Sign In to add comment