Accessing Pointer to NDarray/Matrix data in C oct-file

View: New views
1 Messages — Rating Filter:   Alert me  

Accessing Pointer to NDarray/Matrix data in C oct-file

by cjbattagl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave