diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 3e9114a35d0f03d646e4f667c02cae0619f76ffa..85ae5173b716c440f4590dd538c2ea671ab702cf 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -28,7 +28,14 @@ include(ExternalProject) set(CINN_SOURCE_DIR ${THIRD_PARTY_PATH}/CINN) # TODO(zhhsplendid): Modify git tag after we have release tag 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) ExternalProject_Add( external_cinn diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index 8b3c17ae3dbb2be9650f8d173b0f23f6ca2f0f1d..f2efc974073e59d9f05113523ccf4d663fb91f81 100644 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -364,6 +364,14 @@ if (WITH_CINN) message(STATUS "Compile Paddle with CINN.") include(external/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) if (WITH_CRYPTO)