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.

CMakeLists.txt 729 B

12345678910111213141516171819202122232425
  1. file (GLOB_RECURSE CUDA_STUB src/libcuda.cpp)
  2. file (GLOB_RECURSE NVRTC_STUB src/libnvrtc.cpp)
  3. if(MGE_WITH_CUDA_STUB)
  4. list(APPEND STUB_SRC ${CUDA_STUB})
  5. endif()
  6. if(MGE_WITH_NVRTC_STUB)
  7. list(APPEND STUB_SRC ${NVRTC_STUB})
  8. endif()
  9. if(MSVC OR WIN32)
  10. add_library (cuda-stub STATIC ${STUB_SRC})
  11. else()
  12. add_library (cuda-stub SHARED ${STUB_SRC})
  13. endif()
  14. set_target_properties(cuda-stub PROPERTIES OUTPUT_NAME cuda_stub)
  15. target_compile_definitions(cuda-stub PRIVATE __CUDA_API_VERSION_INTERNAL)
  16. if (MSVC OR WIN32)
  17. target_link_libraries(cuda-stub PRIVATE -Wl,--no-undefined)
  18. else()
  19. target_link_libraries(cuda-stub PRIVATE dl -Wl,--no-undefined)
  20. endif()
  21. install (TARGETS cuda-stub EXPORT ${MGE_EXPORT_TARGETS})

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