LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

any way to create a 32 byte aligned array

Hi there, I have been strugling for a while now and haven't found a good way to create an array with a data pointer that is aligned on a 32 byte boundary. I need such an array for efficient computation in a dll call. Does anybody know how to do this?

 

 All comments appreciated,

Dixie 

0 Kudos
Message 1 of 3
(2,875 Views)

Please go through this thread and if you have still problems please post back with bit more details.

 

Mathan

0 Kudos
Message 2 of 3
(2,856 Views)

Thanks for your response,

 

If I'm not mistaken that thread does not deal with allocating aligned memory. What I meant to ask is: is there a way to create a labview array where the data is aligned on a 32 byte memory boundary? To make it a bit more clear: a labview array is allocated as a single block of memory with (for a 1D array) first a 4 byte integer that gives the length of the array and then the actual data contained in the array. Because labview allocates memory with 1-byte memory alignment the data starts at arbitrary memory adress. The fast signal processing library that I'm using (Intel IPP) likes memory blocks that are 32-byte aligned because that it can operate more efficiently. I have tried to manually allocate memory in the C++ code I wrote to interface with IPP, but the problem is then that when I pass these arrays to labview (via an array handle) labview thinks it owns the pointer and will try to free it when it shuts down (or decides to do a memory cleanup). This sometimes leads to crashes. Also it seems that labview get's confused by these arrays that "magically appear" which leads to hard to track fpsane.cpp errors.

 

My question is: is there a way to create aligned arrays that are properly owned by labview perhaps by using the CIN tools. Or is there a way to tell labview it does not "own" a pointer soit should not delete it.

 

0 Kudos
Message 3 of 3
(2,810 Views)