neurotools.obsolete.gpu.cl.function module
Functions to make creation of GPU functions more succinct and compact. Also contains generic routines for manipulating Cl source objects.
- neurotools.obsolete.gpu.cl.function.format(code)[source]
This is a kernel source auto-formatter. It mostly just does auto-indent
- neurotools.obsolete.gpu.cl.function.printKernel(code)[source]
This prints out a kernel source with line numbers
- neurotools.obsolete.gpu.cl.function.guessGPUType(arg)[source]
At the moment, this returns numpy.float32 for Python floats and numpy.int32 for python integers, and is otherwise undefined
- neurotools.obsolete.gpu.cl.function.toGPUType(arg)
A little wrapper to auto-cast floats/ints to respective numpy datatypes for use on the GPU. This functionality probably exists elsewhere
- neurotools.obsolete.gpu.cl.function.insert_global(s)
- neurotools.obsolete.gpu.cl.function.kernel(header, code, other=None)[source]
This is my easy kernel wrapper. This function accepts a header ( the list of arguments ), a body ( the core of the loop ), and optionally a block of helper function code. The core loop should reference “tid” as the thread index variable. The distribution of threads on the GPU is automatically managed.