<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 27, 2014 at 7:48 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">On 27 October 2014 15:06, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> On Mon, Oct 27, 2014 at 6:30 AM, Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br>
>><br>
>> On 27 October 2014 13:49, Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br>
>> > 1) petsc4py will provide a method Vec.getCUDAAddress() that will<br>
>> > return a plain Python integer (and a corresponding<br>
>> > restoreCUDAAddress()). Any other name to suggest? Using "CUDAArray"<br>
>> > would be a bit misleading in Python land.<br>
>><br>
>> Perhaps "getCUDAHandle()" is better? Please help me to decide, I'm<br>
>> really bad at naming things.<br>
><br>
><br>
> I like handle. That is the traditional name.<br>
><br>
<br>
Thanks! Take a look at branch dalcinl/cuda-handle<br>
<a href="https://bitbucket.org/petsc/petsc4py/src/cec7da13bbb407a1b376f8e6b46b1ef31ca6e9b3/?at=dalcinl%2Fcuda-handle" target="_blank">https://bitbucket.org/petsc/petsc4py/src/cec7da13bbb407a1b376f8e6b46b1ef31ca6e9b3/?at=dalcinl%2Fcuda-handle</a></blockquote><div><br></div><div>Great! Thanks,</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>
PS: Ashwin, you could use contextmanager<br>
<a href="https://docs.python.org/2/library/contextlib.html#contextlib.contextmanager" target="_blank">https://docs.python.org/2/library/contextlib.html#contextlib.contextmanager</a><br>
to handle the get/restore using Python's with statement, eg.<br>
<br>
with gpuarray(vec) as array:<br>
launch_cuda_kernel(array)<br>
<div class="HOEnZb"><div class="h5"><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>
</div></div></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>