Skip to content

Commit

Permalink
Merge pull request #106 from marty1885/master
Browse files Browse the repository at this point in the history
Fix Backend/Buffer visiblity
  • Loading branch information
marty1885 authored Nov 25, 2019
2 parents 62b42c9 + b30972d commit ab45cab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if (ETALER_BUILD_TESTS)
add_subdirectory(tests)
endif()

option(ETALER_BUILD_DOCS "Build documents" ON)
option(ETALER_BUILD_DOCS "Build documents" OFF)
if (ETALER_BUILD_DOCS)
add_subdirectory(docs)
endif()
4 changes: 2 additions & 2 deletions Etaler/Backends/CPUBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace et
{

struct CPUBuffer : public BufferImpl
struct ETALER_EXPORT CPUBuffer : public BufferImpl
{
CPUBuffer(const Shape& shape, DType dtype, std::shared_ptr<Backend> backend)
: BufferImpl(shape.volume(), dtype, std::move(backend))
Expand Down Expand Up @@ -47,7 +47,7 @@ struct CPUBuffer : public BufferImpl
std::variant<bool*, int32_t*, float*, half*> storage_;
};

struct CPUBackend : public Backend
struct ETALER_EXPORT CPUBackend : public Backend
{
virtual std::shared_ptr<TensorImpl> createTensor(const Shape& shape, DType dtype, const void* data=nullptr) override
{
Expand Down
4 changes: 2 additions & 2 deletions Etaler/Backends/OpenCLBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace et
{


struct OpenCLBuffer : public BufferImpl
struct ETALER_EXPORT OpenCLBuffer : public BufferImpl
{
OpenCLBuffer(const Shape& shape, DType dtype, const cl::Buffer& buffer, std::shared_ptr<Backend> backend)
: BufferImpl(shape.volume(), dtype, backend), buffer_(buffer) {}
Expand All @@ -35,7 +35,7 @@ struct OpenCLBuffer : public BufferImpl
cl::Buffer buffer_;
};

struct KernelManager
struct ETALER_EXPORT KernelManager
{
KernelManager() : KernelManager(cl::Device(), cl::Context()) {};
KernelManager(cl::Device device, cl::Context context);
Expand Down
4 changes: 2 additions & 2 deletions Etaler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ project(Etaler CXX)
############################################################################
# Setup the Etaler library building

set(CMAKE_CXX_VISIBILITY_PRESET hidden)

add_library(Etaler SHARED Backends/CPUBackend.cpp Core/DefaultBackend.cpp Core/Serialize.cpp Core/Tensor.cpp
Algorithms/SpatialPooler.cpp Algorithms/SpatialPoolerND.cpp Algorithms/TemporalMemory.cpp Core/TypeHelpers.cpp)

set_target_properties(Etaler PROPERTIES CXX_VISIBILITY_PRESET hidden)

# Auto-generate the export header for shared library macros
include(GenerateExportHeader)
generate_export_header(Etaler EXPORT_FILE_NAME Etaler_export.h)
Expand Down
4 changes: 2 additions & 2 deletions Etaler/Core/TensorImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace et
{

struct BufferImpl : public std::enable_shared_from_this<BufferImpl>
struct ETALER_EXPORT BufferImpl : public std::enable_shared_from_this<BufferImpl>
{
BufferImpl(size_t size, DType dtype, std::shared_ptr<Backend> backend)
: size_(size), dtype_(dtype), backend_(backend) {}
Expand All @@ -26,7 +26,7 @@ struct BufferImpl : public std::enable_shared_from_this<BufferImpl>
std::shared_ptr<Backend> backend_;
};

struct TensorImpl : public std::enable_shared_from_this<TensorImpl>
struct ETALER_EXPORT TensorImpl : public std::enable_shared_from_this<TensorImpl>
{
TensorImpl(std::shared_ptr<BufferImpl> buffer, Shape shape, Shape stride, size_t offset=0)
: buffer_(buffer), shape_(shape), stride_(stride), offset_(offset) {}
Expand Down

0 comments on commit ab45cab

Please sign in to comment.