Skip to content

Commit ab45cab

Browse files
authored
Merge pull request #106 from marty1885/master
Fix Backend/Buffer visiblity
2 parents 62b42c9 + b30972d commit ab45cab

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ if (ETALER_BUILD_TESTS)
103103
add_subdirectory(tests)
104104
endif()
105105

106-
option(ETALER_BUILD_DOCS "Build documents" ON)
106+
option(ETALER_BUILD_DOCS "Build documents" OFF)
107107
if (ETALER_BUILD_DOCS)
108108
add_subdirectory(docs)
109109
endif()

Etaler/Backends/CPUBackend.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace et
1313
{
1414

15-
struct CPUBuffer : public BufferImpl
15+
struct ETALER_EXPORT CPUBuffer : public BufferImpl
1616
{
1717
CPUBuffer(const Shape& shape, DType dtype, std::shared_ptr<Backend> backend)
1818
: BufferImpl(shape.volume(), dtype, std::move(backend))
@@ -47,7 +47,7 @@ struct CPUBuffer : public BufferImpl
4747
std::variant<bool*, int32_t*, float*, half*> storage_;
4848
};
4949

50-
struct CPUBackend : public Backend
50+
struct ETALER_EXPORT CPUBackend : public Backend
5151
{
5252
virtual std::shared_ptr<TensorImpl> createTensor(const Shape& shape, DType dtype, const void* data=nullptr) override
5353
{

Etaler/Backends/OpenCLBackend.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace et
2323
{
2424

2525

26-
struct OpenCLBuffer : public BufferImpl
26+
struct ETALER_EXPORT OpenCLBuffer : public BufferImpl
2727
{
2828
OpenCLBuffer(const Shape& shape, DType dtype, const cl::Buffer& buffer, std::shared_ptr<Backend> backend)
2929
: BufferImpl(shape.volume(), dtype, backend), buffer_(buffer) {}
@@ -35,7 +35,7 @@ struct OpenCLBuffer : public BufferImpl
3535
cl::Buffer buffer_;
3636
};
3737

38-
struct KernelManager
38+
struct ETALER_EXPORT KernelManager
3939
{
4040
KernelManager() : KernelManager(cl::Device(), cl::Context()) {};
4141
KernelManager(cl::Device device, cl::Context context);

Etaler/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ project(Etaler CXX)
44
############################################################################
55
# Setup the Etaler library building
66

7-
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
8-
97
add_library(Etaler SHARED Backends/CPUBackend.cpp Core/DefaultBackend.cpp Core/Serialize.cpp Core/Tensor.cpp
108
Algorithms/SpatialPooler.cpp Algorithms/SpatialPoolerND.cpp Algorithms/TemporalMemory.cpp Core/TypeHelpers.cpp)
119

10+
set_target_properties(Etaler PROPERTIES CXX_VISIBILITY_PRESET hidden)
11+
1212
# Auto-generate the export header for shared library macros
1313
include(GenerateExportHeader)
1414
generate_export_header(Etaler EXPORT_FILE_NAME Etaler_export.h)

Etaler/Core/TensorImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace et
1313
{
1414

15-
struct BufferImpl : public std::enable_shared_from_this<BufferImpl>
15+
struct ETALER_EXPORT BufferImpl : public std::enable_shared_from_this<BufferImpl>
1616
{
1717
BufferImpl(size_t size, DType dtype, std::shared_ptr<Backend> backend)
1818
: size_(size), dtype_(dtype), backend_(backend) {}
@@ -26,7 +26,7 @@ struct BufferImpl : public std::enable_shared_from_this<BufferImpl>
2626
std::shared_ptr<Backend> backend_;
2727
};
2828

29-
struct TensorImpl : public std::enable_shared_from_this<TensorImpl>
29+
struct ETALER_EXPORT TensorImpl : public std::enable_shared_from_this<TensorImpl>
3030
{
3131
TensorImpl(std::shared_ptr<BufferImpl> buffer, Shape shape, Shape stride, size_t offset=0)
3232
: buffer_(buffer), shape_(shape), stride_(stride), offset_(offset) {}

0 commit comments

Comments
 (0)