I've been trying to get ViennaCL's GPU examples building and ran into some snags.
I wanted to get ViennaCL working with a custom build system, and my plan was to try to get it working with Cmake, and then figure out the dependencies from build logs.
By default none of the GPU examples get built. The tutorial says that instructions to enable OpenCL or Cuda are in in CMakeLists.txt, but I couldn't find these instructions in that file
Then I tried to untangle the dependencies manually starting with rand.cpp example. However, I get following unresolved dependency rand/utils.hpp -> linalg/kernels/rand_kernels.h. I can not find rand_kernels.h anywhere, either 1.5.2 version or the latest version from git
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OpenCL is enabled by default with CMake. The easiest way to customize the configuration is to run the CMake-GUI using
$> cmake-gui ..
from the build subfolder and toggle ENABLE_CUDA, ENABLE_OPENCL, ENABLE_OPENMP as needed.
As for rand.cpp: That functionality has been removed, unfortunately we missed to remove the respective .cpp file in the examples folder. Please try any of the other examples, e.g. blas1.cpp. If you want to compile from the command line, run e.g.
$ build> g++ ../examples/tutorial/blas1.cpp -I..
to obtain a plain host-based execution. To enable OpenCL, pass -DVIENNACL_WITH_OPENCL. For CUDA, just use nvcc with -DVIENNACL_WITH_CUDA.
Hope this helps :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, it helps
I got 2 arbitrary examples (custom-context.cpp, custom-kernel.cpp) working on K40c with nvidia driver 340.29 by adding all the headers in viennacl and compiling with -DVIENNACL_WITH_OPENCL
One minor annoyance, our systems don't build stuff with warnings by default, so I had to manually suppress this warning
Am I correct that you used the viennacl-dev repository? Which compiler did you use? We usually clean up all warnings up to -Wextra on GCC and Clang for each release, so you might want to try the latest 1.5.2 release in the meanwhile.
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been trying to get ViennaCL's GPU examples building and ran into some snags.
I wanted to get ViennaCL working with a custom build system, and my plan was to try to get it working with Cmake, and then figure out the dependencies from build logs.
By default none of the GPU examples get built. The tutorial says that instructions to enable OpenCL or Cuda are in in CMakeLists.txt, but I couldn't find these instructions in that file
Then I tried to untangle the dependencies manually starting with rand.cpp example. However, I get following unresolved dependency rand/utils.hpp -> linalg/kernels/rand_kernels.h. I can not find rand_kernels.h anywhere, either 1.5.2 version or the latest version from git
OpenCL is enabled by default with CMake. The easiest way to customize the configuration is to run the CMake-GUI using
$> cmake-gui ..
from the build subfolder and toggle ENABLE_CUDA, ENABLE_OPENCL, ENABLE_OPENMP as needed.
As for rand.cpp: That functionality has been removed, unfortunately we missed to remove the respective .cpp file in the examples folder. Please try any of the other examples, e.g. blas1.cpp. If you want to compile from the command line, run e.g.
$ build> g++ ../examples/tutorial/blas1.cpp -I..
to obtain a plain host-based execution. To enable OpenCL, pass -DVIENNACL_WITH_OPENCL. For CUDA, just use nvcc with -DVIENNACL_WITH_CUDA.
Hope this helps :-)
Thanks, it helps
I got 2 arbitrary examples (custom-context.cpp, custom-kernel.cpp) working on K40c with nvidia driver 340.29 by adding all the headers in viennacl and compiling with -DVIENNACL_WITH_OPENCL
One minor annoyance, our systems don't build stuff with warnings by default, so I had to manually suppress this warning
/viennacl/device_specific/templates/reduction_template.hpp:150:11: error: 'class viennacl::device_specific::reduction_template::generate_impl(const string&, const viennacl::device_specific::statements_container&, const std::vector<std::map<std::pair<long unsigned="" int,="" viennacl::device_specific::leaf_t="">, viennacl::tools::shared_ptr<viennacl::device_specific::mapped_object> > >&, unsigned int) const::loop_body' has virtual functions and accessible non-virtual destructor
Thanks for the feedback, Yaroslav.
Am I correct that you used the viennacl-dev repository? Which compiler did you use? We usually clean up all warnings up to -Wextra on GCC and Clang for each release, so you might want to try the latest 1.5.2 release in the meanwhile.
Best regards,
Karli