Skip to content

Instantly share code, notes, and snippets.

@chriselrod
chriselrod / sumoversizes.jl
Created Dec 25, 2020
Sum over size range
View sumoversizes.jl
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)
View glibc_exp.jl
#= 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 Feb 12, 2018
Quant Econ - Numba and Julia
View quant_econ_julia.ipynb
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 Sep 6, 2017
LAPACK vs LinearAlgebra.jl
View LinearAlgebraBenchmarks.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