A triangle counting assignment for A.U.TH Parallel and distributed systems class.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 4 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * \file v4.h
  3. * \brief v4 part of the exercise header file.
  4. *
  5. * \author
  6. * Christos Choutouridis AEM:8997
  7. * <cchoutou@ece.auth.gr>
  8. */
  9. #ifndef V4_H_
  10. #define V4_H_
  11. #include <iostream>
  12. #include <string>
  13. #include <mutex>
  14. #include <impl.hpp>
  15. #if defined CILK
  16. #include <cilk/cilk.h>
  17. #include <cilk/cilk_api.h>
  18. #include <cilk/reducer_opadd.h>
  19. #elif defined OMP
  20. #include <omp.h>
  21. #elif defined THREADS
  22. #include <thread>
  23. #include <numeric>
  24. #include <random>
  25. #else
  26. #endif
  27. namespace v4 {
  28. //! Select a data representation suited for V3.
  29. using matrix = SpMat<int, int>;
  30. using index_t = typename matrix::indexType; //!< syntactic sugar alias for index type
  31. using value_t = typename matrix::dataType; //!< syntactic sugar alias for value type
  32. /*
  33. * Common api for all the versions
  34. */
  35. int nworkers();
  36. std::vector<value_t> triang_v(matrix& A);
  37. value_t triang_count (std::vector<value_t>& c);
  38. };
  39. #endif /* V4_H_ */