summaryrefslogtreecommitdiff
path: root/include/clblast.h
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-06-30 10:49:17 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-06-30 10:49:17 +0200
commitb330ab086640382157688ea6b9633b5f0a22dac3 (patch)
treea6943773d4b7d83e1a52ec27d787912736a9d54d /include/clblast.h
parentcd74aaac5290d14ba03ad13bb2fffa1040ccff5d (diff)
Added declspec(dllexport) to ClearCache and FillCache, and added declspec(dllimport) when not building the library
Diffstat (limited to 'include/clblast.h')
-rw-r--r--include/clblast.h16
1 files changed, 14 insertions, 2 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);
// =================================================================================================