From 6f3c27007ab6e1a8c3346fbd9a2b1cd5003e6759 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Sat, 11 Jun 2011 15:58:37 -0400 Subject: [PATCH] Remove outdated MemBench stuff --- cuburn/code/iter.py | 46 --------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/cuburn/code/iter.py b/cuburn/code/iter.py index b714569..4e96c81 100644 --- a/cuburn/code/iter.py +++ b/cuburn/code/iter.py @@ -240,49 +240,3 @@ def render(features, cps): abuf = cuda.from_device_like(obufd, abuf) return abuf, dbuf - - -# TODO: find a better place to stick this code -class MemBench(HunkOCode): - decls = """ -__shared__ uint32_t coord[512]; -""" - - defs_tmpl = Template(""" -__global__ -void iter{{W}}(mwc_st *mwcs, uint32_t *buf) { - mwc_st rctx = mwcs[gtid()]; - - int mask = (1 << {{W}}) - 1; - int smoff = threadIdx.x >> {{W}}; - int writer = (threadIdx.x & mask) == 0; - - for (int i = 0; i < 1024 * 32; i++) { - if (writer) - coord[smoff] = mwc_next(&rctx) & 0x7ffffff; // 512MB / 4 bytes - __syncthreads(); - uint32_t *dst = buf + (coord[smoff] + (threadIdx.x & mask)); - uint32_t val = mwc_next(&rctx); - asm("st.global.u32 [%0], %1;" :: "l"(dst), "r"(val)); - } -} -""") - - @property - def defs(self): - return '\n'.join([self.defs_tmpl.substitute(W=w) for w in range(8)]) - -def membench(): - code = assemble_code(BaseCode, mwc.MWC, MemBench()) - mod = SourceModule(code) - - buf = cuda.mem_alloc(512 << 20) - seeds = mwc.MWC.make_seeds(512 * 21) - - for w in range(8): - fun = mod.get_function('iter%d' % w) - print 'Launching with W=%d' % w - t = fun(cuda.In(seeds), buf, - block=(512, 1, 1), grid=(21, 1), time_kernel=True) - print 'Completed in %g' % t -