[petsc-users] PetscFEIntegrateResidual_OpenCL w/ viennacl

Matthew Knepley knepley at gmail.com
Mon Oct 13 14:22:44 CDT 2014


On Mon, Oct 13, 2014 at 2:16 PM, Karl Rupp <rupp at iue.tuwien.ac.at> wrote:

> Hi David,
>
> > when using the snes/ex12 example
>
>> https://bitbucket.org/petsc/petsc/src/f5476a2b443e0eedb22d31cb1b2d85
>> b9b918f73f/src/snes/examples/tutorials/ex12.c?at=master
>> with
>>
>> -variable_coefficient field  -petscfe_type opencl -mat_petscfe_type opencl
>>
>> and
>>
>> -dm_vec_type  viennacl -dm_mat_type seqaijviennacl -mat_type
>> seqaijviennacl
>>
>> will PetscFEIntegrateResidual_OpenCL transfer the residual vector
>> directly to the
>> viennacl datastructures on the GPU for the solve ?
>>
>
>
> No, unfortunately this doesn't work yet. The residual implementation is
> 'matrix free', so there is no matrix set up and *mat_type without effect.
> Setting
>  -dm_vec_type viennacl
> will be supported in the future, but currently the OpenCL buffer is only
> set up to compute the residual.
>
>
>  is the output residual of PetscFEIntegrateResidual_OpenCL a vector on
>> the CPU ?
>>
>
> yes, it is read back to elemVec[], which is passed to
> PetscFEIntegrateResidual_OpenCL()
>

I forgot that assembly is still being done on the CPU, so elemVec[] is read
back. However, the
vector is OpenCL, so the assembled results will be on the GPU.

I wrote code a long time ago to assemble on the GPU, but there was no
speedup at all, so I
threw it away. I am not sure it will ever make sense to do that.

  Matt


> Best regards,
> Karli
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141013/cf490ebb/attachment.html>


More information about the petsc-users mailing list