MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Timing

Method Timing

fem/hcurlfe.cpp:320–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319 template<int D>
320 list<tuple<string,double>> HCurlFiniteElement<D> :: Timing () const
321 {
322 list<tuple<string,double>>timings;
323 IntegrationRule ir(ElementType(), 2*Order());
324 SIMD_IntegrationRule simdir(ElementType(), 2*Order());
325
326 constexpr int DIMC = D*(D-1)/2;
327 Matrix<> shape(GetNDof(),D);
328 Vector<> coefs(GetNDof());
329 Matrix<> values(ir.Size(), D);
330 Matrix<> dvalues(ir.Size(), DIMC);
331 Matrix<SIMD<double>> avalues(D,simdir.Size());
332 Matrix<SIMD<double>> advalues(DIMC, simdir.Size());
333 Matrix<SIMD<double>> simd_shapes(DIMC*GetNDof(), simdir.Size());
334 FE_ElementTransformation<D,D> trafo(ElementType());
335
336 LocalHeap lh (10000000, "FE - Timing");
337 HeapReset hr(lh);
338 // auto & mir = trafo(ir, lh);
339 auto & simdmir = trafo(simdir, lh);
340
341 coefs = 1;
342
343 double maxtime = 0.5;
344 double time;
345
346 constexpr size_t steps = 1000;
347 time = RunTiming([&]() {
348 for (size_t i = 0; i < steps; i++)
349 this -> CalcShape(ir[0], shape);
350 });
351 timings.push_back(make_tuple("CalcShape", time/D/steps*1e9/GetNDof()));
352
353 try
354 {
355 time = RunTiming([&]() {
356 for (size_t i = 0; i < steps; i++)
357 this -> CalcMappedShape(simdmir, simd_shapes);
358 });
359 timings.push_back(make_tuple("CalcShape (SIMD)", time/D/steps*1e9/(simdir.GetNIP()*GetNDof())));
360 }
361 catch (const ExceptionNOSIMD& e) { };
362
363 time = RunTiming([&]() {
364 for (size_t i = 0; i < steps; i++)
365 this -> Evaluate(ir, coefs, values);
366 }, maxtime);
367 timings.push_back(make_tuple("Evaluate",time/D/steps*1e9/(GetNDof()*ir.GetNIP())));
368
369 try
370 {
371 time = RunTiming([&]() {
372 for (size_t i = 0; i < steps; i++)
373 this -> Evaluate(simdmir, coefs, avalues);
374 }, maxtime);
375 timings.push_back(make_tuple("Evaluate(SIMD)", time/D/steps*1e9/(GetNDof()*ir.GetNIP())));
376 }
377 catch (const ExceptionNOSIMD& e) { };

Callers

nothing calls this directly

Calls 9

ElementTypeFunction · 0.85
OrderFunction · 0.70
GetNDofFunction · 0.70
SizeMethod · 0.45
CalcShapeMethod · 0.45
CalcMappedShapeMethod · 0.45
GetNIPMethod · 0.45
EvaluateMethod · 0.45
AddTransMethod · 0.45

Tested by

no test coverage detected