<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 17, 2014 at 10:45 AM, Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17 October 2014 17:54, Dominic Meiser <<a href="mailto:dmeiser@txcorp.com">dmeiser@txcorp.com</a>> wrote:<br>
> Hi Ashwin,<br>
><br>
> Are you suggesting that `VecGetGPUArray*`  be added to the `Vec` interface?<br>
> That might be problematic because these methods only makes sense for GPU<br>
> vectors. The interface of `Vec` would then be tied to the PETSc<br>
> configuration.<br>
><br>
<br>
</span>These methods could be always available simply generate an error for<br>
non-GPU vector types.<br>
<span class=""><br>
> An alternative might be to compose the various `VecCUSPGetArray` and related<br>
> methods with `Vec` objects. You could then query these methods and use them<br>
> if available (and handle absence of the methods if needed, e.g. throw an<br>
> exception). This would be easy to add.<br>
><br>
<br>
</span>Yes, however note that what we really need is a backend-independent<br>
way to get the RAW pointer to the GPU buffers. Right now we have calls<br>
to get the CUSP or ViennaCL array, to handle them you need C++ and<br>
depend on CUDA/OpenCL at compile-time.<br></blockquote><div><br></div><div>Why would we want this? The packages themselves (CUDA/ViennaCL) only expose</div><div>memory using these specific types. What use is it to wrap these up in a void * if you</div><div>just have to caste back down to use them. Isn't it better to maintain type-specific, and</div><div>type safe, interfaces for this stuff?</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">
<br>
--<br>
Lisandro Dalcin<br>
============<br>
Research Scientist<br>
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>
Numerical Porous Media Center (NumPor)<br>
King Abdullah University of Science and Technology (KAUST)<br>
<a href="http://numpor.kaust.edu.sa/" target="_blank">http://numpor.kaust.edu.sa/</a><br>
<br>
4700 King Abdullah University of Science and Technology<br>
al-Khawarizmi Bldg (Bldg 1), Office # 4332<br>
Thuwal 23955-6900, Kingdom of Saudi Arabia<br>
<a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a><br>
<br>
Office Phone: <a href="tel:%2B966%2012%20808-0459" value="+966128080459">+966 12 808-0459</a><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>