Commits

Takeshi Nakazato authored and Ville Suoranta committed 858b6cb67c7 Merge
Pull request #709: CAS-14111

Merge in CASA/casa6 from CAS-14111 to master * commit 'dc7116090fa9f3cdeae9e096fb47fbcad2bfc4b2': CAS-14111 enable debug message only for debug build CAS-14111 ensure aligned address for libsakura input arrays CAS-14111 bug fix in casaVector() CAS-14111 make sure input/output arrays for libsakura functions are aligned CAS-14111 updated SakuraAlignedArray API

casatools/src/code/casa_sakura/SakuraAlignedArray.h

Modified
13 13
14 14 namespace casa { //# NAMESPACE CASA - BEGIN
15 15
16 16 template<typename T>
17 17 class SakuraAlignedArray {
18 18 public:
19 19 SakuraAlignedArray(size_t num_data);
20 20 SakuraAlignedArray(casacore::Vector<T> const &in_vector);
21 21 ~SakuraAlignedArray();
22 22
23 - T *data; // pointer to aligned data
24 - casacore::Vector<T> *casaVector; // pointer to aligned CASA Vector
23 + T *data() const {return data_;}
24 + casacore::Vector<T> casaVector() const {
25 + return casacore::Vector<T>(casacore::IPosition(1, num_data_), data_,
26 + casacore::SHARE);
27 + }
25 28 private:
26 29 void initialize();
27 30 size_t num_data_; // number of data to be stored
28 31 void *storage_; // starting address of allocated memory (unaligned)
32 + T *data_; // pointer to aligned data
29 33 };
30 34
31 35 } //# NAMESPACE CASA - END
32 36
33 37 #include <casa_sakura/SakuraAlignedArray.tcc>
34 -
38 +
35 39 #endif /* _CASA_SAKURA_ALIGNED_ARRAY_H_ */

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut