提交 177e02c4 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

paste start of new kernel from Fred

上级 9438d632
...@@ -3190,6 +3190,18 @@ static __global__ void k_copy_1d(const int N, const float * x, const int sx, flo ...@@ -3190,6 +3190,18 @@ static __global__ void k_copy_1d(const int N, const float * x, const int sx, flo
} }
} }
static __global__ void k_copy_4d(const int N1, N2, N3, N4, const float
* x, const int sx1, sx2, sx3, sx4, float * y, const int sy1, ...)
{
for (int i = threadIdx.x; i < N3; i += blockDim.x)
{
for (int j = threadIdx.y; j < N4; j += blockDim.y)
{
y[gridDim.x*sy1 + gridDim.y*sy2 + i*sy3 + j*sy4] = x[...];
}
}
}
//copy from other into self //copy from other into self
int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self, int CudaNdarray_CopyFromCudaNdarray(CudaNdarray * self,
const CudaNdarray * other, const CudaNdarray * other,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论