OpenCL Compilation Fails
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- backend, build-system
Research direction
Reproduce with the reported CMake options and make -j12, then inspect BuildPrograms in src/core/device/opencl_device.cc and the pure virtual methods reported in include/singa/core/device.h. Trace the missing OpenCL symbols and OpenclDevice interface errors; done means the OpenCL configuration builds successfully without these compiler errors.
Written by the indexing model from the issue text.
Description
On master branch cmake compile fails
Configuration:
root@1cbf9f240cc2:~/singa/build# cmake -DENABLE_TEST=ON -DUSE_PYTHON3=ON -DUSE_DNNL=ON
-DUSE_OPENCL=ON ..
-- SINGA git Version 3.3.0
-- SINGA Version 3300
-- FOUND GLOG at /usr/include
-- Found ViennaCL include: /usr/include
-- ********************* Found ViennaCL headers at /usr/include
-- Found DNNL at /root/dnnl_lnx_1.1.0_cpu_gomp/include
-- Configuring done
-- Generating done
-- Build files have been written to: /root/singa/build
with make -j12
[ 25%] Building CXX object src/CMakeFiles/singa_objects.dir/core/tensor/tensor.cc.o
/root/singa/src/core/device/opencl_device.cc: In member function 'void singa::OpenclDevice::BuildPrograms()':
/root/singa/src/core/device/opencl_device.cc:96:46: error: 'distribution_str' is not a member of 'viennacl::backend::opencl'
ocl::current_context().add_program(opencl::distribution_str,
^~~~~~~~~~~~~~~~
/root/singa/src/core/device/opencl_device.cc:98:46: error: 'tensormath_str' is not a member of 'viennacl::backend::opencl'
ocl::current_context().add_program(opencl::tensormath_str,
^~~~~~~~~~~~~~
/root/singa/src/core/device/opencl_device.cc:100:46: error: 'im2col_str' is not a member of 'viennacl::backend::opencl'
ocl::current_context().add_program(opencl::im2col_str, "opencl_im2col");
^~~~~~~~~~
/root/singa/src/core/device/opencl_device.cc:101:46: error: 'pooling_str' is not a member of 'viennacl::backend::opencl'
ocl::current_context().add_program(opencl::pooling_str, "opencl_pooling");
^~~~~~~~~~~
and after;
/usr/include/c++/7/bits/shared_ptr.h:344:64: required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<singa::OpenclDevice>; _Args = {}; _Tp = singa::OpenclDevice]'
/usr/include/c++/7/bits/shared_ptr.h:690:14: required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = singa::OpenclDevice; _Alloc = std::allocator<singa::OpenclDevice>; _Args = {}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39: required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = singa::OpenclDevice; _Args = {}]'
/root/singa/src/core/device/platform.cc:169:41: required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'singa::OpenclDevice'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/singa/src/core/device/platform.cc:22:0:
/root/singa/include/singa/core/device.h:253:7: note: because the following virtual functions are pure within 'singa::OpenclDevice':
class OpenclDevice : public singa::Device {
^~~~~~~~~~~~
/root/singa/include/singa/core/device.h:134:16: note: virtual void singa::Device::TimeProfilingDoExec(std::function<void(singa::_Context*)>&&, int, singa::Node*)
virtual void TimeProfilingDoExec(function<void(Context*)>&& fn, int executor,
^~~~~~~~~~~~~~~~~~~
/root/singa/include/singa/core/device.h:136:16: note: virtual void singa::Device::EvaluateTimeElapsed(singa::Node*)
virtual void EvaluateTimeElapsed(Node* node) = 0;
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/singa
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 15/100
-
Adding GPU testing to Github workflowsMay be free again @joddiy claimed this 2148 days ago, and no pull request is open. Open
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
area/ysql kind/bug priority/medium
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yugabyte/yugabyte-db#34552 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 94/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/ClickHouse#123351 ·
Maintainers usually reply within 1 day