-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to speed up STIR acquisition data algebra by avoiding unnecessary 0-fill of newly created data. #1549
base: master
Are you sure you want to change the base?
Changes from all commits
3b2b84c
377020b
7b416af
ac31b6a
c3b25d6
3ff116d
b05ba0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -451,13 +451,13 @@ class Array<1, elemT> : public NumericVectorWithOffset<elemT, elemT> | |||||
inline virtual void grow(const IndexRange<1>& range); | ||||||
|
||||||
// Array::grow initialises new elements to 0 | ||||||
inline void grow(const int min_index, const int max_index) override; | ||||||
inline virtual void grow(const int min_index, const int max_index, bool initialise_with_0 = true); | ||||||
|
||||||
//! Array::resize initialises new elements to 0 | ||||||
inline virtual void resize(const IndexRange<1>& range); | ||||||
|
||||||
// Array::resize initialises new elements to 0 | ||||||
inline void resize(const int min_index, const int max_index) override; | ||||||
inline virtual void resize(const int min_index, const int max_index, bool initialise_with_0 = true); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
//! \name access to the data via a pointer | ||||||
//@{ | ||||||
|
@@ -569,6 +569,15 @@ class Array<1, elemT> : public NumericVectorWithOffset<elemT, elemT> | |||||
inline const elemT& at(const BasicCoordinate<1, int>& c) const; | ||||||
//@} | ||||||
|
||||||
void set_initialise_with_zeros(bool iwz) | ||||||
{ | ||||||
init_with_zeros_ = iwz; | ||||||
} | ||||||
bool get_initialise_with_zeros() const | ||||||
{ | ||||||
return init_with_zeros_; | ||||||
} | ||||||
Comment on lines
+572
to
+579
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will need to be removed |
||||||
|
||||||
private: | ||||||
// Make sure we can call init() recursively. | ||||||
template <int num_dimensions2, class elemT2> | ||||||
|
@@ -579,6 +588,8 @@ class Array<1, elemT> : public NumericVectorWithOffset<elemT, elemT> | |||||
\arg data_ptr should start to a contiguous block of correct size | ||||||
*/ | ||||||
inline void init(const IndexRange<1>& range, elemT* const data_ptr, bool copy_data); | ||||||
|
||||||
bool init_with_zeros_ = true; | ||||||
Comment on lines
+591
to
+592
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will need to be removed |
||||||
}; | ||||||
|
||||||
END_NAMESPACE_STIR | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.