Skip to content

Instantly share code, notes, and snippets.

View kose-y's full-sized avatar

Seyoon Ko kose-y

View GitHub Profile
@kose-y
kose-y / springer-free-maths-books.md
Created December 29, 2015 16:43 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kose-y
kose-y / cholupdate.py
Created May 5, 2016 13:44 — forked from mattjj/cholupdate.py
cholesky updates and downdates
from __future__ import division
import numpy as np
from numpy.random import randn
from scipy.linalg.blas import drot, drotg
# references for updates:
# - Golub and van Loan (4th ed.) Section 6.5.4
# - http://mathoverflow.net/questions/30162/is-there-a-way-to-simplify-block-cholesky-decomposition-if-you-already-have-deco
#
# references for downdates:
@kose-y
kose-y / jupyterhub
Created February 13, 2017 14:02
Jupyterhub init.d script. Put this script in /etc/init.d
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@kose-y
kose-y / bitonic-sort.jl
Created August 7, 2020 01:46
CUDA bitonic sort with Julia
# Code based on: https://discourse.julialang.org/t/gpu-sort-wip-gpu-1000x-faster-than-cpu-i-must-be-doing-something-wrong/20310/4
# bitonic sorts a vector of any length.
using CUDA
function bisort!(shared, j, k)
tid = UInt(((blockIdx().x - 1) * blockDim().x + threadIdx().x)-1)
ixj = tid⊻UInt(j)
if ixj > tid
if (tid & k) == 0
if shared[tid+1] > shared[ixj+1]
tmp = shared[ixj+1]
@kose-y
kose-y / merge-sort.jl
Created August 7, 2020 01:48
CUDA merge sort with Julia
using CUDA
function gpu_bottomUpMerge!(source, dest, first, middle, last)
i = first
j = middle
for k = first:last
if i < middle && (j > last || source[i] < source[j])
dest[k] = source[i]
i += 1
else
dest[k] = source[j]