forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmssw-clang-vla.patch
190 lines (175 loc) · 7.36 KB
/
cmssw-clang-vla.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
? CMSDIST/cmssw-clang-vla.patch
Index: RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h,v
retrieving revision 1.21
diff -u -r1.21 EgammaTowerIsolation.h
--- RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h 11 Nov 2012 10:38:54 -0000 1.21
+++ RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h 9 Jan 2013 19:57:36 -0000
@@ -132,7 +132,11 @@
// sort in eta (kd-tree anoverkill,does not vectorize...)
uint32_t index[nt];
+#ifdef __clang__
+ float *e = (float*)alloca(nt);
+#else
float e[nt];
+#endif
for (std::size_t k=0; k!=nt; ++k) {
e[k]=towers[k].eta();
index[k]=k;
Index: RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h,v
retrieving revision 1.40
diff -u -r1.40 SiStripRecHitMatcher.h
--- RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h 18 Feb 2012 17:16:13 -0000 1.40
+++ RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h 9 Jan 2013 19:57:36 -0000
@@ -188,7 +188,11 @@
+#ifdef __clang__
+ std::vector<StereoInfo> cache{std::distance(seconditer,seconditerend)};
+#else
StereoInfo cache[std::distance(seconditer,seconditerend)];
+#endif
//iterate on stereo rechits
// fill cache with relevant info
int cacheSize=0;
Index: RecoTracker/FinalTrackSelectors/src/DuplicateListMerger.cc
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/RecoTracker/FinalTrackSelectors/src/DuplicateListMerger.cc,v
retrieving revision 1.7
diff -u -r1.7 DuplicateListMerger.cc
--- RecoTracker/FinalTrackSelectors/src/DuplicateListMerger.cc 2 Dec 2012 18:30:06 -0000 1.7
+++ RecoTracker/FinalTrackSelectors/src/DuplicateListMerger.cc 9 Jan 2013 19:57:36 -0000
@@ -86,7 +86,11 @@
edm::RefProd< TrajectorySeedCollection > refTrajSeeds;
const int rSize = (int)originalHandle->size();
+#ifdef __clang__
+ std::vector<edm::RefToBase<TrajectorySeed> > seedsRefs{rSize};
+#else
edm::RefToBase<TrajectorySeed> seedsRefs[rSize];
+#endif
if(copyExtras_){
outputTrkExtras = std::auto_ptr<reco::TrackExtraCollection>(new reco::TrackExtraCollection);
Index: RecoTracker/FinalTrackSelectors/src/TrackListMerger.cc
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/RecoTracker/FinalTrackSelectors/src/TrackListMerger.cc,v
retrieving revision 1.48
diff -u -r1.48 TrackListMerger.cc
--- RecoTracker/FinalTrackSelectors/src/TrackListMerger.cc 24 Oct 2012 20:42:16 -0000 1.48
+++ RecoTracker/FinalTrackSelectors/src/TrackListMerger.cc 9 Jan 2013 19:57:36 -0000
@@ -298,7 +298,11 @@
//cache the id and rechits of valid hits
typedef std::pair<unsigned int, const TrackingRecHit*> IHit;
+#ifdef __clang__
+ std::vector<std::vector<IHit> > rh1{ngood}; // an array of vectors!
+#else
std::vector<IHit> rh1[ngood]; // an array of vectors!
+#endif
//const TrackingRecHit* fh1[ngood]; // first hit...
unsigned char algo[ngood];
float score[ngood];
@@ -499,8 +503,13 @@
// output selected tracks - if any
//
+#ifdef __clang__
+ std::vector<reco::TrackRef> trackRefs{rSize};
+ std::vector<edm::RefToBase<TrajectorySeed> > seedsRefs{rSize};
+#else
reco::TrackRef trackRefs[rSize];
edm::RefToBase<TrajectorySeed> seedsRefs[rSize];
+#endif
unsigned int nToWrite=0;
for ( unsigned int i=0; i<rSize; i++)
Index: TrackingTools/GsfTracking/src/GsfBetheHeitlerUpdator.cc
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/TrackingTools/GsfTracking/src/GsfBetheHeitlerUpdator.cc,v
retrieving revision 1.9
diff -u -r1.9 GsfBetheHeitlerUpdator.cc
--- TrackingTools/GsfTracking/src/GsfBetheHeitlerUpdator.cc 8 Jan 2013 11:14:56 -0000 1.9
+++ TrackingTools/GsfTracking/src/GsfBetheHeitlerUpdator.cc 9 Jan 2013 19:57:36 -0000
@@ -121,8 +121,11 @@
//
if ( rl<0.01f ) rl = 0.01f;
if ( rl>0.20f ) rl = 0.20f;
-
+#ifdef __clang__
+ GSContainer *mixture = new GSContainer[theNrComponents];
+#else
GSContainer mixture[theNrComponents];
+#endif
getMixtureParameters(rl,mixture);
correctWeights(mixture);
if ( theCorrectionFlag>=1 )
@@ -155,6 +158,9 @@
using namespace materialEffect;
effects[i].deltaCov[elos] += varPinv;
}
+#ifdef __clang__
+ delete[] mixture;
+#endif
}
}
//
Index: TrackingTools/GsfTracking/src/GsfCombinedMaterialEffectsUpdator.cc
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/TrackingTools/GsfTracking/src/GsfCombinedMaterialEffectsUpdator.cc,v
retrieving revision 1.5
diff -u -r1.5 GsfCombinedMaterialEffectsUpdator.cc
--- TrackingTools/GsfTracking/src/GsfCombinedMaterialEffectsUpdator.cc 15 Nov 2012 13:19:39 -0000 1.5
+++ TrackingTools/GsfTracking/src/GsfCombinedMaterialEffectsUpdator.cc 9 Jan 2013 19:57:36 -0000
@@ -16,10 +16,17 @@
void GsfCombinedMaterialEffectsUpdator::compute (const TrajectoryStateOnSurface& TSoS,
const PropagationDirection propDir, Effect effects[]) const
{
+#ifdef __clang__
+ std::vector<Effect> msEffects{theMSUpdator->size()};
+ std::vector<Effect> elEffects{theELUpdator->size()};
+ theMSUpdator->compute(TSoS,propDir,&msEffects[0]);
+ theELUpdator->compute(TSoS,propDir,&elEffects[0]);
+#else
Effect msEffects[theMSUpdator->size()];
- theMSUpdator->compute(TSoS,propDir,msEffects);
Effect elEffects[theELUpdator->size()];
+ theMSUpdator->compute(TSoS,propDir,msEffects);
theELUpdator->compute(TSoS,propDir,elEffects);
+#endif
//
// combine the two multi-updates
Index: TrackingTools/GsfTracking/src/GsfMaterialEffectsUpdator.cc
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/TrackingTools/GsfTracking/src/GsfMaterialEffectsUpdator.cc,v
retrieving revision 1.5
diff -u -r1.5 GsfMaterialEffectsUpdator.cc
--- TrackingTools/GsfTracking/src/GsfMaterialEffectsUpdator.cc 25 Dec 2012 16:07:26 -0000 1.5
+++ TrackingTools/GsfTracking/src/GsfMaterialEffectsUpdator.cc 9 Jan 2013 19:57:36 -0000
@@ -27,8 +27,13 @@
//
// Get components (will force recalculation, if necessary)
//
+#ifdef __clang__
+ std::vector<Effect> effects{size()};
+ compute(TSoS,propDir,&effects[0]);
+#else
Effect effects[size()];
compute(TSoS,propDir,effects);
+#endif
//
// prepare output vector
Index: DataFormats/Math/interface/SSEVec.h
===================================================================
RCS file: /local/reps/CMSSW/CMSSW/DataFormats/Math/interface/SSEVec.h,v
retrieving revision 1.86
diff -u -r1.86 SSEVec.h
--- DataFormats/Math/interface/SSEVec.h 24 Sep 2012 08:07:05 -0000 1.86
+++ DataFormats/Math/interface/SSEVec.h 10 Jan 2013 14:49:03 -0000
@@ -855,12 +855,12 @@
// double op 3d
-#ifdef __SSE3__
+//#ifdef __SSE3__
// consistent with AVX...
inline mathSSE::Vec4D hadd(mathSSE::Vec4D a, mathSSE::Vec4D b) {
return mathSSE::Vec4D(hadd(mathSSE::Vec2D(a.vec[0]),mathSSE::Vec2D(b.vec[0])),hadd(mathSSE::Vec2D(a.vec[1]),mathSSE::Vec2D(b.vec[1])) );
}
-#endif
+//#endif
inline bool operator==(mathSSE::Vec4D a, mathSSE::Vec4D b) {