diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clblast.h | 16 | ||||
-rw-r--r-- | include/clblast_c.h | 6 |
2 files changed, 19 insertions, 3 deletions
diff --git a/include/clblast.h b/include/clblast.h index c8596b39..e1d4f25b 100644 --- a/include/clblast.h +++ b/include/clblast.h @@ -25,6 +25,18 @@ #include <CL/opencl.h> #endif +// Exports library functions under Windows when building a DLL. See also: +// https://msdn.microsoft.com/en-us/library/a90k134d.aspx +#ifdef _WIN32 + #ifdef COMPILING_DLL + #define PUBLIC_API __declspec(dllexport) + #else + #define PUBLIC_API __declspec(dllimport) + #endif +#else + #define PUBLIC_API +#endif + namespace clblast { // ================================================================================================= @@ -576,11 +588,11 @@ StatusCode Omatcopy(const Layout layout, const Transpose a_transpose, // CLBlast stores binaries of compiled kernels into a cache in case the same kernel is used later on // for the same device. This cache can be cleared to free up system memory or in case of debugging. -StatusCode ClearCache(); +StatusCode PUBLIC_API ClearCache(); // The cache can also be pre-initialized for a specific device with all possible CLBLast kernels. // Further CLBlast routine calls will then run at maximum speed. -StatusCode FillCache(const cl_device_id device); +StatusCode PUBLIC_API FillCache(const cl_device_id device); // ================================================================================================= diff --git a/include/clblast_c.h b/include/clblast_c.h index b92febac..a13b8e64 100644 --- a/include/clblast_c.h +++ b/include/clblast_c.h @@ -25,7 +25,11 @@ // Exports library functions under Windows when building a DLL. See also: // https://msdn.microsoft.com/en-us/library/a90k134d.aspx #ifdef _WIN32 - #define PUBLIC_API __declspec(dllexport) + #ifdef COMPILING_DLL + #define PUBLIC_API __declspec(dllexport) + #else + #define PUBLIC_API __declspec(dllimport) + #endif #else #define PUBLIC_API #endif |