提交 21e3415f authored 作者: Frederic's avatar Frederic

Add support for SclarOp.c_support_code in GpuElemwise.

This make this test work. It was crashing during the compilation: THEANO_FLAGS=device=gpu,floatX=float32 theano-nose theano/tensor/tests/test_basic.py:PsiTester
上级 d79b7647
......@@ -864,7 +864,7 @@ nd_collapse_[i]=0;
return defines + kernels
def c_support_code(self):
raise gof.utils.MethodNotDefined()
return self.scalar_op.c_support_code()
def c_code(self, node, nodename, inputs, outputs, sub):
d = dict(sub)
......
......@@ -220,9 +220,16 @@ class Psi(UnaryScalarOp):
def c_support_code(self):
return (
"""
// For GPU support
#ifdef __CUDACC__
#define DEVICE __device__
#else
#define DEVICE
#endif
#ifndef _PSIFUNCDEFINED
#define _PSIFUNCDEFINED
double _psi(double x){
DEVICE double _psi(double x){
/*taken from
Bernardo, J. M. (1976). Algorithm AS 103:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论