Code Monkey home page Code Monkey logo

ogmaneo's Issues

Go lang bindings for OgmaNeo

cc @nytopop

A recent request was made for a Go lang version of OgmaNeo. This issue is to document the findings I've made with respect to evaluating whether SWIG (Simplified Wrapper and Interface Generator) can be used to produce these Go bindings.

During prototyping we had a Go lang version of a pre-release version of OgmaNeo. Up the release of the OgmaNeo C++/OpenCL library, we used SWIG to create language bindings for Python, Java-JNI, and internally C#.

SWIG added support for Go in version 2.0.1 [1]. Allowing for C++ libraries to become packages that can be called from Go code. SWIG language bindings have varied and inconsistent support for C++1X and standard library features [2].

  • One key feature we require with OgmaNeo is support of std::shared_ptr Unfortunately this is missing from Go support in SWIG.
  • The other troublesome aspect is that the Go support in SWIG currently only works on Linux and Mac OS. An issue to add Windows support for Go in SWIG remains open [3, 4].

Refs:

  1. SWIG Golang support - http://www.swig.org/Doc3.0/Go.html
  2. SWIG Golang std lib support - https://github.com/swig/swig/tree/master/Lib/go
  3. SWIG + CGO + Windows open issue - golang/go#9095
  4. https://groups.google.com/forum/#!topic/golang-nuts/-M-8X-PLvOw

Windows c-shared mode - golang/go#11058
Go execution modes - https://groups.google.com/forum/#!topic/golang-dev/0_N7DLmrUFA

Multiple definition errors when compiling OgmaNeo

Hi, I'm having some trouble compiling with the latest revision of OgmaNeo. Specifically receiving these errors while linking the library to my project:

