View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
WORKDIR /root | |
ENV PATH="/root/spack/bin:$PATH" SPACK_COLOR=always | |
# Setup spack and its deps | |
RUN apk add gcc g++ gfortran make file tar curl python3 patch unzip gnupg git xz python3-dev py3-pip linux-headers && \ | |
pip install clingo |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: exef1 exef2 exef3 | |
EI_OSABI:=7 | |
EI_ABIVERSION:=8 | |
EI_PAD:=9 | |
libf1.so: | |
echo 'int f(){ return 1; }' | $(CC) -o $@ -shared -Wl,-soname,$@ -x c - | |
printf '\x0B' | dd of=$@ bs=1 seek=$(EI_OSABI) count=1 conv=notrunc status=none |
View hack-spack-wrapper.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/spack/env/cc b/lib/spack/env/cc | |
index 4d8c4644cb..3c4dcb35a7 100755 | |
--- a/lib/spack/env/cc | |
+++ b/lib/spack/env/cc | |
@@ -384,6 +384,13 @@ while [ $# -ne 0 ]; do | |
other_args+=("$1") | |
fi | |
;; | |
+ -O0,-O1,-O2,-O3,-Os,-Ofast,-O) | |
+ # Always use -O3 |
View harmen_5x8.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vmovups ymm0, ymmword ptr [rsi] | |
vmovups ymm1, ymmword ptr [rsi + 32] | |
vmovups ymm2, ymmword ptr [rsi + 64] | |
vmovups ymm6, ymmword ptr [rsi + 96] | |
vmovups ymm7, ymmword ptr [rsi + 128] | |
movabs rcx, offset .rodata.cst32 | |
mov rax, rdi | |
vmovaps ymm10, ymmword ptr [rcx] | |
vperm2f128 ymm3, ymm0, ymm1, 33 # ymm3 = ymm0[2,3],ymm1[0,1] | |
vperm2f128 ymm5, ymm1, ymm2, 33 # ymm5 = ymm1[2,3],ymm2[0,1] |
View julia.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra, LoopVectorization | |
function error_norm(u::AbstractArray{T}, v::AbstractArray{T}) where T | |
result = T(0) | |
@avx for i = eachindex(u) | |
result += (u[i] - v[i])^2 | |
end | |
return sqrt(result) |
View fast_transpose.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SIMDPirates | |
canonicalize(A) = A | |
canonicalize(A::Union{<:SubArray}) = canonicalize(parent(A)) | |
function version_1!(B::AbstractMatrix{Float64}, A::AbstractMatrix{Float64}) | |
m, n = size(A) | |
Ac = canonicalize(A) |
View _tri_to_diag_2.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra: givensAlgorithm, SymTridiagonal, I, Diagonal | |
using Base: @propagate_inbounds | |
import LinearAlgebra: lmul!, rmul! | |
import Base: Matrix | |
@propagate_inbounds is_offdiagonal_small(H::SymTridiagonal{T}, i::Int, tol = eps(real(T))) where {T} = | |
abs(H.ev[i]) ≤ tol*(abs(H.dv[i]) + abs(H.dv[i+1])) | |
abstract type SmallRotation end |
View tri_to_diag.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra: givensAlgorithm, SymTridiagonal, I, Diagonal | |
using Base: @propagate_inbounds | |
import LinearAlgebra: lmul!, rmul! | |
import Base: Matrix | |
@propagate_inbounds is_offdiagonal_small(H::SymTridiagonal{T}, i::Int, tol = eps(real(T))) where {T} = | |
abs(H.ev[i]) ≤ tol*(abs(H.dv[i]) + abs(H.dv[i+1])) | |
abstract type SmallRotation end |
View givens.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SIMD | |
using BenchmarkTools | |
using Test | |
struct Rot{T} | |
c::T | |
s::T | |
end | |
mul(G::Rot, a, b) = (G.c * a + G.s * b, -G.s * a + G.c * b) |
View sort_cache_by.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Base: getindex, setindex, length, isless | |
struct SortPair{A,B} | |
x::A | |
mapped::B | |
end | |
struct SortCache{A,B,AV,BV} <: AbstractVector{SortPair{A,B}} | |
xs::AV | |
mapped::BV |
NewerOlder