[petsc-dev] ViennaCL-bindings in next

Karl Rupp rupp at mcs.anl.gov
Thu Mar 28 05:32:42 CDT 2013


Hi Dave,

yes, OpenCL is much less picky about versions because it is a .so only. 
No separate compiler(s), just the standardized headers and the 
vendor-provided libOpenCL.so, which (in the case of GPUs) even come with 
the driver. No need for an SDK.

MUCH cleaner from a maintenance point of view  :-) (just Apple being a 
bit 'special')

Best regards,
Karli


On 03/27/2013 05:33 PM, Nystrom, William D wrote:
> Karli,
>
> Would the OpenCL headers and libraries that come with Cuda 5.0 be adequate?
>
> Thanks,
>
> Dave
>
> ________________________________________
> From: petsc-dev-bounces at mcs.anl.gov [petsc-dev-bounces at mcs.anl.gov] on behalf of Karl Rupp [rupp at mcs.anl.gov]
> Sent: Thursday, March 21, 2013 5:50 PM
> To: For users of the development version of PETSc
> Subject: [petsc-dev] ViennaCL-bindings in next
>
> Hi,
>
> the interface to ViennaCL [1] has just been merged to 'next', enabling
> PETSc to use OpenCL-enabled devices (most notably Intel's Xeon Phi and
> GPUs from AMD in addition to the existing NVIDIA bindings). I tested it
> with Vector-, Matrix-, and KSP- examples.
>
> The new bindings are enabled by the configure flags
> --download-viennacl
> --with-opencl-include=/path/to/OpenCL-Headers
> --with-opencl-lib=/path/to/libOpenCL.so
>
> The OpenCL headers can be obtained on the Khronos webpage [2] and are
> often available via package managers, e.g.
> $> sudo apt-get install opencl-headers
> or
> $> sudo yam install opencl-headers
> In such case, the OpenCL include directory is typically /usr/include
> (BuildSystem may not detect these headers correctly on Mac OS, I'm
> working on this). The OpenCL library comes with your graphics driver and
> is usually located at /usr/lib/. There is no separate compiler as for
> CUDA needed!
>
> FAQ:
>
> - What is the performance difference between OpenCL and CUDA for GPUs?
> My experience is that for large problem sizes they are equivalent for
> almost all linear algebra kernels. For small problem sizes (kernel
> execution less than 1ms), CUDA is currently superior because of lower
> latency.
>
> - Which solvers can I use with the ViennaCL-bindings?
> The same as with CUSP. Most notably the usual CG, BiCGS, GMRES.
>
> - Which preconditioners are provided in the ViennaCL-bindings?
> Currently none. You can, however, use all the standard CPU-based
> preconditioners in PETSc together with ViennaCL matrices and vectors.
>
> - Which command line options do I need to use?
> Use -vec_type viennacl -mat_type aijviennacl
> On Intel's Xeon Phi you also need to pass -viennacl_device_accelerator.
> (If you read this email in an archive: Check the manual for current flags).
>
> Best regards,
> Karli
>
> [1] http://viennacl.sourceforge.net/
> [2] http://www.khronos.org/registry/cl/
>




More information about the petsc-dev mailing list