From 7d0f29debe732700a75e56846a3d3ba98daeeed4 Mon Sep 17 00:00:00 2001 From: Chuntao Hong Date: Thu, 22 Oct 2015 10:42:16 +0800 Subject: [PATCH 1/3] fix windows linkage problem by adding dllexport --- include/mxnet/base.h | 13 +++++++++++++ include/mxnet/engine.h | 2 +- include/mxnet/storage.h | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/mxnet/base.h b/include/mxnet/base.h index 1ef9c6bf8450..b3ee2242d182 100644 --- a/include/mxnet/base.h +++ b/include/mxnet/base.h @@ -49,6 +49,19 @@ #endif #endif +/*! +* \brief define dllexport for Visual Studio +*/ +#ifdef _MSC_VER +#ifdef MXNET_EXPORTS +#define MXAPI __declspec(dllexport) +#else +#define MXAPI __declspec(dllimport) +#endif +#else +#define MXAPI +#endif + /*! \brief namespace of mxnet */ namespace mxnet { /*! \brief mxnet cpu */ diff --git a/include/mxnet/engine.h b/include/mxnet/engine.h index 03eb45b54de0..9b879ef3b4c2 100644 --- a/include/mxnet/engine.h +++ b/include/mxnet/engine.h @@ -45,7 +45,7 @@ enum class FnProperty { /*! * \brief Dependency engine that schedules operations. */ -class Engine { +class MXAPI Engine { public: /*! * \brief OnComplete Callback to the engine, diff --git a/include/mxnet/storage.h b/include/mxnet/storage.h index da7a8aaa5388..743b4e8b0514 100644 --- a/include/mxnet/storage.h +++ b/include/mxnet/storage.h @@ -14,7 +14,7 @@ namespace mxnet { /*! * \brief Storage manager across multiple devices. */ -class Storage { + class MXAPI Storage { public: /*! * \brief Storage handle. From 3ec9344d2ec865a7f9b83b5cbca73b881d128843 Mon Sep 17 00:00:00 2001 From: Chuntao Hong Date: Thu, 22 Oct 2015 11:27:35 +0800 Subject: [PATCH 2/3] change MXAPI to MXNET_API --- include/mxnet/base.h | 4 ++-- include/mxnet/engine.h | 2 +- include/mxnet/storage.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mxnet/base.h b/include/mxnet/base.h index b3ee2242d182..962740b4194d 100644 --- a/include/mxnet/base.h +++ b/include/mxnet/base.h @@ -54,9 +54,9 @@ */ #ifdef _MSC_VER #ifdef MXNET_EXPORTS -#define MXAPI __declspec(dllexport) +#define MXNET_API __declspec(dllexport) #else -#define MXAPI __declspec(dllimport) +#define MXNET_API __declspec(dllimport) #endif #else #define MXAPI diff --git a/include/mxnet/engine.h b/include/mxnet/engine.h index 9b879ef3b4c2..195f5c05eb20 100644 --- a/include/mxnet/engine.h +++ b/include/mxnet/engine.h @@ -45,7 +45,7 @@ enum class FnProperty { /*! * \brief Dependency engine that schedules operations. */ -class MXAPI Engine { +class MXNET_API Engine { public: /*! * \brief OnComplete Callback to the engine, diff --git a/include/mxnet/storage.h b/include/mxnet/storage.h index 743b4e8b0514..60bca03b0680 100644 --- a/include/mxnet/storage.h +++ b/include/mxnet/storage.h @@ -14,7 +14,7 @@ namespace mxnet { /*! * \brief Storage manager across multiple devices. */ - class MXAPI Storage { +class MXNET_API Storage { public: /*! * \brief Storage handle. From 89dda75a3e6f7187ded2b33064800e49a97d10a4 Mon Sep 17 00:00:00 2001 From: Chuntao Hong Date: Thu, 22 Oct 2015 13:11:39 +0800 Subject: [PATCH 3/3] minor --- include/mxnet/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mxnet/base.h b/include/mxnet/base.h index 962740b4194d..1eeffc1ab4b9 100644 --- a/include/mxnet/base.h +++ b/include/mxnet/base.h @@ -59,7 +59,7 @@ #define MXNET_API __declspec(dllimport) #endif #else -#define MXAPI +#define MXNET_API #endif /*! \brief namespace of mxnet */