Skip to content

Instantly share code, notes, and snippets.

import numpy
import pycuda.autoinit
import pycuda.driver as drv
from pycuda.compiler import SourceModule
from pycuda.gpuarray import to_gpu
mod = SourceModule("""
typedef struct _pair
{
@fjarri
fjarri / perf.jl
Last active August 29, 2015 13:57
function add(A,B,reps)
for i in 1:reps
C = A + B
end
end
function add_bc(A,B,reps)
for i in 1:reps
C = A .+ B
end
function test(f)
tmin = 1e10
for i in 1:5
t = time()
f()
t = time() - t
if t < tmin
tmin = t
end
end