neurotools.obsolete.gpu.cu.logic module

This module contains GPU wrappers to perform boolean logic in parallel. These functions very much need work, since they basically use Iverson’s convention, but with floats, such that 0.0f = false, 1.0f=true. Nevertheless I have found these little functions quite useful in their present form in some circumstances

neurotools.obsolete.gpu.cu.logic.gpult(x)

lambda x:gpumap(“$<%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpugt(x)

lambda x:gpumap(“$>%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpueq(x)

lambda x:gpumap(“$>%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpuneq(x)

lambda x:gpumap(“$!=%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpulteq(x)

lambda x:gpumap(“$<=%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpugteq(x)

lambda x:gpumap(“$>=%f?1:0”%x)

neurotools.obsolete.gpu.cu.logic.gpunot(v)

gpumap(“$<1.0f?1:0”)

neurotools.obsolete.gpu.cu.logic.gpuyes(v)

gpumap(“$<1.0f?0:1”)

neurotools.obsolete.gpu.cu.logic.gpuand(v, w)

gpubinaryeq(‘($x+$y)>=2.0f?1.0f:0.0f’)

neurotools.obsolete.gpu.cu.logic.gpunor(v, w)

gpubinaryeq(‘($x+$y)<=0.0f?1.0f:0.0f’)

neurotools.obsolete.gpu.cu.logic.gpuhzero(a, b)

lambda a,b:gpumap(“$>=%f&&$<%d?$:0”%(a,b))

neurotools.obsolete.gpu.cu.logic.gpurange(a, b)

lambda a,b:gpumap(“$>=%f&&$<%d?1:0”%(a,b))