Accessing Pointer to NDarray/Matrix data in C oct-file
cjbattagl
c.battaglino at ll.mit.edu
Thu Jul 2 09:51:59 CDT 2009
Hi,
I am using the octave interface to write functions that allocate octave
structures (NDarray/Matrix) onto a GPU for linear algebra operations. I
would like the memory allocation to be as fast as possible--
In Octave 3.0 I was able to directly access the data directly using
rep->data:
Matrix A = args(0).matrix_value();
double* a_data = A.rep->data;
so it was easy to copy memory to the GPU by passing the pointer to the
memory call. However, the code no longer compiles under Octave 3.2 because
'rep' is now protected. I definitely understand the reasoning behind this,
but for higher performance I would like access the data directly.
What is the best way to access the memory directly without having to
duplicate the Octave array in C?
I would appreciate your advice!
Thanks,
Casey
--
View this message in context: http://www.nabble.com/Accessing-Pointer-to-NDarray-Matrix-data-in-C-oct-file-tp24308186p24308186.html
Sent from the Octave - General mailing list archive at Nabble.com.
More information about the Help-octave
mailing list