未验证 提交 9a9345fa 编写于 作者: Z Zhen Wang 提交者: GitHub

Add macro required by CINN. (#37066)

* Add macro required by CINN.

* Remove CMAKE_BUILD_TYPE form cinn.cmake.
上级 a2da1efa
...@@ -28,7 +28,14 @@ include(ExternalProject) ...@@ -28,7 +28,14 @@ include(ExternalProject)
set(CINN_SOURCE_DIR ${THIRD_PARTY_PATH}/CINN) set(CINN_SOURCE_DIR ${THIRD_PARTY_PATH}/CINN)
# TODO(zhhsplendid): Modify git tag after we have release tag # TODO(zhhsplendid): Modify git tag after we have release tag
set(CINN_GIT_TAG develop) set(CINN_GIT_TAG develop)
set(CINN_OPTIONAL_ARGS -DPY_VERSION=${PY_VERSION} -DWITH_CUDA=${WITH_GPU} -DWITH_CUDNN=${WITH_GPU} -DPUBLISH_LIBS=ON -DWITH_TESTING=ON) set(CINN_OPTIONAL_ARGS -DPY_VERSION=${PY_VERSION}
-DWITH_CUDA=${WITH_GPU}
-DWITH_CUDNN=${WITH_GPU}
-DWITH_MKL_CBLAS=${WITH_MKL}
-DWITH_MKLDNN=${WITH_MKL}
-DPUBLISH_LIBS=ON
-DWITH_TESTING=ON
)
set(CINN_BUILD_COMMAND $(MAKE) cinnapi -j) set(CINN_BUILD_COMMAND $(MAKE) cinnapi -j)
ExternalProject_Add( ExternalProject_Add(
external_cinn external_cinn
......
...@@ -364,6 +364,14 @@ if (WITH_CINN) ...@@ -364,6 +364,14 @@ if (WITH_CINN)
message(STATUS "Compile Paddle with CINN.") message(STATUS "Compile Paddle with CINN.")
include(external/cinn) include(external/cinn)
add_definitions(-DPADDLE_WITH_CINN) add_definitions(-DPADDLE_WITH_CINN)
if (WITH_GPU)
add_definitions(-DCINN_WITH_CUDA)
add_definitions(-DCINN_WITH_CUDNN)
endif (WITH_GPU)
if (WITH_MKL)
add_definitions(-DCINN_WITH_MKL_CBLAS)
add_definitions(-DCINN_WITH_MKLDNN)
endif (WITH_MKL)
endif (WITH_CINN) endif (WITH_CINN)
if (WITH_CRYPTO) if (WITH_CRYPTO)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册