[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x0): multiple definition of `.weak.__ZGVN2cl12CommandQueue8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x0): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x8): multiple definition of `.weak.__ZGVN2cl7Context8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x8): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x10): multiple definition of `.weak.__ZGVN2cl8Platform8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x10): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x18): multiple definition of `.weak.__ZGVN2cl6Device8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x18): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x20): multiple definition of `.weak.__ZN2cl12CommandQueue14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x20): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x24): multiple definition of `.weak.__ZN2cl12CommandQueue8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x24): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x28): multiple definition of `.weak.__ZN2cl12CommandQueue20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x28): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x2c): multiple definition of `.weak.__ZN2cl7Context14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x2c): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x30): multiple definition of `.weak.__ZN2cl7Context8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x30): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x34): multiple definition of `.weak.__ZN2cl7Context20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x34): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x38): multiple definition of `.weak.__ZN2cl8Platform14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x38): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x3c): multiple definition of `.weak.__ZN2cl8Platform8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x3c): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x40): multiple definition of `.weak.__ZN2cl8Platform20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x40): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x44): multiple definition of `.weak.__ZN2cl6Device14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x44): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x48): multiple definition of `.weak.__ZN2cl6Device8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x48): first defined here
[...]libOgmaNeo.a(PredictorLayer.cpp.obj):PredictorLayer.cpp:(.bss+0x50): multiple definition of `.weak.__ZN2cl6Device20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x50): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x0): multiple definition of `.weak.__ZGVN2cl12CommandQueue8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x0): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x8): multiple definition of `.weak.__ZGVN2cl7Context8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x8): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x10): multiple definition of `.weak.__ZGVN2cl8Platform8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x10): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x18): multiple definition of `.weak.__ZGVN2cl6Device8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x18): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x20): multiple definition of `.weak.__ZN2cl12CommandQueue14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x50): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x24): multiple definition of `.weak.__ZN2cl12CommandQueue8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x54): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x28): multiple definition of `.weak.__ZN2cl12CommandQueue20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x58): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x2c): multiple definition of `.weak.__ZN2cl7Context14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x5c): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x30): multiple definition of `.weak.__ZN2cl7Context8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x60): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x34): multiple definition of `.weak.__ZN2cl7Context20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x64): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x38): multiple definition of `.weak.__ZN2cl8Platform14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x68): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x3c): multiple definition of `.weak.__ZN2cl8Platform8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x6c): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x40): multiple definition of `.weak.__ZN2cl8Platform20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x70): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x44): multiple definition of `.weak.__ZN2cl6Device14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x74): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x48): multiple definition of `.weak.__ZN2cl6Device8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x78): first defined here
[...]libOgmaNeo.a(ComputeProgram.cpp.obj):ComputeProgram.cpp:(.bss+0x50): multiple definition of `.weak.__ZN2cl6Device20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x80): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x0): multiple definition of `.weak.__ZGVN2cl12CommandQueue8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x0): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x8): multiple definition of `.weak.__ZGVN2cl7Context8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x8): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x10): multiple definition of `.weak.__ZGVN2cl8Platform8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x10): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x18): multiple definition of `.weak.__ZGVN2cl6Device8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x18): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x20): multiple definition of `.weak.__ZN2cl12CommandQueue14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x50): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x24): multiple definition of `.weak.__ZN2cl12CommandQueue8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x54): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x28): multiple definition of `.weak.__ZN2cl12CommandQueue20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x58): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x2c): multiple definition of `.weak.__ZN2cl7Context14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x5c): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x30): multiple definition of `.weak.__ZN2cl7Context8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x60): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x34): multiple definition of `.weak.__ZN2cl7Context20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x64): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x38): multiple definition of `.weak.__ZN2cl8Platform14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x68): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x3c): multiple definition of `.weak.__ZN2cl8Platform8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x6c): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x40): multiple definition of `.weak.__ZN2cl8Platform20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x70): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x44): multiple definition of `.weak.__ZN2cl6Device14default_error_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x74): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x48): multiple definition of `.weak.__ZN2cl6Device8default_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x78): first defined here
[...]libOgmaNeo.a(ComputeSystem.cpp.obj):ComputeSystem.cpp:(.bss+0x50): multiple definition of `.weak.__ZN2cl6Device20default_initialized_E.__ZNKSt5ctypeIcE8do_widenEc'
[...]libOgmaNeo.a(Architect.cpp.obj):Architect.cpp:(.bss+0x80): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x0): multiple definition of `.weak.__ZGVN2cl12CommandQueue8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x0): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x8): multiple definition of `.weak.__ZGVN2cl7Context8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x8): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x10): multiple definition of `.weak.__ZGVN2cl8Platform8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x10): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x18): multiple definition of `.weak.__ZGVN2cl6Device8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x18): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x20): multiple definition of `.weak.__ZN2cl12CommandQueue14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x20): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x24): multiple definition of `.weak.__ZN2cl12CommandQueue8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x24): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x28): multiple definition of `.weak.__ZN2cl12CommandQueue20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x28): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x2c): multiple definition of `.weak.__ZN2cl7Context14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x2c): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x30): multiple definition of `.weak.__ZN2cl7Context8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x30): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x34): multiple definition of `.weak.__ZN2cl7Context20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x34): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x38): multiple definition of `.weak.__ZN2cl8Platform14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x38): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x3c): multiple definition of `.weak.__ZN2cl8Platform8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x3c): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x40): multiple definition of `.weak.__ZN2cl8Platform20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x40): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x44): multiple definition of `.weak.__ZN2cl6Device14default_error_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x44): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x48): multiple definition of `.weak.__ZN2cl6Device8default_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x48): first defined here
[...]libOgmaNeo.a(Helpers.cpp.obj):Helpers.cpp:(.bss+0x50): multiple definition of `.weak.__ZN2cl6Device20default_initialized_E.__ZN11flatbuffers16DefaultAllocator10deallocateEPhj'
[...]libOgmaNeo.a(Predictor.cpp.obj):Predictor.cpp:(.bss+0x50): first defined here

Any ideas?

Design considerations for using OpenCL

