提交 374cdd74 authored 作者: xiaoqie's avatar xiaoqie

style fix

上级 9eb54e01
...@@ -470,6 +470,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(GpuKernelBase, Op): ...@@ -470,6 +470,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(GpuKernelBase, Op):
return [Kernel(code=sio.getvalue(), name=kname, params=params, return [Kernel(code=sio.getvalue(), name=kname, params=params,
flags=flags, objvar=k_var)] flags=flags, objvar=k_var)]
gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx() gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx()
...@@ -599,15 +600,17 @@ class GpuSoftmax(GpuKernelBase, Op): ...@@ -599,15 +600,17 @@ class GpuSoftmax(GpuKernelBase, Op):
ctype = gpuarray.dtype_to_ctype(dtype_sm) ctype = gpuarray.dtype_to_ctype(dtype_sm)
params = [ params = [
gpuarray.SIZE, gpuarray.SIZE, gpuarray.GpuArray, gpuarray.SIZE, gpuarray.SIZE, gpuarray.SIZE,
gpuarray.SSIZE, gpuarray.SSIZE, gpuarray.GpuArray, gpuarray.SIZE, gpuarray.SSIZE, gpuarray.SSIZE gpuarray.GpuArray, gpuarray.SIZE, gpuarray.SSIZE, gpuarray.SSIZE,
gpuarray.GpuArray, gpuarray.SIZE, gpuarray.SSIZE, gpuarray.SSIZE
] ]
kernels = [] kernels = []
kname = "kSoftmax" kname = "kSoftmax"
k_var = "kSoftmax_" + nodename k_var = "kSoftmax_" + nodename
code = """ code = """
KERNEL void %(kname)s (const ga_size M, const ga_size N, GLOBAL_MEM const %(type_x)s * x, const ga_size offset_x, KERNEL void %(kname)s (const ga_size M, const ga_size N,
const ga_ssize sx0, const ga_ssize sx1, GLOBAL_MEM %(type_sm)s * sm, const ga_size offset_sm, const ga_ssize sm_s0, const ga_ssize sm_s1 GA_DECL_SHARED_PARAM(%(type_acc)s, buf)) GLOBAL_MEM const %(type_x)s * x, const ga_size offset_x, const ga_ssize sx0, const ga_ssize sx1,
GLOBAL_MEM %(type_sm)s * sm, const ga_size offset_sm, const ga_ssize sm_s0, const ga_ssize sm_s1 GA_DECL_SHARED_PARAM(%(type_acc)s, buf))
{ {
GA_DECL_SHARED_BODY(%(type_acc)s, buf); GA_DECL_SHARED_BODY(%(type_acc)s, buf);
...@@ -685,7 +688,8 @@ class GpuSoftmax(GpuKernelBase, Op): ...@@ -685,7 +688,8 @@ class GpuSoftmax(GpuKernelBase, Op):
kname = "kSoftmax_fixed_shared" kname = "kSoftmax_fixed_shared"
k_var = "kSoftmax_fixed_shared" + nodename k_var = "kSoftmax_fixed_shared" + nodename
code = """ code = """
KERNEL void %(kname)s (const ga_size M, const ga_size N, GLOBAL_MEM const %(type_x)s * x, const ga_size offset_x, const ga_ssize sx0, const ga_ssize sx1, KERNEL void %(kname)s (const ga_size M, const ga_size N,
GLOBAL_MEM const %(type_x)s * x, const ga_size offset_x, const ga_ssize sx0, const ga_ssize sx1,
GLOBAL_MEM %(type_sm)s * sm, const ga_size offset_sm, const ga_ssize sm_s0, const ga_ssize sm_s1 GA_DECL_SHARED_PARAM(%(type_acc)s, buf)) GLOBAL_MEM %(type_sm)s * sm, const ga_size offset_sm, const ga_ssize sm_s0, const ga_ssize sm_s1 GA_DECL_SHARED_PARAM(%(type_acc)s, buf))
{ {
GA_DECL_SHARED_BODY(%(type_acc)s, buf); GA_DECL_SHARED_BODY(%(type_acc)s, buf);
...@@ -762,6 +766,7 @@ class GpuSoftmax(GpuKernelBase, Op): ...@@ -762,6 +766,7 @@ class GpuSoftmax(GpuKernelBase, Op):
flags=flags, objvar=k_var)) flags=flags, objvar=k_var))
return kernels return kernels
gpu_softmax = GpuSoftmax() gpu_softmax = GpuSoftmax()
...@@ -1088,4 +1093,5 @@ class GpuSoftmaxWithBias(GpuKernelBase, Op): ...@@ -1088,4 +1093,5 @@ class GpuSoftmaxWithBias(GpuKernelBase, Op):
flags=flags, objvar=k_var)) flags=flags, objvar=k_var))
return kernels return kernels
gpu_softmax_with_bias = GpuSoftmaxWithBias() gpu_softmax_with_bias = GpuSoftmaxWithBias()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论