Writing GPU Array Type: Which Array Class to Inherit From?

David Bateman dbateman at dbateman.org
Tue Jul 7 14:09:30 CDT 2009


Wouldn't it be better to inherit from octave_matrix and store a copy of 
the matrix in the original octave_matrix::matrix value and the version 
in GPU memory in the new class and synchronize the two values as 
needed.. You won't inherit the operators at the octave prompt if you 
inherit directly for a liboctave class.

D.



cjbattagl wrote:
> I've written a GPUArray class that maintains a pointer to memory in GPU space
> so that certain operations can be outsourced to the GPU. However, right now
> I am inheriting from octave_base_value and only storing the device memory
> pointer.
>
> I would like to inherit my data type from a 2-dimensional array class so
> that I can maintain both CPU and GPU memory (so that methods not yet
> implemented on the GPU can be handled by the CPU- and swap data between
> Host/Device memories only when necessary).
>
> What would be the best Array or Matrix class for me to inherit from? The
> liboctave folder is full of them! I would like my data type to work
> interchangeably with standard matrix datatypes. i.e, would MArray2 be best?
>
> Thanks!
> Casey
>   


-- 
David Bateman                                dbateman at dbateman.org
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)



More information about the Help-octave mailing list