Skip to content

Commit eb3f85f

Browse files
committed
common/cuda: Move opal_datatype_cuda functionality into common cuda
Signed-off-by: William Zhang <[email protected]>
1 parent 8e2c32e commit eb3f85f

23 files changed

+310
-338
lines changed

config/opal_check_cuda.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ AC_MSG_CHECKING([if have cuda support])
117117
if test "$opal_check_cuda_happy" = "yes"; then
118118
AC_MSG_RESULT([yes (-I$opal_cuda_incdir)])
119119
CUDA_SUPPORT=1
120-
opal_datatype_cuda_CPPFLAGS="-I$opal_cuda_incdir"
121-
AC_SUBST([opal_datatype_cuda_CPPFLAGS])
120+
common_cuda_CPPFLAGS="-I$opal_cuda_incdir"
121+
AC_SUBST([common_cuda_CPPFLAGS])
122122
else
123123
AC_MSG_RESULT([no])
124124
CUDA_SUPPORT=0

ompi/mca/coll/cuda/coll_cuda_allreduce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ompi/op/op.h"
1919
#include "opal/datatype/opal_convertor.h"
20-
#include "opal/datatype/opal_datatype_cuda.h"
20+
#include "opal/mca/common/cuda/common_cuda.h"
2121

2222
/*
2323
* allreduce_intra

ompi/mca/coll/cuda/coll_cuda_exscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ompi/op/op.h"
1919
#include "opal/datatype/opal_convertor.h"
20-
#include "opal/datatype/opal_datatype_cuda.h"
20+
#include "opal/mca/common/cuda/common_cuda.h"
2121

2222
int mca_coll_cuda_exscan(const void *sbuf, void *rbuf, int count,
2323
struct ompi_datatype_t *dtype,

ompi/mca/coll/cuda/coll_cuda_reduce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ompi/op/op.h"
1919
#include "opal/datatype/opal_convertor.h"
20-
#include "opal/datatype/opal_datatype_cuda.h"
20+
#include "opal/mca/common/cuda/common_cuda.h"
2121

2222
/*
2323
* reduce_log_inter

ompi/mca/coll/cuda/coll_cuda_reduce_scatter_block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ompi/op/op.h"
1919
#include "opal/datatype/opal_convertor.h"
20-
#include "opal/datatype/opal_datatype_cuda.h"
20+
#include "opal/mca/common/cuda/common_cuda.h"
2121

2222
/*
2323
* reduce_scatter_block

ompi/mca/coll/cuda/coll_cuda_scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "ompi/op/op.h"
1919
#include "opal/datatype/opal_convertor.h"
20-
#include "opal/datatype/opal_datatype_cuda.h"
20+
#include "opal/mca/common/cuda/common_cuda.h"
2121

2222
/*
2323
* scan

ompi/mca/coll/libnbc/nbc_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "coll_libnbc.h"
3232
#if OPAL_CUDA_SUPPORT
3333
#include "opal/datatype/opal_convertor.h"
34-
#include "opal/datatype/opal_datatype_cuda.h"
34+
#include "opal/mca/common/cuda/common_cuda.h"
3535
#endif /* OPAL_CUDA_SUPPORT */
3636
#include "ompi/include/ompi/constants.h"
3737
#include "ompi/request/request.h"

ompi/mca/common/ompio/common_ompio_buffer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "ompi_config.h"
2121

2222
#include "opal/datatype/opal_convertor.h"
23-
#include "opal/datatype/opal_datatype_cuda.h"
2423
#include "opal/mca/common/cuda/common_cuda.h"
2524
#include "opal/util/sys_limits.h"
2625

ompi/mca/mtl/base/mtl_base_datatype.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#if OPAL_CUDA_SUPPORT
2929
#include "opal/mca/common/cuda/common_cuda.h"
3030
#include "opal/datatype/opal_convertor.h"
31-
#include "opal/datatype/opal_datatype_cuda.h"
3231
#endif
3332

3433
#ifndef MTL_BASE_DATATYPE_H_INCLUDED

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#if OPAL_CUDA_SUPPORT
5151
#include "opal/mca/common/cuda/common_cuda.h"
5252
#include "opal/datatype/opal_convertor.h"
53-
#include "opal/datatype/opal_datatype_cuda.h"
5453
#endif
5554

5655
BEGIN_C_DECLS

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include "opal/align.h"
5252
#include "opal/util/sys_limits.h"
5353
#if OPAL_CUDA_SUPPORT
54-
#include "opal/datatype/opal_datatype_cuda.h"
54+
#include "opal/mca/common/cuda/common_cuda.h"
5555
#endif /* OPAL_CUDA_SUPPORT */
5656
#include "opal/util/info_subscriber.h"
5757

