Skip to content

Commit f3719b4

Browse files
Merge pull request #1236 from KrisThielemans/Array
update Array hierarchy and allocate nD arrays in a contiguous block by default
2 parents 41c74f5 + ae82826 commit f3719b4

25 files changed

+968
-176
lines changed

Diff for: .appveyor.yml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ version: '{build}'
1414
os:
1515
- Visual Studio 2022
1616
- Visual Studio 2019
17-
- Visual Studio 2015
1817

1918
platform:
2019
- x64

Diff for: .github/workflows/build-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
compiler: gcc
8080
compiler_version: 12
8181
cuda_version: "12.1.0"
82-
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=14"
82+
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=17"
8383
BUILD_TYPE: "Release"
8484
parallelproj: "ON"
8585
ROOT: "OFF"

Diff for: CMakeLists.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ include(src/cmake/SetC++Version.cmake)
3333

3434
# minimum C++ version required (you can still ask for a more recent one
3535
# by setting CMAKE_CXX_STANDARD)
36-
UseCXX(14)
36+
UseCXX(17)
3737

3838
# set default build-type to Release
3939
if(NOT CMAKE_BUILD_TYPE)
@@ -118,18 +118,12 @@ if(NOT DISABLE_LLN_MATRIX)
118118
endif()
119119

120120
if(NOT DISABLE_CERN_ROOT)
121-
find_package(CERN_ROOT)
121+
find_package(CERN_ROOT 6.28.00) # required for C++17
122122
if (CERN_ROOT_FOUND)
123123
message(STATUS "ROOT Version: ${CERN_ROOT_VERSION}")
124124
if (${CERN_ROOT_VERSION} VERSION_GREATER 6.29.99)
125125
message(STATUS "ROOT Version is >= 6.30. Setting the minimum CXX version to 20.")
126126
UseCXX(20)
127-
elseif (${CERN_ROOT_VERSION} VERSION_GREATER 6.27.99)
128-
message(STATUS "ROOT Version is >= 6.28. Setting the minimum CXX version to 17.")
129-
UseCXX(17)
130-
elseif (${CERN_ROOT_VERSION} VERSION_GREATER 6.23.99)
131-
message(STATUS "ROOT Version is >= 6.24. Setting the minimum CXX version to 14.")
132-
UseCXX(14)
133127
endif()
134128
endif()
135129
endif()

