Skip to content

Instantly share code, notes, and snippets.

View KristofferC's full-sized avatar
πŸ‡ΈπŸ‡ͺ

Kristoffer Carlsson KristofferC

πŸ‡ΈπŸ‡ͺ
View GitHub Profile
  • a emph

    b emph

  • c emph

function f1(vs)
z = 0.0
for v in vs
for x in v
z += x
end
end

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less than 1.0 denotes a possible improvement (marked with βœ…). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

ID time ratio memory ratio
["gradient", "βˆ‡S(SymmetricTensor{2, 3, Float32})"] 2.83 (5%) ❌ Inf (1%) ❌
["gradient", "βˆ‡S(SymmetricTensor{2, 3, Float64})"] 3.22 (5%) ❌ Inf (1%) ❌
["gradient", "βˆ‡S(Tensor{2, 3, Float32})"] 2.83 (5%) ❌ Inf (1%) ❌

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less than 1.0 denotes a possible improvement (marked with βœ…). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

ID time ratio memory ratio
["basic-operations", "Float32 * SymmetricTensor{2, 3, Float32}"] 0.88 (5%) βœ… 1.00 (1%)
["basic-operations", "Float32 * Tensor{2, 3, Float32}"] 0.86 (5%) βœ… 1.00 (1%)
["basic-operations", "Float32 * Vec{3, Float32}"] 0.86 (5%) βœ… 1.00 (1%)

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less than 1.0 denotes a possible improvement (marked with βœ…). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

ID time ratio memory ratio
["basic-operations", "Float32 * SymmetricTensor{2, 3, Float32}"] 0.88 (5%) βœ… 1.00 (1%)
["basic-operations", "Float32 * Tensor{2, 3, Float32}"] 0.86 (5%) βœ… 1.00 (1%)
["basic-operations", "Float32 * Vec{3, Float32}"] 0.86 (5%) βœ… 1.00 (1%)
using MacroTools
using DataStructures
function prockey(key)
if isa(key, Symbol) || isa(key, String)
return :($(string(key)) => nothing)
elseif @capture(key, (a_ : b_) | (a_ => b_) | (a_ = b_))
return :($(string(a))=>$b)
end
error("Invalid pgf option $key")
using MacroTools, Lazy
import MacroTools: prewalk
using DataStructures
function prockey(key)
(isa(key, Symbol) || isa(key, String)) && return :($(string(key)) => nothing)
@capture(key, (a_:b_) | (a_=>b_) | (a_=b_)) || error("Invalid pgf option $key")
isa(a, Symbol) && (a = Expr(:quote, a))
:($a=>$b)
function getDivGrad(n1,n2,n3)
# the Divergence
D1 = kron(speye(n3),kron(speye(n2),ddx(n1)))
D2 = kron(speye(n3),kron(ddx(n2),speye(n1)))
D3 = kron(ddx(n3),kron(speye(n2),speye(n1)))
# DIV from faces to cell-centers
Div = [D1 D2 D3]
return Div*Div';
end
Original:
 ───────────────────────────────────────────────────────────────────────────────────
                                            Time                   Allocations      
                                    ──────────────────────   ───────────────────────
          Tot / % measured:              9.02s / 98.4%           1.37GiB / 98.6%    

 Section                    ncalls     time   %tot     avg     alloc   %tot      avg
 ───────────────────────────────────────────────────────────────────────────────────
 assemble                       18    6.60s  74.4%   367ms   1.23GiB  90.9%  70.0MiB
julia> ForwardDiff.hessian(x -> Homogenization.compute_element_potential!(cellvalues, cellcoords,
x, ɛ_bar, E), uσ_bar)
signal (4): Illegal instruction
while loading no file, in expression starting on line 0
compute_element_potential! at /home/kristoffer/Dropbox/julia/JuAFEM/examples/homogenization.jl:67
unknown function (ip: 0x7f583f9c44d6)
jl_call_fptr_internal at /home/kristoffer/julia/src/julia_internal.h:326 [inlined]
jl_call_method_internal at /home/kristoffer/julia/src/julia_internal.h:345 [inlined]
jl_apply_generic at /home/kristoffer/julia/src/gf.c:2225