Skip to content

Instantly share code, notes, and snippets.

View chriselrod's full-sized avatar

Chris Elrod chriselrod

View GitHub Profile
@chriselrod
chriselrod / sumoversizes.jl
Created December 25, 2020 20:59
Sum over size range
N = iszero(length(ARGS)) ? 64 : parse(Int, last(ARGS));
@show N
using LoopVectorization, Random, BenchmarkTools
x = rand(max(512,N)); y = Vector{Float64}(undef, N);
Ns = shuffle(Base.OneTo(N));
@inline function mysumavx_inline(a)
s = zero(eltype(a))
@avx for i ∈ eachindex(a)
#= Function exp vectorized with AVX-512. KNL and SKX versions.
Copyright (C) 2014-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@chriselrod
chriselrod / quant_econ_julia.ipynb
Created February 12, 2018 00:08
Quant Econ - Numba and Julia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chriselrod
chriselrod / LinearAlgebraBenchmarks.jl
Last active September 6, 2017 01:12
LAPACK vs LinearAlgebra.jl
using BenchmarkTools, LinearAlgebra
#LinearAlgebra code at: https://github.com/andreasnoack/LinearAlgebra.jl
#Install LinearAlgebra via Pkg.clone("https://github.com/andreasnoack/LinearAlgebra.jl")
function gen_pos_def(p::Int)
X = randn( div(3p, 2), p)
S = X' * X
S, Hermitian(S, :L)
end