pvfmm_common.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. //#ifndef NDEBUG
  16. //#define NDEBUG
  17. //#endif
  18. //Enable profiling
  19. #define __PROFILE__ 5
  20. //Verbose
  21. #define __VERBOSE__
  22. #define MAX_DEPTH 15
  23. #define BC_LEVELS 15
  24. #define RAD0 1.05 //Radius of upward equivalent (downward check) surface.
  25. #define RAD1 2.95 //Radius of downward equivalent (upward check) surface.
  26. #define COORD_DIM 3
  27. #define COLLEAGUE_COUNT 27 // 3^COORD_DIM
  28. #define MEM_ALIGN 64
  29. #define DEVICE_BUFFER_SIZE 1024LL //in MB
  30. #define V_BLK_CACHE 25 //in KB
  31. #define GLOBAL_MEM_BUFF 1024LL*0LL //in MB
  32. #ifndef __DEVICE_SYNC__
  33. #define __DEVICE_SYNC__ 0 // No device synchronization by default.
  34. #endif
  35. #define UNUSED(x) (void)(x) // to ignore unused variable warning.
  36. #ifndef NDEBUG
  37. #include <cassert>
  38. #include <iostream>
  39. #define ASSERT_WITH_MSG(cond, msg) do \
  40. { if (!(cond)) { std::cerr<<"Error: "<<msg<<'\n'; assert(cond); } \
  41. } while(0)
  42. #else
  43. #define ASSERT_WITH_MSG(cond, msg)
  44. #endif
  45. #include <stacktrace.h>
  46. #ifdef __INTEL_OFFLOAD
  47. #pragma offload_attribute(push,target(mic))
  48. #endif
  49. template <class T>
  50. inline T const_pi(){return 3.1415926535897932384626433832795028841;}
  51. template <class T>
  52. inline T const_e (){return 2.7182818284590452353602874713526624977;}
  53. #ifdef __INTEL_OFFLOAD
  54. #pragma offload_attribute(pop)
  55. #endif
  56. #include <quad_utils.hpp>
  57. #endif //_PVFMM_COMMON_HPP_