pvfmm_common.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. //Disable assert checks.
  15. //#define NDEBUG
  16. //Enable profiling
  17. #define __PROFILE__ 5
  18. //Verbose
  19. #define __VERBOSE__
  20. #define MAX_DEPTH 15
  21. #define BC_LEVELS 15
  22. #define RAD0 1.05 //Radius of upward equivalent (downward check) surface.
  23. #define RAD1 2.95 //Radius of downward equivalent (upward check) surface.
  24. #define COORD_DIM 3
  25. #define COLLEAGUE_COUNT 27 // 3^COORD_DIM
  26. #define MEM_ALIGN 64
  27. #define DEVICE_BUFFER_SIZE 1024 //in MB
  28. #define V_BLK_CACHE 25 //in KB
  29. #define UNUSED(x) (void)(x) // to ignore unused variable warning.
  30. #include <cstdlib>
  31. #include <cassert>
  32. #ifndef NDEBUG
  33. #define ASSERT_WITH_MSG(cond, msg) do \
  34. { if (!(cond)) { std::cerr<<"Error: "<<msg<<'\n'; assert(cond); } \
  35. } while(0)
  36. #else
  37. #define ASSERT_WITH_MSG(cond, msg)
  38. #endif
  39. template <class T>
  40. inline T const_pi(){return 3.1415926535897932384626433832795028841;}
  41. #include <quad_utils.hpp>
  42. #endif //_PVFMM_COMMON_HPP_