Question. What are (or were) the design considerations for using OpenCL.

Are they technical reasons (speed, available memory on GPU, etc), or strategic (portability, GPU is a unused resource on most computers, future will bring more compute power (GPU) in handhelds, etc), or personal (I've done this before, I've not done this before).

Why am I asking? I've worked with Fortran code that was written before I was born, and I've thrown away my CUDA code within a year because my gtx295 became obsolete (in 2010). Obviously my code would still be functional had I used OpenCL, but I'm not convinced that OpenCL would have given me portability AND speed advantages which forced me to use CUDA. The OpenCL part adds a lot of technical complexity to this interesting project. I have feeling that the speed advantages are not that large (with comparable $ budget) compared to properly written C++ or Fortran. I haven't measured this, thus I could be horribly wrong. I'm likely missing one of your design considerations.

Regards HJ!

Implementation questions

Thank you for sharing this research. While studying it I've noticed some small issues or I had questions.

FeatureHierarchy.cpp: line 91: can
"for (int l = 0; l < _layers.size(); l++)"
be replaced with:
"if (learn) for (int l = 0; l < _layers.size(); l++)"

neoKernelsMain.cl: line 364: can
"write_imagef(weightsFront, (int4)(hiddenPosition.x, hiddenPosition.y, wi, 0), (float4)(weight));"
be replaced with:
"write_imagef(weightsFront, (int4)(hiddenPosition.x, hiddenPosition.y, wi, 0), (float4)(weight, 0.0f, 0.0f, 0.0f));

neoKernelsExtra.cl: line 193: can
"write_imagef(hiddenSummationTempFront, hiddenPosition, (float4)(sum + subSum / fmax(1.0f, count)));
be replaced with:
"write_imagef(hiddenSummationTempFront, hiddenPosition, (float4)(sum + subSum / fmax(1.0f, count), 0.0f, 0.0f, 0.0f));

neoKernelsExtra.cl: line 270: can
"write_imagef(hiddenStatesFront, hiddenPosition, (float4)(state));
be replaced with:
"write_imagef(hiddenStatesFront, hiddenPosition, (float4)(state, 0.0f, 0.0f, 0.0f));

neoKernelsExtra.cl: line 299: can
"write_imagef(weightsFront, (int4)(hiddenPosition.x, hiddenPosition.y, wi, 0), (float4)(weightPrev + weightAlpha * hiddenState * reconError));"
be replaced with:
"write_imagef(weightsFront, (int4)(hiddenPosition.x, hiddenPosition.y, wi, 0), (float4)(weightPrev + weightAlpha * hiddenState * reconError, 0.0f, 0.0f, 0.0f));

no bilateral inhibition in version 1.1?

I like to use the old SparseFeatures code (that was used in v1.0) and update it such that it can be used alongside the current Chunk, Delay and STDP code (v1.1). There is however an interesting difference between v1.0 and v1.1: In 1.1, class FeatureHierarchy method simStep, layers are activated with the hidden context, while in the initial version the layers would be activated with the hidden state.

line 62: FeatureHierarchy.cpp v1.1:
inputsUse.push_back(_layers.front()._sf->getHiddenContext());

Could you explain why you choose not to use bilateral inhibition? or did i miss something.

Regards HJ!

Should/could the library be Hunter'ized?

Hunter is a CMake-driven cross-platform package manager for C++ [1] projects. With the help of Hunter you can organize builds for Linux, OS X, Windows, iOS, Android, and Raspberry Pi. Third-party external projects are highly customizable, effectively allowing you to have myriad variants of directories with them based on combinations of version to build, static/shared, CMake -D options, Release/Debug, etc.

1 https://docs.hunter.sh/en/latest/

another small issue

[andrewcz@andrewcz-pc Python]$ ls
build CMakeLists.txt Example.py Gym.py ModuleTest.py ogmaneo.egg-info pyogmaneo.i README.md requirements.txt setup.cfg setup.py WavyDemo.py
[andrewcz@andrewcz-pc Python]$ python Example.py
OgmaNeo version: 1.4.2
Found 1 platform(s).
Platform 0: Intel(R) OpenCL
Using platform: Intel(R) OpenCL

