Skip to content

Instantly share code, notes, and snippets.

View scivision's full-sized avatar
💭
I will be slow to respond.

scivision

💭
I will be slow to respond.
View GitHub Profile
@scivision
scivision / edisonBTsound
Created December 30, 2015 05:47
Bluetooth sound on Intel Edison
opkg install alsa-utils kernel-module-snd-usb-audio bluez5 gstreamer pulseaudio
opkg install kernel-module-ftdi-sio
rfkill unblock bluetooth
bluetoothctl
power on
agent on
scan on
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
// This is a "chunk" of characters that we can pull out and handle
// at one time. Since arrays in C are just collections of bytes we
// can iterate through a char array and pretend it was an int array.
// Using this union you can still get at the individual characters.

Keybase proof

I hereby claim:

  • I am scivision on github.
  • I am michaelhirsch (https://keybase.io/michaelhirsch) on keybase.
  • I have a public key ASBVl-XHulfiM2wIc_VVlWTjcERM88PPv9RxzP3zxX3qhgo

To claim this, I am signing this object:

@scivision
scivision / matmul.log
Last active April 17, 2018 04:42
Python-Performance reuslts
/RunMatmul.py
Fortran -->
GCC version 6.2.0
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=35840 -mtune=broadwell -march=x86-64 -auxbase-strip CMakeFiles/matmul.dir/matmul.f90.o -g -O3 -Wall -Werror=array-bounds -Wextra -Wpedantic
double DGEMM (sec): 0.753308
single SGEMM (sec): 25.260954
double intrinsic (sec): 0.411206
single intrinsic (sec): 0.206234
--> Julia 0.6.2
@scivision
scivision / opencv3-extras-cmake-output-raspi3.txt
Created November 16, 2017 14:43
Cmake OpenCV 3 output for Raspberry Pi 3 on Debian 9 stretch
# Raspberry Pi 3 with Debian 9 stretch
$ cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_IPP=ON -DWITH_TBB=ON -DWITH_EIGEN=ON -DWITH_V4L=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") -DPYTHON_EXECUTABLE=$(which python) -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") ..
-- The CXX compiler identification is GNU 6.3.0
-- The C compiler identification is GNU 6.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
@scivision
scivision / CMakeLists.txt
Last active October 18, 2018 17:08
Minimal Fortran Intel MKL CMake -- assuming you want MKL BLAS
cmake_minimum_required(VERSION 3.1)
project(mytest Fortran)
# NOTE: -fdefault-integer-8 -m64 are crucial for MKL to avoid SIGSEGV at runtime!
add_compile_options(-fdefault-integer-8 -m64)
add_executable(inteld intel_dgemm.f90)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
#--- shell (Ubuntu 17.10, Octave 4.2.1, Python 3.6.4)
pip install oct2py==4.0.6
#--- Python
x=[0.,0,0,0,0,1,1,1,1,0,0,0,0,0]
from oct2py import Oct2Py
with Oct2Py() as oc:
oc.eval('pkg load signal')
y = oc.sgolayfilt(x,3,5)
@scivision
scivision / out-single-thread-2d.log
Last active December 17, 2018 07:34
Gemini failures GNU+MKL
$ ./gemini initialize/test2d/config.ini /tmp/2dt
Process: 0 of: 0 online...
initialize/test2d/config.ini: simulation ymd is: 2013/02/20
start time is: 18000.000
duration is: 300.000
output every: 60.000
...using input data files:
../simulations/zenodo2d/inputs/simsize.dat
../simulations/zenodo2d/inputs/simgrid.dat
../simulations/zenodo2d/inputs/2Dtest_lowres_ICs.dat
@scivision
scivision / 2d_single.log
Created December 17, 2018 07:54
Gemini failures Intel compiler
$ ./gemini initialize/test2d/config.ini /tmp/2dt
Process: 0 of: 0 online...
initialize/test2d/config.ini: simulation ymd is: 2013/02/20
start time is: 18000.000
duration is: 300.000
output every: 60.000
...using input data files:
../simulations/zenodo2d/inputs/simsize.dat
../simulations/zenodo2d/inputs/simgrid.dat
../simulations/zenodo2d/inputs/2Dtest_lowres_ICs.dat
Octave is now configured for x86_64-unknown-linux-gnu
Source directory: .
Installation prefix: /home/thin/.local/octave38
C compiler: gcc -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
C++ compiler: g++ -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
Fortran compiler: gfortran -O
Fortran libraries: -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L. -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lgfortran -lm -lquadmath
Lex libraries:
LIBS: -lm