Diff for: documentation/release_6.2.htm

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<title>Summary of changes in STIR release 6.2</title>
5+
</head>
6+
7+
<body>
8+
<h1>Summary of changes in STIR release 6.2</h1>
9+
10+
<p>
11+
This version is 100% backwards compatible with STIR 6.1. However, C++-17 is now required.
12+
</p>
13+
14+
<h2>Overall summary</h2>
15+
<p>
16+
17+
</p>
18+
19+
<p>
20+
Of course, there is also the usual code-cleanup and improvements to the documentation.
21+
</p>
22+
23+
<p>
24+
This release contains mainly code written by Nicole Jurjew (UCL) and Kris Thielemans (UCL).
25+
</p>
26+
27+
<h2>Patch release info</h2>
28+
<ul>
29+
<li>
30+
6.2.0 released ??/2024<br>
31+
<a href="https://github.com/UCL/STIR/milestone/11">GitHub Milestone 6.2</a>
32+
</li>
33+
<!--
34+
<li> 4.0.1 released 28/04/2020
35+
<ul>
36+
<li><a href=https://github.com/UCL/STIR/pull/513>PR 513</a> (suppress warnings with clang)</li>
37+
</ul>
38+
-->
39+
</ul>
40+
41+
<h2> Summary for end users (also to be read by developers)</h2>
42+
43+
44+
<h3>New functionality</h3>
45+
<ul>
46+
</ul>
47+
48+
49+
<h3>Changed functionality</h3>
50+
<ul>
51+
</ul>
52+
53+
54+
<h3>Bug fixes</h3>
55+
<ul>
56+
</ul>
57+
58+
<h3>Build system</h3>
59+
<ul
60+
<li>
61+
C++-17 is now required.
62+
</li>
63+
</ul>
64+
65+
<h3>Known problems</h3>
66+
<p>See <a href=https://github.com/UCL/STIR/labels/bug>our issue tracker</a>.</p>
67+
68+
69+
<H2>What's new for developers (aside from what should be obvious
70+
from the above):</H2>
71+
72+
<h3>Changed functionality</h3>
73+
<ul>
74+
<li>
75+
<code>Array</code> classes by default use contiguous memory allocation (as opposed to a sequence of 1D vectors).
76+
This could speed up memory allocation and destruction of arrays with a high number of underlying 1D vectors. It also allows reading/writing
77+
data in one call to the C++ library, as opposed to many small calls. Also added move constructors to the <code>Array</code>,
78+
<code>VectorWithOffset</code> classes.
79+
<br>
80+
<a href=https://github.com/UCL/STIR/pull/1236>issue #1236</a>.
81+
</li>
82+
</ul>
83+
84+
<h3>Bug fixes</h3>
85+
<ul>
86+
<li>
87+
<code>PoissonLogLikelihoodWithLinearModelForMeanAndProjData</code> had a (minor?) problem with TOF data
88+
that when computing the gradient, the normalisation object was not set-up with the TOF data,
89+
but non-TOF instead. This did not happen in our normal reconstruction code, and would have thrown an error
90+
if it occured.
91+
<br>
92+
Fixed in <a href=https://github.com/UCL/STIR/pull/1427>issue #1427</a>.
93+
</li>
94+
</ul>
95+
96+
97+
<h3>Other code changes</h3>
98+
<ul>
99+
<li>
100+
Fixes an incompatibility with C++20.
101+
</li>
102+
</ul>
103+
104+
<h3>Build system</h3>
105+
<ul>
106+
<li>
107+
Force C++ version according to CERN ROOT versions: ROOT 6.28.10 needs C++17 and 6.30.2 needs C++20.
108+
Also some fixes when relying on <code>root-config</code>.
109+
</li>
110+
</ul>
111+
112+
<h3>Test changes</h3>
113+
114+
<h4>C++ tests</h4>
115+
<ul>
116+
<li>
117+
Objective functions (both projection-data and list-mode) and priors now have a numerical test for <code>accumulate_Hessian_times_input</code>
118+
<br>
119+
<a href=https://github.com/UCL/STIR/pull/1418> PR #1418</a>
120+
</li>
121+
</ul>
122+
123+
</body>
124+
125+
</html>

Diff for: src/buildblock/ProjDataInfoCylindrical.cxx

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ using std::min_element;
4343
using std::max_element;
4444
using std::min;
4545
using std::max;
46-
using std::swap;
4746
using std::endl;
4847
using std::string;
4948
using std::pair;
@@ -113,7 +112,7 @@ ProjDataInfoCylindrical::ProjDataInfoCylindrical(const shared_ptr<Scanner>& scan
113112
min_ring_diff[segment_num],
114113
max_ring_diff[segment_num],
115114
segment_num);
116-
swap(min_ring_diff[segment_num], max_ring_diff[segment_num]);
115+
std::swap(min_ring_diff[segment_num], max_ring_diff[segment_num]);
117116
}
118117
}
119118

Diff for: src/cmake/FindCERN_ROOT.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,6 @@ if (CERN_ROOT_DEBUG)
168168
endif()
169169

170170
INCLUDE(FindPackageHandleStandardArgs)
171-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CERN_ROOT "CERN ROOT not found. If you do have it, set ROOT_DIR (preferred), ROOTSYS or add root-config to your path" CERN_ROOT_VERSION CERN_ROOT_LIBRARIES CERN_ROOT_INCLUDE_DIRS)
171+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CERN_ROOT FAIL_MESSAGE "CERN ROOT not found. If you do have it, set ROOT_DIR (preferred), ROOTSYS or add root-config to your path"
172+
VERSION_VAR CERN_ROOT_VERSION
173+
REQUIRED_VARS CERN_ROOT_LIBRARIES CERN_ROOT_INCLUDE_DIRS)

0 commit comments

Comments
 (0)