pvfmm_common.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * \file pvfmm_common.hpp
  3. * \author Dhairya Malhotra, dhairya.malhotra@gmail.com
  4. * \date 12-10-2010
  5. * \brief This file contains common definitions.
  6. */
  7. #include "pvfmm_config.h"
  8. #ifndef _PVFMM_COMMON_HPP_
  9. #define _PVFMM_COMMON_HPP_
  10. //Define NULL
  11. #ifndef NULL
  12. #define NULL 0
  13. #endif
  14. //#define LAZY_MAT_COMP //TODO: Implement this.
  15. //Disable assert checks.
  16. //#define NDEBUG
  17. //Enable profiling
  18. #define __PROFILE__ 5
  19. //Verbose
  20. #define __VERBOSE__
  21. #define MAX_DEPTH 15
  22. #define BC_LEVELS 15
  23. #define RAD0 1.05 //Radius of upward equivalent (downward check) surface.
  24. #define RAD1 2.95 //Radius of downward equivalent (upward check) surface.
  25. #define COORD_DIM 3
  26. #define COLLEAGUE_COUNT 27 // 3^COORD_DIM
  27. #define MEM_ALIGN 64
  28. #define DEVICE_BUFFER_SIZE 1024 //in MB
  29. #define V_BLK_SIZE 256
  30. #define UNUSED(x) (void)(x) // to ignore unused variable warning.
  31. #include <cstdlib>
  32. #include <cassert>
  33. #ifndef NDEBUG
  34. #define ASSERT_WITH_MSG(cond, msg) do \
  35. { if (!(cond)) { std::cerr<<"Error: "<<msg<<'\n'; assert(cond); } \
  36. } while(0)
  37. #else
  38. #define ASSERT_WITH_MSG(cond, msg)
  39. #endif
  40. #endif //_PVFMM_COMMON_HPP_