[GPU] bug fix

This commit is contained in:
Zhenwen Dai 2014-04-02 11:22:56 +01:00
parent c20cd69c4e
commit 73f690a4c9
2 changed files with 3 additions and 3 deletions

View file

@ -410,7 +410,7 @@ class PSICOMP_SSRBF(object):
dpsi1_dl_gpu = self.gpuCache['dpsi1_dl_gpu'] dpsi1_dl_gpu = self.gpuCache['dpsi1_dl_gpu']
dpsi2_dl_gpu = self.gpuCache['dpsi2_dl_gpu'] dpsi2_dl_gpu = self.gpuCache['dpsi2_dl_gpu']
psi1_comb_gpu = self.gpuCache['psi1_neq_gpu'] psi1_comb_gpu = self.gpuCache['psi1_neq_gpu']
psi2_comb_gpu = self.gpuCache['psi1_neq_gpu'] psi2_comb_gpu = self.gpuCache['psi2_neq_gpu']
grad_dl_gpu = self.gpuCache['grad_l_gpu'] grad_dl_gpu = self.gpuCache['grad_l_gpu']
# variance # variance

View file

@ -28,8 +28,8 @@ try:
# log(1.0-X) # log(1.0-X)
logOne = ElementwiseKernel("double *in, double *out", "out[i] = log(1.-in[i])", "logOne_element") logOne = ElementwiseKernel("double *in, double *out", "out[i] = log(1.-in[i])", "logOne_element")
# multiplication with broadcast on the last dimension (a has to be smaller than b) # multiplication with broadcast on the last dimension
mul_bcast = ElementwiseKernel("double *out, double *a, double *b, int a_size", "out[i] = b[i]*a[i % a_size ]", "mul_bcast") mul_bcast = ElementwiseKernel("double *out, double *shorter, double *longer, int shorter_size", "out[i] = longer[i]*shorter[i%shorter_size]", "mul_bcast")
# sum through the middle dimension (size_2) of a 3D matrix (size_1, size_2, size_3) # sum through the middle dimension (size_2) of a 3D matrix (size_1, size_2, size_3)
sum_axis = ElementwiseKernel("double *out, double *in, int size_1, int size_2", "out[i] += sum_axis_element(in, size_1, size_2, i)", "sum_axis",preamble=""" sum_axis = ElementwiseKernel("double *out, double *in, int size_1, int size_2", "out[i] += sum_axis_element(in, size_1, size_2, i)", "sum_axis",preamble="""