Skip to content

Commit eca4563

Browse files
authored
operators module (#12938)
1 parent a4ffdf3 commit eca4563

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function(op_library TARGET)
8585

8686
#remove windows unsupported op
8787
if (WIN32)
88-
foreach(windows_unsupport_op "nccl_op" "gen_nccl_id_op")
88+
foreach(windows_unsupport_op "nccl_op" "gen_nccl_id_op" "warpctc_op")
8989
if ("${TARGET}" STREQUAL "${windows_unsupport_op}")
9090
return()
9191
endif()
@@ -319,8 +319,9 @@ foreach(src ${GENERAL_OPS})
319319
endforeach()
320320

321321
file(APPEND ${pybind_file} "USE_OP(less_than);\nUSE_OP(logical_and);\nUSE_NO_KERNEL_OP(read_from_array);\n")
322-
322+
if (NOT WIN32)
323323
add_subdirectory(reader)
324+
endif(NOT WIN32)
324325
foreach(src ${READER_LIBRARY})
325326
set(OP_LIBRARY ${src} ${OP_LIBRARY})
326327
endforeach()

paddle/fluid/operators/math/math_function.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ limitations under the License. */
1919

2020
#ifdef PADDLE_USE_OPENBLAS
2121
#include <cblas.h>
22+
// remove typedef in openblas
23+
#undef FLOAT
24+
#undef INT
25+
#undef SIZE
2226
#endif
2327

2428
#include <cmath>

paddle/fluid/platform/float16.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ limitations under the License. */
5656
#include <immintrin.h>
5757
#endif // PADDLE_ARM
5858

59+
#if !defined(_WIN32)
5960
#define PADDLE_ALIGN(x) __attribute__((aligned(x)))
61+
#else
62+
#define PADDLE_ALIGN(x) /*do nothing*/
63+
#endif
6064

6165
namespace paddle {
6266
namespace platform {

paddle/fluid/pybind/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
set(PYBIND_DEPS pybind python proto_desc memory executor prune profiler feed_fetch_method
2-
)
1+
2+
set(PYBIND_DEPS pybind python proto_desc memory executor prune feed_fetch_method)
3+
set(PYBIND_SRCS pybind.cc exception.cc protobuf.cc const_value.cc)
34
if(NOT WIN32)
4-
list(APPEND PYBIND_DEPS parallel_executor)
5+
list(APPEND PYBIND_DEPS parallel_executor profiler)
6+
list(APPEND PYBIND_SRCS recordio.cc)
57
endif()
68
if(WITH_PYTHON)
79
if(WITH_AMD_GPU)
810
hip_library(paddle_pybind SHARED
9-
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
11+
SRCS ${PYBIND_SRCS}
1012
DEPS ${PYBIND_DEPS}
1113
${GLOB_OP_LIB})
1214
else()
1315
cc_library(paddle_pybind SHARED
14-
SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc
16+
SRCS ${PYBIND_SRCS}
1517
DEPS ${PYBIND_DEPS}
1618
${GLOB_OP_LIB})
1719
if(NOT APPLE AND NOT ANDROID AND NOT WIN32)

0 commit comments

Comments
 (0)