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.

cpuinfo.cmake 912 B

1234567891011121314151617181920
  1. if (MGE_USE_SYSTEM_LIB)
  2. find_package(Cpuinfo)
  3. message("Using system provided cpuinfo ${cpuinfo_VERSION}")
  4. add_library(libcpuinfo IMPORTED GLOBAL)
  5. set_target_properties(
  6. libcpuinfo PROPERTIES
  7. IMPORTED_LOCATION ${cpuinfo_LIBRARIES}
  8. INTERFACE_INCLUDE_DIRECTORIES ${cpuinfo_INCLUDE_DIRS}
  9. )
  10. return()
  11. endif()
  12. SET(CPUINFO_LIBRARY_TYPE "static" CACHE STRING "Type of cpuinfo library (shared, static, or default) to build")
  13. OPTION(CPUINFO_BUILD_TOOLS "Build command-line tools" OFF)
  14. OPTION(CPUINFO_BUILD_UNIT_TESTS "Build cpuinfo unit tests" OFF)
  15. OPTION(CPUINFO_BUILD_MOCK_TESTS "Build cpuinfo mock tests" OFF)
  16. OPTION(CPUINFO_BUILD_BENCHMARKS "Build cpuinfo micro-benchmarks" OFF)
  17. include_directories("${PROJECT_SOURCE_DIR}/third_party/cpuinfo/include")
  18. add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/cpuinfo ${CMAKE_CURRENT_BINARY_DIR}/cpuinfo EXCLUDE_FROM_ALL)

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