help-octave
[Top][All Lists]
Advanced

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

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


From: cjbattagl
Subject: Accessing Pointer to NDarray/Matrix data in C oct-file
Date: Thu, 2 Jul 2009 07:51:59 -0700 (PDT)

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.



reply via email to

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