Found 1 device(s).
Device 0: Intel(R) HD Graphics
Using device: Intel(R) HD Graphics

Segmentation fault (core dumped)
[andrewcz@andrewcz-pc Python]$ python WavyDemo.py
OgmaNeo version: 1.4.2
Found 1 platform(s).
Platform 0: Intel(R) OpenCL
Using platform: Intel(R) OpenCL

Found 1 device(s).
Device 0: Intel(R) HD Graphics
Using device: Intel(R) HD Graphics

Segmentation fault (core dumped)
[andrewcz@andrewcz-pc Python]$

Can I use it to learn multiple games or predict multiple videos with the same network/system?

Hello, this is so interesting. Could I use OgmaNeo to create a computer program that can learn to predict a video, then the same program/dataset (network?) learn to predict another video, and perhaps a third or more, where the same program/dataset is able to predict based on frames from these different videos? So maybe it would need to select a context, or that would happen sort of transparently based on the properties of OgmaNeo..or not?

Similarly, could I use OgmaNeo to create an AI that can learn one game, and then train it on another similar game -- would anything transfer over? Would it even be able to play both games equally well?

Thanks very much for any time you have for this question, and for publishing your work on this in general.

pooled layer swamps

Can you guys please explain why scale in FeatureHierarchy.fhPool is not used (see below). If ignoring the this scale and if you take a long pooling window, I think the pooled layer may swamp the influx from the next layer. Or am I mistaken?

void kernel fhPool(read_only image2d_t states, read_only image2d_t outputsBack, write_only image2d_t outputsFront, float scale) {
    int2 position = (int2)(get_global_id(0), get_global_id(1));
    float state = read_imagef(states, defaultSampler, position).x;
    float outputPrev = read_imagef(outputsBack, defaultSampler, position).x;
    write_imagef(outputsFront, position, (float4)(fmax(outputPrev, state), 0.0f, 0.0f, 0.0f));
}

issues on arch linux

  • CMake install prefix = /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/3rdparty
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build
    cd /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build && /usr/bin/cmake -E touch /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-stamp/OgmaNeoDownload-configure
    [ 54%] Performing build step for 'OgmaNeoDownload'
    cd /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build && /usr/bin/make
    make[3]: Entering directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[4]: Entering directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[5]: Entering directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    Scanning dependencies of target OgmaOCLtoHpp
    make[5]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[5]: Entering directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    [ 3%] Building CXX object CMakeFiles/OgmaOCLtoHpp.dir/utils/OCLpp.cpp.o
    In file included from /usr/include/c++/7.2.0/ext/string_conversions.h:41:0,
    from /usr/include/c++/7.2.0/bits/basic_string.h:6159,
    from /usr/include/c++/7.2.0/string:52,
    from /usr/include/c++/7.2.0/bits/locale_classes.h:40,
    from /usr/include/c++/7.2.0/bits/ios_base.h:41,
    from /usr/include/c++/7.2.0/ios:42,
    from /usr/include/c++/7.2.0/ostream:38,
    from /usr/include/c++/7.2.0/iostream:39,
    from /home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload/utils/OCLpp.cpp:9:
    /usr/include/c++/7.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
    #include_next <stdlib.h>
    ^~~~~~~~~~
    compilation terminated.
    make[5]: *** [CMakeFiles/OgmaOCLtoHpp.dir/build.make:63: CMakeFiles/OgmaOCLtoHpp.dir/utils/OCLpp.cpp.o] Error 1
    make[5]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[4]: *** [CMakeFiles/Makefile2:100: CMakeFiles/OgmaOCLtoHpp.dir/all] Error 2
    make[4]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[3]: *** [Makefile:130: all] Error 2
    make[3]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload-build'
    make[2]: *** [CMakeFiles/OgmaNeoDownload.dir/build.make:114: OgmaNeo/src/OgmaNeoDownload-stamp/OgmaNeoDownload-build] Error 2
    make[2]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6'
    make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/OgmaNeoDownload.dir/all] Error 2
    make[1]: Leaving directory '/home/andrewcz/ogmaneo/Python/build/temp.linux-x86_64-3.6'
    make: *** [Makefile:133: all] Error 2
    error: command 'cmake' failed with exit status 2
    [andrewcz@andrewcz-pc Python]$

number of chunks

I think the number of chunks may be calculated incorrectly.
Question: are the following three lines of code correct?

In SparseFeaturesChunk.cpp line 40:
int chunksInX = static_cast<int>(std::ceil(static_cast<float>(_hiddenSize.x) / static_cast<float>(_chunkSize.x)));

In SparseFeaturesChunk.cpp line 80 and 290:
int chunksInX = _hiddenSize.x / _chunkSize.x + 1;

Regards HJ!

Port to vanilla C++

To study how this approach works I've copied the sources and removed all dependencies. What remains are 13 header files, no OpenCL nor flatbuffers just vanilla C++ code.

Question: how should I make my project public. Would it be ok if I add it to my fork? I assume that it would than have the licencing of the parent project, but I could be mistaken.

Regards HJ!

Cannot find where "sfc_weightAlpha" is used

The Video Prediction demo set a layer property "sfc_weightAlpha" to value 0.01f, yet this property is never used. There does however exist a property sfc_ff_weightAlpha which is never set. The demo seems to use incorrect properties, and a default value is used instead for the weight alpha.

A properties enum would be better than unconstrained strings i guess.

small python issues

-- Configuring done
-- Generating done
-- Build files have been written to: /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6
cmake --build . --config Release
/usr/bin/cmake -H/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python -B/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/CMakeFiles /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
/usr/bin/make -f CMakeFiles/OgmaNeoDownload.dir/build.make CMakeFiles/OgmaNeoDownload.dir/depend
make[2]: Entering directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
cd /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6 /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6 /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/CMakeFiles/OgmaNeoDownload.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
/usr/bin/make -f CMakeFiles/OgmaNeoDownload.dir/build.make CMakeFiles/OgmaNeoDownload.dir/build
make[2]: Entering directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
[ 9%] Performing update step for 'OgmaNeoDownload'
cd /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/OgmaNeo/src/OgmaNeoDownload && /usr/bin/cmake -P /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/OgmaNeo/tmp/OgmaNeoDownload-gitupdate.cmake

*** Please tell me who you are.

Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@andrewcz-pc.(none)')
Cannot save the current index state
CMake Error at /home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6/OgmaNeo/tmp/OgmaNeoDownload-gitupdate.cmake:83 (message):
Failed to stash changes

make[2]: *** [CMakeFiles/OgmaNeoDownload.dir/build.make:98: OgmaNeo/src/OgmaNeoDownload-stamp/OgmaNeoDownload-update] Error 1
make[2]: Leaving directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/OgmaNeoDownload.dir/all] Error 2
make[1]: Leaving directory '/home/andrewcz/Downloads/OgmaNeo-1.4.2/Python/build/temp.linux-x86_64-3.6'
make: *** [Makefile:133: all] Error 2
error: command 'cmake' failed with exit status 2
[andrewcz@andrewcz-pc Python]$

strange error - arch linux

[andrewcz@andrewcz-pc ~]$ python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import ogmaneo

KeyboardInterrupt

[andrewcz@andrewcz-pc ~]$ cd Downloads/
[andrewcz@andrewcz-pc Downloads]$ python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import ogmaneo
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'ogmaneo'

A public place to discuss stuff ?

I understand the project just started, but is there a public place to discuss stuff relating to OgmaNeo? Like, a mailing list, or forums?

Sorry for posting this message on github issue tracker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.