[petsc-dev] Petsc+ViennaCL usage

Karl Rupp rupp at mcs.anl.gov
Wed Jan 22 15:43:53 CST 2014


Hi Mani,

 > Thanks Karl. Is there anyway I can get the build info?

For the moment only in case of an error...


> Also, my system is such that I have the GPU on one platform (0) and the
> CPU on another (1). When I try using -viennalcl_device_cpu, it still
> uses the GPU cause I think that it defaults to the first platform it
> finds which only has the GPU. Is there some way to toggle between the
> platforms or do you suggest that I manually pass in the contexts into
> viennacl?

Ah, so you have two OpenCL platforms available on your machine. Call
   viennacl::ocl::set_context_platform_index(0, platform_index_here);
at the beginning of your program in order to specify the default 
platform index. In your case this should be
   viennacl::ocl::set_context_platform_index(0, 1);
(cf. http://viennacl.sourceforge.net/viennacl-manual-current.pdf)
I'll also make this configurable directly through PETSc in the next 
update of the ViennaCL bindings.

Best regards,
Karli




More information about the petsc-dev mailing list