提交 f658a64b 编写于 作者: S Shiyuan Shang-Guan 提交者: Jinhui Yuan

refine ibverbs lib (#1391)

* refine link ibverbs lib

* modify minor


Former-commit-id: a7e61a6704b38ca2d4957ee699fd5962be1eac75
上级 604a9958
......@@ -50,27 +50,6 @@ else()
endif()
endif()
if (BUILD_RDMA)
if (UNIX)
include(CheckIncludeFiles)
include(CheckLibraryExists)
CHECK_INCLUDE_FILES(infiniband/verbs.h HAVE_VERBS_H)
CHECK_LIBRARY_EXISTS(ibverbs ibv_create_qp "" HAVE_IBVERBS)
if (HAVE_VERBS_H AND HAVE_IBVERBS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -libverbs")
add_definitions(-DWITH_RDMA)
elseif(HAVE_VERBS_H)
message(FATAL_ERROR "RDMA library not found")
elseif(HAVE_IBVERBS)
message(FATAL_ERROR "RDMA head file not found")
else()
message(FATAL_ERROR "RDMA library and head file not found")
endif()
else()
message(FATAL_ERROR "UNIMPLEMENTED")
endif()
endif()
set(THIRD_PARTY_DIR "${PROJECT_SOURCE_DIR}/third_party"
CACHE PATH "Where the third party headers and libs are put")
......
......@@ -142,4 +142,25 @@ if (BUILD_CUDA)
)
endif()
if(BUILD_RDMA)
if(UNIX)
include(CheckIncludeFiles)
include(CheckLibraryExists)
CHECK_INCLUDE_FILES(infiniband/verbs.h HAVE_VERBS_H)
CHECK_LIBRARY_EXISTS(ibverbs ibv_create_qp "" HAVE_IBVERBS)
if(HAVE_VERBS_H AND HAVE_IBVERBS)
list(APPEND oneflow_third_party_libs -libverbs)
add_definitions(-DWITH_RDMA)
elseif(HAVE_VERBS_H)
message(FATAL_ERROR "RDMA library not found")
elseif(HAVE_IBVERBS)
message(FATAL_ERROR "RDMA head file not found")
else()
message(FATAL_ERROR "RDMA library and head file not found")
endif()
else()
message(FATAL_ERROR "UNIMPLEMENTED")
endif()
endif()
message(STATUS "oneflow_third_party_libs: " ${oneflow_third_party_libs})
......@@ -17,7 +17,7 @@ class BoxingKernel final : public KernelIf<DeviceType::kCPU> {
void ForwardDataContent(const KernelCtx&,
std::function<Blob*(const std::string&)>) const override;
template<typename Iter>
void ForwardField(const KernelCtx&, std::function<Blob*(const std::string&)>) const override;
void ForwardField(const KernelCtx&, std::function<Blob*(const std::string&)>) const;
void ForwardDataId(const KernelCtx&, std::function<Blob*(const std::string&)>) const override;
void ForwardColNum(const KernelCtx&, std::function<Blob*(const std::string&)>) const override;
void SetColId(const KernelCtx&, std::function<Blob*(const std::string&)>) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册