Skip to content

Instantly share code, notes, and snippets.

Avatar
☀️

Ilia Ki 9il

☀️
  • Dubai
View GitHub Profile
View test.d
/+dub.sdl:
dependency "mir-lapack" version="~>1.2.1"
dependency "mir-algorithm" version="~>3.5.0-alpha12"
+/
import mir.ndslice.slice;
import mir.rc.array;
import mir.ndslice.allocation;
import std.traits: Unqual;
import mir.internal.utility: isComplex, realType;
import mir.ndslice.dynamic: transposed;
View mir-rework.d
/+dub.sdl:
dependency "mir-random" path="./"
+/
import mir.math.common;
import mir.ndslice.sorting;
import mir.random;
import mir.random.algorithm;
import mir.random.variable;
enum n = 30; // sample size
View minor-fix.d
/+dub.sdl:
dependency "mir-random" path="./"
+/
import std.algorithm;
import std.math;
import std.random;
import std.range : array, iota, take;
import std.stdio;
import mir.ndslice.sorting;
import mir.random.algorithm;
View copy.d
import mir.ndslice.slice;
auto copySlow(CanonicalMatrix!ubyte f, CanonicalMatrix!ubyte t)
{
assert(f.shape == t.shape);
foreach(i; 0..f.length!0)
foreach(j; 0..f.length!1)
t[i, j] = f[i, j];
}
View gemm_micro_kernel_avx512f_llvm40.s
; ldc2 -linkonce-templates -betterC -O -release -mcpu=skylake -mattr=+avx512f -output-s gemm_micro_kernel.d
; export extern(C)
; auto dot_reg_basic_generic(
; const(__vector(float[16])[3][1])* a,
; const(float[1][8])* b,
; size_t length,
; ref __vector(float[16])[3][1][8] c,
; )
; {
; return dot_reg_basic(a, b, length, c);
View gemm_micro_kernel_broadwell_llvm40.s
.section __TEXT,__text,regular,pure_instructions
.globl _dot_reg_basic_generic
.p2align 4, 0x90
_dot_reg_basic_generic:
.cfi_startproc
vxorps %ymm14, %ymm14, %ymm14
vxorps %ymm1, %ymm1, %ymm1
vxorps %ymm9, %ymm9, %ymm9
vxorps %ymm2, %ymm2, %ymm2
vxorps %ymm7, %ymm7, %ymm7
View gemm_micro_kernel_broadwell_llvm39.s
.section __TEXT,__text,regular,pure_instructions
.globl _dot_reg_basic_simple
.p2align 4, 0x90
_dot_reg_basic_simple:
.cfi_startproc
vxorps %ymm0, %ymm0, %ymm0
vxorps %ymm1, %ymm1, %ymm1
vxorps %ymm2, %ymm2, %ymm2
vxorps %ymm3, %ymm3, %ymm3
vxorps %ymm4, %ymm4, %ymm4
View gemm_micro_kernel.d
// ldc2 -linkonce-templates -betterC -O -release -mcpu=broadwell -output-s gemm_micro_kernel.d
import std.traits;
import std.meta;
import ldc.attributes;
import ldc.intrinsics;
version = GLAS_PREFETCH;
enum prefetchShift = 512;
@fastmath:
View gemm_micro_kernel_simple.d
// ldc2 -linkonce-templates -betterC -O -release -mcpu=broadwell -output-s gemm_micro_kernel_simple.d
import ldc.attributes;
import ldc.intrinsics;
enum prefetchShift = 512;
@fastmath:
export extern(C) nothrow @nogc @fastmath
auto dot_reg_basic_simple(
View mir_glas_gemm_micro_kernel.ll
; ModuleID = 'source/mir/glas/internal/gemm.d'
source_filename = "source/mir/glas/internal/gemm.d"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"
%0 = type opaque
%1 = type opaque
%2 = type { i32, i32, i64, [2 x %object.ModuleInfo*], [23 x i8] }
%object.ModuleInfo = type { i32, i32 }
%ModuleReference = type { %ModuleReference*, %object.ModuleInfo* }