help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave and CUDA


From: mpender
Subject: Re: Octave and CUDA
Date: Tue, 21 Jan 2014 18:27:02 -0800 (PST)

>You can probably do it by storing a pointer reinterpret_cast'ed to
>integer into an Octave variable, and using that "integer" as handle.  In
>the case of GPU memory, you'd cuda_malloc the block and then cast
>the resulting pointer; or you could even construct your own C++ data
>structure holding the CUDA memory pointer plus additional data you want,
>and store a pointer to your internal data structure in the Octave integer.

I'm attempting to do this now, but am stuck on the syntax required within a
C++ function to recast the passed Octave integer into a pointer that can be
used to free the memory block.  Everything seems to work when I do it
within the same C++ file, but for this to work well the memory must be
persistent across multiple calls to C++/Oct files.

I've created a new thread to track this as a new question:
http://octave.1599824.n4.nabble.com/Casting-from-an-Octave-int-value-to-a-pointer-td4661233.html




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Octave-and-CUDA-tp4660998p4661235.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]