26 #ifndef __BeagleCPUSSEImpl__
27 #define __BeagleCPUSSEImpl__
30 #include "libhmsbeagle/config.h"
33 #include "libhmsbeagle/CPU/BeagleCPUImpl.h"
37 #define RESTRICT __restrict
41 #define T_PAD_SSE_EVEN 2 // for even state counts
42 #define T_PAD_SSE_ODD 1 // for odd state counts
45 #define P_PAD_SSE_EVEN 0 // for even state counts
46 #define P_PAD_SSE_ODD 1 // for odd state counts
49 #define BEAGLE_CPU_SSE_FLOAT float, T_PAD, P_PAD
50 #define BEAGLE_CPU_SSE_DOUBLE double, T_PAD, P_PAD
51 #define BEAGLE_CPU_SSE_TEMPLATE template <int T_PAD, int P_PAD>
71 BEAGLE_CPU_SSE_TEMPLATE
93 virtual const char* getName();
95 virtual const long getFlags();
98 virtual int getPaddedPatternsModulus();
101 virtual void calcStatesStates(
float* destP,
103 const float* matrices1,
105 const float* matrices2);
107 virtual void calcStatesPartials(
float* destP,
109 const float* matrices1,
110 const float* partials2,
111 const float* matrices2);
113 virtual void calcPartialsPartials(
float* __restrict destP,
114 const float* __restrict partials1,
115 const float* __restrict matrices1,
116 const float* __restrict partials2,
117 const float* __restrict matrices2);
119 virtual void calcPartialsPartialsFixedScaling(
float* __restrict destP,
120 const float* __restrict partials1,
121 const float* __restrict matrices1,
122 const float* __restrict partials2,
123 const float* __restrict matrices2,
124 const float* __restrict scaleFactors);
126 virtual void calcPartialsPartialsAutoScaling(
float* __restrict destP,
127 const float* __restrict partials1,
128 const float* __restrict matrices1,
129 const float* __restrict partials2,
130 const float* __restrict matrices2,
131 int* activateScaling);
133 virtual int calcEdgeLogLikelihoods(
const int parentBufferIndex,
134 const int childBufferIndex,
135 const int probabilityIndex,
136 const int categoryWeightsIndex,
137 const int stateFrequenciesIndex,
138 const int scalingFactorsIndex,
139 double* outSumLogLikelihood);
145 BEAGLE_CPU_SSE_TEMPLATE
167 virtual const char* getName();
169 virtual const long getFlags();
172 virtual int getPaddedPatternsModulus();
175 virtual void calcStatesStates(
double* destP,
177 const double* matrices1,
179 const double* matrices2);
181 virtual void calcStatesPartials(
double* destP,
183 const double* matrices1,
184 const double* partials2,
185 const double* matrices2);
187 virtual void calcPartialsPartials(
double* __restrict destP,
188 const double* __restrict partials1,
189 const double* __restrict matrices1,
190 const double* __restrict partials2,
191 const double* __restrict matrices2);
193 virtual void calcPartialsPartialsFixedScaling(
double* __restrict destP,
194 const double* __restrict partials1,
195 const double* __restrict matrices1,
196 const double* __restrict partials2,
197 const double* __restrict matrices2,
198 const double* __restrict scaleFactors);
200 virtual void calcPartialsPartialsAutoScaling(
double* __restrict destP,
201 const double* __restrict partials1,
202 const double* __restrict matrices1,
203 const double* __restrict partials2,
204 const double* __restrict matrices2,
205 int* activateScaling);
207 virtual int calcEdgeLogLikelihoods(
const int parentBufferIndex,
208 const int childBufferIndex,
209 const int probabilityIndex,
210 const int categoryWeightsIndex,
211 const int stateFrequenciesIndex,
212 const int scalingFactorsIndex,
213 double* outSumLogLikelihood);
217 BEAGLE_CPU_FACTORY_TEMPLATE
221 int partialsBufferCount,
222 int compactBufferCount,
225 int eigenBufferCount,
226 int matrixBufferCount,
228 int scaleBufferCount,
230 long preferenceFlags,
231 long requirementFlags,
234 virtual const char* getName();
235 virtual const long getFlags();
242 #include "libhmsbeagle/CPU/BeagleCPUSSEImpl.hpp"
245 #endif // __BeagleCPUSSEImpl__