<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 13, 2014 at 2:16 PM, Karl Rupp <span dir="ltr"><<a href="mailto:rupp@iue.tuwien.ac.at" target="_blank">rupp@iue.tuwien.ac.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<span class=""><br>
<br>
> when using the snes/ex12 example<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="https://bitbucket.org/petsc/petsc/src/f5476a2b443e0eedb22d31cb1b2d85b9b918f73f/src/snes/examples/tutorials/ex12.c?at=master" target="_blank">https://bitbucket.org/petsc/<u></u>petsc/src/<u></u>f5476a2b443e0eedb22d31cb1b2d85<u></u>b9b918f73f/src/snes/examples/<u></u>tutorials/ex12.c?at=master</a><br>
with<br>
<br>
-variable_coefficient field -petscfe_type opencl -mat_petscfe_type opencl<br>
<br>
and<br>
<br>
-dm_vec_type viennacl -dm_mat_type seqaijviennacl -mat_type seqaijviennacl<br>
<br>
will PetscFEIntegrateResidual_<u></u>OpenCL transfer the residual vector<br>
directly to the<br>
viennacl datastructures on the GPU for the solve ?<br>
</blockquote>
<br>
<br></span>
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<br>
-dm_vec_type viennacl<br>
will be supported in the future, but currently the OpenCL buffer is only set up to compute the residual.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
is the output residual of PetscFEIntegrateResidual_<u></u>OpenCL a vector on<br>
the CPU ?<br>
</blockquote>
<br></span>
yes, it is read back to elemVec[], which is passed to PetscFEIntegrateResidual_<u></u>OpenCL()<br></blockquote><div><br></div><div>I forgot that assembly is still being done on the CPU, so elemVec[] is read back. However, the</div><div>vector is OpenCL, so the assembled results will be on the GPU.</div><div><br></div><div>I wrote code a long time ago to assemble on the GPU, but there was no speedup at all, so I</div><div>threw it away. I am not sure it will ever make sense to do that.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Best regards,<br>
Karli<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener
</div></div>