diff --git a/sycl/include/CL/sycl/detail/export.hpp b/sycl/include/CL/sycl/detail/export.hpp index 47d21bd894f0..4f5fca8c9a36 100644 --- a/sycl/include/CL/sycl/detail/export.hpp +++ b/sycl/include/CL/sycl/detail/export.hpp @@ -39,5 +39,6 @@ #ifndef __SYCL_EXPORT #define __SYCL_EXPORT #define __SYCL_EXPORT_DEPRECATED(x) +#define DLL_LOCAL #endif #endif // __SYCL_DEVICE_ONLY__ diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp index 4043b2ec28b1..bb3bf2d82059 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp @@ -86,49 +86,56 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { const plugin &getPlugin() const; - size_t getSize() const override { return MSizeInBytes; } - size_t get_count() const { + DLL_LOCAL size_t getSize() const override { return MSizeInBytes; } + DLL_LOCAL size_t get_count() const { size_t AllocatorValueSize = MAllocator->getValueSize(); return (getSize() + AllocatorValueSize - 1) / AllocatorValueSize; } - template bool has_property() const { + template DLL_LOCAL bool has_property() const { return MProps.has_property(); } - template propertyT get_property() const { + template DLL_LOCAL propertyT get_property() const { return MProps.get_property(); } - template AllocatorT get_allocator() const { + template DLL_LOCAL AllocatorT get_allocator() const { return MAllocator->getAllocator(); } - void *allocateHostMem() override { return MAllocator->allocate(get_count()); } + DLL_LOCAL void *allocateHostMem() override { + return MAllocator->allocate(get_count()); + } - void releaseHostMem(void *Ptr) override { + DLL_LOCAL void releaseHostMem(void *Ptr) override { if (Ptr) MAllocator->deallocate(Ptr, get_count()); } void releaseMem(ContextImplPtr Context, void *MemAllocation) override; - void *getUserPtr() const { + DLL_LOCAL void *getUserPtr() const { return MOpenCLInterop ? static_cast(MInteropMemObject) : MUserPtr; } - void set_write_back(bool NeedWriteBack) { MNeedWriteBack = NeedWriteBack; } + DLL_LOCAL void set_write_back(bool NeedWriteBack) { + MNeedWriteBack = NeedWriteBack; + } - void set_final_data(std::nullptr_t) { MUploadDataFunctor = nullptr; } + DLL_LOCAL void set_final_data(std::nullptr_t) { + MUploadDataFunctor = nullptr; + } template