Skip to content

Instantly share code, notes, and snippets.

View ysh329's full-sized avatar
💫
in a crazy daze

ysh329

💫
in a crazy daze
View GitHub Profile
@aniketp
aniketp / clang-format
Created June 3, 2018 21:45 — forked from shivansh/clang-format
clang-format based on FreeBSD's style(9)
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 0
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
@nadavrot
nadavrot / Matrix.md
Last active May 8, 2024 18:53
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@MarsMSJ
MarsMSJ / JetsonTK1_nvcc_fatal_computer_60.md
Last active August 14, 2018 13:30
Jetson TK1 - caffe compilation issue: nvcc fatal : Unsupported gpu architecture 'compute_60'

Jetson TK1 - caffe compilation issue: nvcc fatal : Unsupported gpu architecture 'compute_60'

Summary

I'm posting here a detailed summary of the problem and the situation with the Jetson TK1 board and compiling the final caffe release. The final caffe release requires cudnn v.5. If you attempt to compile on the Jetson TK1 board you will give an error from nvcc saying "Unsupported gpu architecture". I describe the

Problem

On the Jetson TK1 if you clone the final caffe release and compile:
make all -j 4

The nvcc compiler will show the following error:

@KellenSunderland
KellenSunderland / Dockerfile
Created September 25, 2017 16:38
MXNet Arm Cross Compilation Config and Dockerfile to build a relatively portable armv6 linux binary.
# -*- mode: dockerfile -*-
# Dockerfile to build libmxnet.so for armv6
FROM dockcross/linux-armv6
ENV ARCH armv6l
ENV BUILD_OPTS "USE_BLAS=openblas USE_SSE=0 USE_OPENCV=0"
ENV CC /usr/bin/arm-linux-gnueabihf-gcc
ENV CXX /usr/bin/arm-linux-gnueabihf-g++
ENV FC /usr/bin/arm-linux-gnueabihf-gfortran
ENV HOSTCC gcc
@zhreshold
zhreshold / vgg_depthwise.py
Created April 26, 2017 19:54
Benchmark simulation for vgg with depth-wise convolution
"""References:
Simonyan, Karen, and Andrew Zisserman. "Very deep convolutional networks for
large-scale image recognition." arXiv preprint arXiv:1409.1556 (2014).
"""
import mxnet as mx
def depthwise_conv(data, kernel, pad, num_filter, name, num_group):
conv = mx.symbol.Convolution(data=data, kernel=kernel, pad=pad,
num_filter=num_group, name=name+'_depthwise', num_group=num_group)

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@brickgao
brickgao / cpplint_pre_commit_hook.sh
Last active March 20, 2023 06:52
cpplint pre-commit hook
#!/bin/sh
#
# Modified from http://qiita.com/janus_wel/items/cfc6914d6b7b8bf185b6
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@Smouking
Smouking / half.h
Created November 24, 2015 14:48
c++ half float
// half - IEEE 754-based half-precision floating point library.
//
// Copyright (c) 2012-2013 Christian Rau <rauy@users.sourceforge.net>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.