neurotools.obsolete.gpu.cu.gpufun module
This module contains generically useful GPU clones of several simple functions. Most of these use the orix.function utility library to succinctly wrap GPU functions into python wrapped kernel calls. Note that elementwise c=a op b for op in {+,-,*,/,^} are supported as overloaded operators for gpuarrays and are not duplicated here. Much of this is somewhat useless wrapping of GPUArray and pycuda.cumath into other syntax without adding new functionality.
- neurotools.obsolete.gpu.cu.gpufun.gpulcomb(a, b, c, d)
Wraps a linear combination operator. gpulcomb(weight1,weight2,data1,data2) will return the elementwise linear combination weight1*data1[i]+weight2*data2[i]. Succesive calls do not cause recompiliation of the kernel
- neurotools.obsolete.gpu.cu.gpufun.gpumean(v)
Average of GPU array
- neurotools.obsolete.gpu.cu.gpufun.gpunpdf(m, s)
Creates a normal distribution PDF elementwise evaluator. E.g. gpupdf(0,1) will create a zero-mean, unit standard deviation normal distribution. gpupdf(0,1)(data) will evaluate the PDF at all elements of data and return the results in a new array. New calls to gpupdf do cause compiliation of new kernel code, but kernels are memoized so a give (mean,standard_deviation) kernel will only be compiled once
- neurotools.obsolete.gpu.cu.gpufun.gpulogpdf(m, s)
This creates an element-wise kernel evaluating the natural log of the PDF of a normal distribtion. E.g. gpulogpdf(0,1) creates an element-wise operator that evaluates the log of the probability for a zero-mean unit standard deviation normal distribution.
- neurotools.obsolete.gpu.cu.gpufun.gpuhill(x)
Hill equation for noncooperative binding : f(x)=x/(x+c)
- neurotools.obsolete.gpu.cu.gpufun.gpurandf(n)
Wrapper for pycuda.curandom.rand(n)
- neurotools.obsolete.gpu.cu.gpufun.gpuuniform(a, b)
Curried GPU uniform random number generator. For example, gpuuniform(0,1) will create a function that returns uniform random numbers over [0,1). gpuuniform(0,1)(100) would create a GPU array of 100 draws from a uniform [0,1) distribution
- neurotools.obsolete.gpu.cu.gpufun.gpurandexp(n)
Generates exponentially distributed random numbers on the GPU