Skip to content

Instantly share code, notes, and snippets.

View Manifest.toml
# This file is machine-generated - editing it directly is not advised
[[AbstractFFTs]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "0.5.0"
[[AbstractTrees]]
deps = ["Markdown"]
@maleadt
maleadt / sort.jl
Created Apr 13, 2020
GPU sort using dynamic parallelism (WIP, slow)
View sort.jl
using Test
using CUDA
const MAX_DEPTH = 16
const SELECTION_SORT = 32
function selection_sort(data, left, right)
@inbounds for i in left:right
min_val = data[i]
View regular.ll
; ModuleID = 'permutedims!'
source_filename = "permutedims!"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-pc-linux-gnu"
%jl_value_t = type opaque
%jl_array_t = type { i8 addrspace(13)*, i64, i16, i16, i32 }
declare %jl_value_t addrspace(10)* @japi1_checkdims_perm(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32)
@maleadt
maleadt / tdma.jl
Created Jul 25, 2019
batched tdma
View tdma.jl
# experimentation with batched tridiagonal solvers on the GPU for Oceananigans.jl
#
# - reference serial CPU implementation
# - batched GPU implementation using cuSPARSE (fastest)
# - batched GPU implementation based on the serial CPU implementation (slow but flexible)
# - parallel GPU implementation (potentially fast and flexible)
#
# see `test_batched` and `bench_batched`
using LinearAlgebra
@maleadt
maleadt / tdma.jl
Created Jun 6, 2019
Tridiagonal matrix algorithm on the GPU with Julia
View tdma.jl
# experimentation with batched tridiagonal solvers on the GPU for Oceananigans.jl
#
# - reference serial CPU implementation
# - batched GPU implementation using cuSPARSE (fastest)
# - batched GPU implementation based on the serial CPU implementation (slow but flexible)
# - parallel GPU implementation (potentially fast and flexible)
#
# see `test_batched` and `bench_batched`
using CUDAdrv
@maleadt
maleadt / fritzbox.py
Created May 30, 2019
Munin plugin for FritzBox DSL properties
View fritzbox.py
#!/opt/fritzconnection/bin/python2
import sys
from fritzconnection import FritzConnection
if len(sys.argv)>1:
if sys.argv[1]=="config":
print '''
host_name TODO
@maleadt
maleadt / wip.cu
Created Mar 14, 2019
cuda-gdb WIPs
View wip.cu
#include "cuda.h"
#include "cudadebugger.h"
#include <iostream>
#include <pthread.h>
#include <signal.h>
// helpers
CUDBGAPI cudbgAPI;
@maleadt
maleadt / CMakeLists.txt
Created Dec 7, 2018
LLVM symbol renaming PoC
View CMakeLists.txt
if(DEFINED ENV{LOCAL_NAMESPACE})
# NOTE: if localizing the namespace, by rewriting just before linking, we
# really do need to use static linking because we can't (easily)
# rewrite dynamic symbols
# NOTE: the directive below is copied from the Linux rules in
# CMakeDefaultMakeRuleVariables.cmake, and may have to be adjusted for
# your platform
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_SOURCE_DIR}/rewrite_wrapper <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif()
@maleadt
maleadt / julia.dict
Created Nov 20, 2018
AFL dictionary for Julia
View julia.dict
#
# AFL dictionary for Julia
# ------------------------
#
# Contains basic keywords, operators, and some syntax building blocks.
#
# Created by Tim Besard <tim.besard@gmail.com>
#
You can’t perform that action at this time.