From 0bbe79ff2603378d735c1fb9e05e4eb1c34416b5 Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Wed, 27 May 2020 12:44:44 +0300 Subject: [PATCH 1/2] [SYCL] Do not export utility methods from SYCLMemObjT Signed-off-by: Alexander Batashev --- sycl/include/CL/sycl/detail/export.hpp | 1 + .../include/CL/sycl/detail/sycl_mem_obj_t.hpp | 48 +++++++++---------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sycl/include/CL/sycl/detail/export.hpp b/sycl/include/CL/sycl/detail/export.hpp index 47d21bd894f0a..4f5fca8c9a364 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 4043b2ec28b1e..55b5325fd0371 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,49 @@ 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