the error description is
" Error 4 error C2664: 'viennacl::context::context(const viennacl::context &)' : cannot convert argument 1 from 'viennacl::ocl::context' to 'viennacl::memory_types' "
I wonder why about this.
AND I have another question: If I want compute on GPU , I must use " #define VIENNACL_WITH_OPENCL 1" ?
or this code has already compute with GPU defaultly. without write " #define VIENNACL_WITH_OPENCL 1 ".
Thank you very much !!!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
do you define VIENNACL_WITH_OPENCL before all of your ViennaCL-related includes? It looks like viennacl/context.hpp gets included indirectly at an earlier point. Generally I recommend to put the define as the first line in your source file.
As for your second question:
If you define VIENNACL_WITH_OPENCL, the code will run per default on the first device available on your system. To get an overview of the OpenCL devices on your system, build and run viennacl-info. The first device listed there is the default device (usually a GPU).
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I study the Viennacl library. and when I bulid the example " amg.cpp " with opencl, it occured error .
at the begining of the code I write:
and the error occured in the sentence
the error description is
" Error 4 error C2664: 'viennacl::context::context(const viennacl::context &)' : cannot convert argument 1 from 'viennacl::ocl::context' to 'viennacl::memory_types' "
I wonder why about this.
AND I have another question: If I want compute on GPU , I must use " #define VIENNACL_WITH_OPENCL 1" ?
or this code has already compute with GPU defaultly. without write " #define VIENNACL_WITH_OPENCL 1 ".
Thank you very much !!!!!
Hi,
do you define VIENNACL_WITH_OPENCL before all of your ViennaCL-related includes? It looks like
viennacl/context.hpp
gets included indirectly at an earlier point. Generally I recommend to put the define as the first line in your source file.As for your second question:
If you define VIENNACL_WITH_OPENCL, the code will run per default on the first device available on your system. To get an overview of the OpenCL devices on your system, build and run
viennacl-info
. The first device listed there is the default device (usually a GPU).Best regards,
Karli