Skip to content

Instantly share code, notes, and snippets.

View hyunsik's full-sized avatar
🏠
Working from home

Hyunsik Choi hyunsik

🏠
Working from home
View GitHub Profile
@kaushikcfd
kaushikcfd / MLIR-From-C.md
Last active November 19, 2021 13:46
Calling MLIR kernels from C

Step 1. Lower axpy.mlir to axpy.ll

mlir-opt -lower-affine -convert-loop-to-std -convert-std-to-llvm='emit-c-wrappers=1' axpy.mlir | mlir-translate --mlir-to-llvmir -o axpy.ll

Step 2. Get bitcode for the caller C.

clang -emit-llvm call_axpy.c -S -o call_axpy.bc
@FrankSpierings
FrankSpierings / README.md
Last active January 20, 2024 20:45
Linux Container Escapes and Hardening
@hyunsik
hyunsik / make_release
Last active December 26, 2015 18:09
A script to generate a Tajo release candidate
#!/bin/bash
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] || [ -z $4 ]; then
echo "usage: ../make_release src_dir tag_name version rc_num"
exit -1;
fi
cd $1
CANDIDATE_TAG=`git tag --list $2`
if [ -z $CANDIDATE_TAG ]; then
@asmaier
asmaier / KafkaProducerIT.java
Last active March 23, 2022 11:16
Simple java junit test of an apache kafka producer (works with Kafka 0.11.0.2) (see also https://github.com/asmaier/mini-kafka)
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
import org.I0Itec.zkclient.ZkClient;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
@hyunsik
hyunsik / sum_unrolled.c
Created April 3, 2013 18:44
sum_unrolled.c
int sum_unrolled( int n, int *a )
{
int sum = 0;
/* do the body of the work in a faster unrolled loop */
for( int i = 0; i < n/4*4; i += 4 )
{
sum += a[i+0];
sum += a[i+1];
sum += a[i+2];
@rygorous
rygorous / gist:4172889
Created November 30, 2012 00:28
SSE/AVX matrix multiply
#include <immintrin.h>
#include <intrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
union Mat44 {
float m[4][4];
__m128 row[4];
};
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
; A Records
@ 3600 IN A 63.246.20.93
eggplant 3600 IN A 140.211.15.101
cucumber 3600 IN A 63.246.20.93
spinach 3600 IN A 173.203.60.151
lettuce 3600 IN A 140.211.15.121
cabbage 3600 IN A 140.211.15.130
lists 3600 IN A 140.211.166.34
; CNAME Records