ompi/mca/pml/ob1/pml_ob1_recvfrag.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include "pml_ob1_sendreq.h"
5151
#include "pml_ob1_hdr.h"
5252
#if OPAL_CUDA_SUPPORT
53-
#include "opal/datatype/opal_datatype_cuda.h"
5453
#include "opal/mca/common/cuda/common_cuda.h"
5554
#endif /* OPAL_CUDA_SUPPORT */
5655

ompi/mca/pml/ob1/pml_ob1_recvreq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "ompi/mca/bml/base/base.h"
4444

4545
#if OPAL_CUDA_SUPPORT
46-
#include "opal/datatype/opal_datatype_cuda.h"
4746
#include "opal/mca/common/cuda/common_cuda.h"
4847
#endif /* OPAL_CUDA_SUPPORT */
4948

opal/Makefile.am

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
# $HEADER$
2323
#
2424

25+
if OPAL_cuda_support
2526
SUBDIRS = \
2627
include \
28+
mca/common/cuda \
2729
datatype \
2830
etc \
2931
util \
@@ -32,6 +34,18 @@ SUBDIRS = \
3234
$(MCA_opal_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
3335
. \
3436
$(MCA_opal_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
37+
else
38+
SUBDIRS = \
39+
include \
40+
datatype \
41+
etc \
42+
util \
43+
mca/base \
44+
$(MCA_opal_FRAMEWORKS_SUBDIRS) \
45+
$(MCA_opal_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
46+
. \
47+
$(MCA_opal_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
48+
endif
3549

3650
# libltdl is included by variable because if --disable-dlopen was
3751
# used, there will be no generated Makefile in that directory (and
@@ -46,7 +60,6 @@ DIST_SUBDIRS = \
4660
$(MCA_opal_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
4761

4862
# Build the main OPAL library
49-
5063
lib_LTLIBRARIES = lib@[email protected]
5164
lib@OPAL_LIB_PREFIX@open_pal_la_SOURCES =
5265
lib@OPAL_LIB_PREFIX@open_pal_la_LIBADD = \
@@ -62,6 +75,12 @@ lib@OPAL_LIB_PREFIX@open_pal_la_DEPENDENCIES = \
6275
mca/base/libmca_base.la \
6376
util/libopalutil.la \
6477
$(MCA_opal_FRAMEWORK_LIBS)
78+
if OPAL_cuda_support
79+
lib@OPAL_LIB_PREFIX@open_pal_la_LIBADD += \
80+
mca/common/cuda/libmca_common_cuda.la
81+
lib@OPAL_LIB_PREFIX@open_pal_la_DEPENDENCIES += \
82+
mca/common/cuda/libmca_common_cuda.la
83+
endi
6584
lib@OPAL_LIB_PREFIX@open_pal_la_LDFLAGS = -version-info $(libopen_pal_so_version) \
6685
$(opal_libevent_LDFLAGS) \
6786
$(opal_hwloc_LDFLAGS) \

opal/datatype/Makefile.am

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,3 @@ opaldir = $(opalincludedir)/$(subdir)
7878
opal_HEADERS = $(headers)
7979
endif
8080

81-
# If we have cuda support, modify file list and flags
82-
if OPAL_cuda_support
83-
libdatatype_la_SOURCES += opal_datatype_cuda.c
84-
headers += opal_datatype_cuda.h
85-
endif

opal/datatype/opal_convertor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "opal/datatype/opal_datatype_prototypes.h"
4040
#include "opal/datatype/opal_convertor_internal.h"
4141
#if OPAL_CUDA_SUPPORT
42-
#include "opal/datatype/opal_datatype_cuda.h"
42+
#include "opal/mca/common/cuda/common_cuda.h"
4343
#define MEMCPY_CUDA( DST, SRC, BLENGTH, CONVERTOR ) \
4444
CONVERTOR->cbmemcpy( (DST), (SRC), (BLENGTH), (CONVERTOR) )
4545
#endif

opal/datatype/opal_datatype_copy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static size_t opal_datatype_memop_block_size = 128 * 1024;
7272
#include "opal_datatype_copy.h"
7373

7474
#if OPAL_CUDA_SUPPORT
75-
#include "opal_datatype_cuda.h"
75+
#include "opal/mca/common/cuda/common_cuda.h"
7676

7777
#undef MEM_OP_NAME
7878
#define MEM_OP_NAME non_overlap_cuda

0 commit comments

Comments
 (0)