You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

megbrain_build_config.h.in 3.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /**
  2. * \file src/core/include/megbrain_build_config.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
  6. *
  7. * Unless required by applicable law or agreed to in writing,
  8. * software distributed under the License is distributed on an
  9. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. */
  11. #ifndef _HEADER_MGB_BUILD_CONFIG
  12. #define _HEADER_MGB_BUILD_CONFIG
  13. #cmakedefine01 MGB_CUDA
  14. #cmakedefine01 MGB_ASSERT_LOC
  15. #cmakedefine01 MGB_ENABLE_DEBUG_UTIL
  16. #cmakedefine01 MGB_ENABLE_LOGGING
  17. #cmakedefine01 MGB_ENABLE_GRAD
  18. #cmakedefine01 MGB_VERBOSE_TYPEINFO_NAME
  19. #cmakedefine01 MGB_BUILD_SLIM_SERVING
  20. #cmakedefine01 MGB_ENABLE_EXCEPTION
  21. #cmakedefine01 MGB_JIT
  22. #cmakedefine01 MGB_JIT_HALIDE
  23. #cmakedefine01 MGB_ENABLE_TENSOR_RT
  24. #cmakedefine01 MGB_ENABLE_JSON
  25. #cmakedefine01 MGB_HAVE_THREAD
  26. #cmakedefine01 MGB_ENABLE_OPR_MM
  27. // whether cuda is available
  28. #ifndef MGB_CUDA
  29. #define MGB_CUDA 1
  30. #endif
  31. // whether to include file/line location for assert message
  32. #ifndef MGB_ASSERT_LOC
  33. #define MGB_ASSERT_LOC 1
  34. #endif
  35. // whether to enable utils/debug.h and other debug methods
  36. #ifndef MGB_ENABLE_DEBUG_UTIL
  37. #define MGB_ENABLE_DEBUG_UTIL 1
  38. #endif
  39. // whether to enable logging
  40. #ifndef MGB_ENABLE_LOGGING
  41. #define MGB_ENABLE_LOGGING 1
  42. #endif
  43. // whether to enable registering opr grad functions
  44. #ifndef MGB_ENABLE_GRAD
  45. #define MGB_ENABLE_GRAD 1
  46. #endif
  47. // whether to include actual class name in mgb::Typeinfo object; if this is
  48. // disabled, mgb::serialization::OprRegistry::find_opr_by_name would not work.
  49. #ifndef MGB_VERBOSE_TYPEINFO_NAME
  50. #define MGB_VERBOSE_TYPEINFO_NAME 1
  51. #endif
  52. // whether to enbale configuing megbrain internals through env vars
  53. #ifndef MGB_ENABLE_GETENV
  54. #define MGB_ENABLE_GETENV 1
  55. #endif
  56. // whether to remove unnecessary features when used for serving
  57. #ifndef MGB_BUILD_SLIM_SERVING
  58. #define MGB_BUILD_SLIM_SERVING 0
  59. #endif
  60. // whether to enable exception
  61. #ifndef MGB_ENABLE_EXCEPTION
  62. #if __EXCEPTIONS
  63. #define MGB_ENABLE_EXCEPTION 1
  64. #else
  65. #define MGB_ENABLE_EXCEPTION 0
  66. #endif
  67. #endif
  68. // whether <thread> is available and usable
  69. #ifndef MGB_HAVE_THREAD
  70. #define MGB_HAVE_THREAD 1
  71. #endif
  72. // whether to trade thread safety for memory usage
  73. #ifndef MGB_THREAD_SAFE
  74. #define MGB_THREAD_SAFE MGB_HAVE_THREAD
  75. #endif
  76. // whether to enable JIT
  77. #ifndef MGB_JIT
  78. #define MGB_JIT 1
  79. #endif
  80. #ifndef MGB_JIT_HALIDE
  81. #define MGB_JIT_HALIDE 0
  82. #endif
  83. // whether to enable TensorRT support
  84. #ifndef MGB_ENABLE_TENSOR_RT
  85. #define MGB_ENABLE_TENSOR_RT MGB_CUDA
  86. #endif
  87. // whether to enable fastrun profile
  88. #ifndef MGB_ENABLE_FASTRUN
  89. #define MGB_ENABLE_FASTRUN 1
  90. #endif
  91. /* ================= following are more finegrind controls ================= */
  92. // whether to enable json dumper
  93. #ifndef MGB_ENABLE_JSON
  94. #define MGB_ENABLE_JSON !MGB_BUILD_SLIM_SERVING
  95. #endif
  96. // whether to enable distributed communication
  97. #ifndef MGB_ENABLE_OPR_MM
  98. #define MGB_ENABLE_OPR_MM 0
  99. #endif
  100. #endif // _HEADER_MGB_BUILD_CONFIG

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台