Skip to content

Instantly share code, notes, and snippets.

Tim Besard maleadt

Block or report user

Report or block maleadt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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>
#
View crash.jl
# The Computer Language Benchmarks Game
# binary-trees benchmark
# http://shootout.alioth.debian.org/u32/performance.php?test=binarytrees
#
# Ported from an OCaml version
abstract type BTree end
mutable struct Empty <: BTree
end
View lattice.jl
using LinearAlgebra, Statistics
using StaticArrays, Parameters
using CUDAdrv, CUDAnative
struct Lattice{D,Q,T}
δt :: T
δx :: T
τ :: T
e :: Vector{SVector{D,T}}
w :: Vector{T}
View forwarddiff.jl
module Loop
using ForwardDiff: Dual, Partials
function seed!(duals::AbstractArray{Dual{T,V,N}}, x,
seed::Partials{N,V} = zero(Partials{N,V})) where {T,V,N}
for i in eachindex(duals)
duals[i] = Dual{T,V,N}(x[i], seed)
end
return duals
end
@maleadt
maleadt / .gitignore
Last active Aug 31, 2018
bugpoint demo
You can’t perform that action at this time.