tvm icon indicating copy to clipboard operation
tvm copied to clipboard

Exports on Windows

Open alex-weaver opened this issue 8 years ago • 1 comments

The definition of EXPORT is as follows:

#if defined(_WIN32) && defined(Halide_SHARED)
#ifdef Halide_EXPORTS
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __declspec(dllimport)
#endif
#else
#define EXPORT
#endif

This means that clients linking to the library from C++ must define Halide_SHARED before including any TVM headers, otherwise EXPORT is defined as empty, instead of __declspec(dllimport). Is there any harm in just removing the && defined(Halide_SHARED) condition from this? Note that TVM_DLL does not require any extra preprocessor defines, but fulfills a similar role.

alex-weaver avatar Jan 29 '18 14:01 alex-weaver

Yes, we can remove that macro

tqchen avatar Jan 29 '18 16:01 tqchen