Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7c12d1e3
提交
7c12d1e3
authored
3月 05, 2010
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add comments to make it easier to trace back C implementations of Python functions.
上级
50a61b52
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
47 行增加
和
42 行删除
+47
-42
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+47
-42
没有找到文件。
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
7c12d1e3
...
@@ -565,6 +565,8 @@ __global__ void kAdd_contiguous(float* a, float* b, float* dest, unsigned int nu
...
@@ -565,6 +565,8 @@ __global__ void kAdd_contiguous(float* a, float* b, float* dest, unsigned int nu
dest[i] = a[i] + b[i];
dest[i] = a[i] + b[i];
}
}
}
}
// Will be called by __add__ in Python
static PyObject *
static PyObject *
CudaNdarray_add(PyObject* py_self, PyObject * py_other)
CudaNdarray_add(PyObject* py_self, PyObject * py_other)
{
{
...
@@ -659,6 +661,7 @@ __global__ void k_iAdd_4(const int d0, const int d1, const int d2, const int d3,
...
@@ -659,6 +661,7 @@ __global__ void k_iAdd_4(const int d0, const int d1, const int d2, const int d3,
/*
/*
* We need this inplace Add to support IncSubTensor
* We need this inplace Add to support IncSubTensor
*/
*/
// Will be called by __iadd__ in Python
static PyObject *
static PyObject *
CudaNdarray_inplace_add(PyObject* py_self, PyObject * py_other)
CudaNdarray_inplace_add(PyObject* py_self, PyObject * py_other)
{
{
...
@@ -827,52 +830,52 @@ CudaNdarray_inplace_add(PyObject* py_self, PyObject * py_other)
...
@@ -827,52 +830,52 @@ CudaNdarray_inplace_add(PyObject* py_self, PyObject * py_other)
static PyNumberMethods CudaNdarrayNumberMethods =
static PyNumberMethods CudaNdarrayNumberMethods =
{
{
(binaryfunc)CudaNdarray_add, //binaryfunc nb_add;
(binaryfunc)CudaNdarray_add, //binaryfunc nb_add;
__add__
0, //binaryfunc nb_subtract;
0, //binaryfunc nb_subtract;
__sub__
0, //binaryfunc nb_multiply;
0, //binaryfunc nb_multiply;
__mul__
0, //binaryfunc nb_divide;
0, //binaryfunc nb_divide;
__div__
0, //binaryfunc nb_remainder;
0, //binaryfunc nb_remainder;
__mod__
0, //binaryfunc nb_divmod;
0, //binaryfunc nb_divmod;
__divmod__
0, //ternaryfunc nb_power;
0, //ternaryfunc nb_power;
__pow__
0, //unaryfunc nb_negative;
0, //unaryfunc nb_negative;
__neg__
0, //unaryfunc nb_positive;
0, //unaryfunc nb_positive;
__pos__
0, //unaryfunc nb_absolute;
0, //unaryfunc nb_absolute;
__abs__
0, //inquiry nb_nonzero; /* Used by PyObject_IsTrue */
0, //inquiry nb_nonzero;
__nonzero__
/* Used by PyObject_IsTrue */
0, //unaryfunc nb_invert;
0, //unaryfunc nb_invert;
__invert__
0, //binaryfunc nb_lshift;
0, //binaryfunc nb_lshift;
__lshift__
0, //binaryfunc nb_rshift;
0, //binaryfunc nb_rshift;
__rshift__
0, //binaryfunc nb_and;
0, //binaryfunc nb_and;
__and__
0, //binaryfunc nb_xor;
0, //binaryfunc nb_xor;
__xor__
0, //binaryfunc nb_or;
0, //binaryfunc nb_or;
__or__
0, //coercion nb_coerce; /* Used by the coerce() function */
0, //coercion nb_coerce;
__coerce__
/* Used by the coerce() function */
0, //unaryfunc nb_int;
0, //unaryfunc nb_int;
__int__
0, //unaryfunc nb_long;
0, //unaryfunc nb_long;
__long__
0, //unaryfunc nb_float;
0, //unaryfunc nb_float;
__float__
0, //unaryfunc nb_oct;
0, //unaryfunc nb_oct;
__oct__
0, //unaryfunc nb_hex;
0, //unaryfunc nb_hex;
__hex__
/* Added in release 2.0 */
/* Added in release 2.0 */
(binaryfunc)CudaNdarray_inplace_add, //binaryfunc nb_inplace_add;
(binaryfunc)CudaNdarray_inplace_add, //binaryfunc nb_inplace_add;
__iadd__
0, //binaryfunc nb_inplace_subtract;
0, //binaryfunc nb_inplace_subtract;
__isub__
0, //binaryfunc nb_inplace_multiply;
0, //binaryfunc nb_inplace_multiply;
__imul__
0, //binaryfunc nb_inplace_divide;
0, //binaryfunc nb_inplace_divide;
__idiv__
0, //binaryfunc nb_inplace_remainder;
0, //binaryfunc nb_inplace_remainder;
__imod__
0, //ternaryfunc nb_inplace_power;
0, //ternaryfunc nb_inplace_power;
__ipow__
0, //binaryfunc nb_inplace_lshift;
0, //binaryfunc nb_inplace_lshift;
__ilshift__
0, //binaryfunc nb_inplace_rshift;
0, //binaryfunc nb_inplace_rshift;
__irshift__
0, //binaryfunc nb_inplace_and;
0, //binaryfunc nb_inplace_and;
__iand__
0, //binaryfunc nb_inplace_xor;
0, //binaryfunc nb_inplace_xor;
__ixor__
0, //binaryfunc nb_inplace_or;
0, //binaryfunc nb_inplace_or;
__ior__
/* Added in release 2.2 */
/* Added in release 2.2 */
0, //binaryfunc nb_floor_divide;
0, //binaryfunc nb_floor_divide;
__floordiv__
0, //binaryfunc nb_true_divide;
0, //binaryfunc nb_true_divide;
__truediv__
0, //binaryfunc nb_inplace_floor_divide;
0, //binaryfunc nb_inplace_floor_divide;
__ifloordiv__
0, //binaryfunc nb_inplace_true_divide;
0, //binaryfunc nb_inplace_true_divide;
__itruediv__
#if PY_MINOR_VERSION > 4
#if PY_MINOR_VERSION > 4
/* Added in release 2.5 */
/* Added in release 2.5 */
0 //unaryfunc nb_index;
0 //unaryfunc nb_index;
__index__
#endif
#endif
};
};
...
@@ -881,6 +884,7 @@ static PyNumberMethods CudaNdarrayNumberMethods =
...
@@ -881,6 +884,7 @@ static PyNumberMethods CudaNdarrayNumberMethods =
// Mapping protocol
// Mapping protocol
/////////////////////
/////////////////////
// Will by called by __len__ in Python
static Py_ssize_t
static Py_ssize_t
CudaNdarray_len(PyObject * py_self)
CudaNdarray_len(PyObject * py_self)
{
{
...
@@ -895,6 +899,7 @@ CudaNdarray_len(PyObject * py_self)
...
@@ -895,6 +899,7 @@ CudaNdarray_len(PyObject * py_self)
}
}
}
}
// Will by called by __getitem__ in Python
static PyObject *
static PyObject *
CudaNdarray_Subscript(PyObject * py_self, PyObject * key)
CudaNdarray_Subscript(PyObject * py_self, PyObject * key)
{
{
...
@@ -1119,9 +1124,9 @@ CudaNdarray_Subscript(PyObject * py_self, PyObject * key)
...
@@ -1119,9 +1124,9 @@ CudaNdarray_Subscript(PyObject * py_self, PyObject * key)
}
}
PyMappingMethods CudaNdarrayMappingMethods = {
PyMappingMethods CudaNdarrayMappingMethods = {
CudaNdarray_len, //lenfunc mp_length;
CudaNdarray_len, //lenfunc mp_length;
__len__
CudaNdarray_Subscript, //binaryfunc mp_subscript;
CudaNdarray_Subscript, //binaryfunc mp_subscript;
__getitem__
0, //objobjargproc mp_ass_subscript;
0, //objobjargproc mp_ass_subscript;
__setitem__
};
};
////////////////////
////////////////////
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论