spir_test.cpp 556 B

123456789101112131415161718192021222324
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include "spir.hpp"
  4. int main(int argc, char **argv)
  5. {
  6. if (argc < 2 || argc > 4) {
  7. std::cerr << "Usage: " << argv[0] << " r [num_threads [num_pirs]]\n";
  8. std::cerr << "r = log_2(num_records)\n";
  9. exit(1);
  10. }
  11. uint32_t r, num_threads = 1, num_pirs = 1;
  12. r = strtoul(argv[1], NULL, 10);
  13. if (argc > 2) {
  14. num_threads = strtoul(argv[2], NULL, 10);
  15. }
  16. if (argc > 3) {
  17. num_pirs = strtoul(argv[3], NULL, 10);
  18. }
  19. SPIR::init(num_threads);
  20. return 0;
  21. }