Skip to content

Instantly share code, notes, and snippets.

🔨
Hacking on hdf5-rust

Ivan Smirnov aldanor

🔨
Hacking on hdf5-rust
Block or report user

Report or block aldanor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aldanor
aldanor / np-dot-mkl-gemm.md
Last active Jun 25, 2019
NumPy dot() vs MKL ?gemm benchmarks
View np-dot-mkl-gemm.md

NumPy np.dot() vs MKL dgemm() (+ strict MKL CNR)

  • The tests were run on 4 independent machines with the same specs
  • Each machine has multiple Xeon Platinum 8168 CPUs
  • Python: 3.6, NumPy: 1.16, Intel MKL: 2019.4
  • Either MKL_ENABLE_INSTRUCTIONS or MKL_CBWR was set for each test
  • MKL_DYNAMIC was set to FALSE for all tests
  • MKL_NUM_THREADS was set to either 1, 8 or 16
  • Each test was run for float32 (f4) and float64 (f8) inputs
  • All inputs were pre-aligned to 512-bit boundary (for AVX-512)
View pandas-bench.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aldanor
aldanor / playground.rs
Created Feb 20, 2019 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#[macro_use]
extern crate error_chain; // 0.12.0
extern crate num_traits; // 0.2.6
use num_traits::AsPrimitive;
use std::fmt::Debug;
error_chain! {
types { TractError, TractErrorKind, TractResultExt, TractResult; }
foreign_links {}
@aldanor
aldanor / chunkshape.rs
Last active Dec 28, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View chunkshape.rs
pub type Ix = usize;
pub fn estimate_chunkshape(shape: &[Ix], itemsize: usize, base_kb: usize) -> Vec<Ix> {
if shape.is_empty() {
return vec![1];
}
let size: Ix = shape.iter().product();
let size_mb = ((size * itemsize) as f64) / ((1 << 20) as f64);
let basesize = base_kb << 10;
let pow2 = size_mb.max(1.).min((1 << 23) as _).log10().trunc();
@aldanor
aldanor / playground.rs
Created Oct 29, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#![allow(dead_code)]
use std::cell::RefCell;
use std::rc::Rc;
trait Stream<'a> {
type Item: 'a + ?Sized;
fn subscribe<F>(self, f: F) where F: FnMut(&Self::Item) + 'a;
@aldanor
aldanor / playground.rs
Created Oct 26, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
use std::cell::RefCell;
use std::rc::Rc;
trait Observer<T> {
fn on_next(&mut self, item: T);
}
impl<T, F> Observer<T> for F where F: FnMut(T) -> () {
fn on_next(&mut self, item: T) {
self(item)
@aldanor
aldanor / playground.rs
Created Oct 26, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
use std::cell::RefCell;
use std::rc::Rc;
trait Observer<T> {
fn on_next(&mut self, item: T);
}
impl<T, F> Observer<T> for F where F: FnMut(T) -> () {
fn on_next(&mut self, item: T) {
self(item)
@aldanor
aldanor / playground.rs
Created Oct 23, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
trait Observer<T> {
fn on_next(&mut self, item: Option<T>);
}
impl<T, F> Observer<T> for F where F: FnMut(Option<T>) {
fn on_next(&mut self, item: Option<T>) {
self(item)
}
}
View .ycm_extra_conf.py
import json
import os
import shlex
import sys
def extract_includes():
cwd = os.getcwd()
cc1 = os.path.join(cwd, 'cmake', 'compile_commands.json')
cc2 = os.path.join(cwd, 'compile_commands.json')
@aldanor
aldanor / libpcap_versions.py
Last active Mar 20, 2017
libpcap versions
View libpcap_versions.py
import collections
import fnmatch
import git
import os
import pprint
import pycparser
import subprocess
import tempfile
repo = git.Repo()
You can’t perform that action at this time.