pvfmm_common.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 1024LL //in MB
  28. #define V_BLK_CACHE 25 //in KB
  29. #define GLOBAL_MEM_BUFF 1024LL*10LL //in MB
  30. #ifndef __DEVICE_SYNC__
  31. #define __DEVICE_SYNC__ 0 // No device synchronization by default.
  32. #endif
  33. #define UNUSED(x) (void)(x) // to ignore unused variable warning.
  34. #ifndef NDEBUG
  35. #include <cassert>
  36. #include <iostream>
  37. #define ASSERT_WITH_MSG(cond, msg) do \
  38. { if (!(cond)) { std::cerr<<"Error: "<<msg<<'\n'; assert(cond); } \
  39. } while(0)
  40. #else
  41. #define ASSERT_WITH_MSG(cond, msg)
  42. #endif
  43. #include <stacktrace.h>
  44. #ifdef __INTEL_OFFLOAD
  45. #pragma offload_attribute(push,target(mic))
  46. #endif
  47. template <class T>
  48. inline T const_pi(){return 3.1415926535897932384626433832795028841;}
  49. template <class T>
  50. inline T const_e (){return 2.7182818284590452353602874713526624977;}
  51. #ifdef __INTEL_OFFLOAD
  52. #pragma offload_attribute(pop)
  53. #endif
  54. #include <quad_utils.hpp>
  55. #endif //_PVFMM_COMMON_HPP_