提交 f62d6cf8 authored 作者: --global's avatar --global

Refactor code

上级 9f231761
...@@ -421,28 +421,21 @@ class GpuDnnConv(DnnBase, COp): ...@@ -421,28 +421,21 @@ class GpuDnnConv(DnnBase, COp):
if version() == -1: if version() == -1:
alg_def = ('CONV_ALGO', "0") alg_def = ('CONV_ALGO', "0")
else: else:
if self.workmem == 'none':
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM'
choose_alg = '0' choose_alg = '0'
choose_alg_time = '0' choose_alg_time = '0'
if self.workmem == 'none':
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM'
elif self.workmem == 'small': elif self.workmem == 'small':
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM' alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM'
choose_alg = '0'
choose_alg_time = '0'
elif self.workmem == 'large': elif self.workmem == 'large':
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_GEMM' alg = 'CUDNN_CONVOLUTION_FWD_ALGO_GEMM'
choose_alg = '0'
choose_alg_time = '0'
elif self.workmem == 'fft': elif self.workmem == 'fft':
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_FFT' alg = 'CUDNN_CONVOLUTION_FWD_ALGO_FFT'
choose_alg = '0'
choose_alg_time = '0'
elif self.workmem == 'guess': elif self.workmem == 'guess':
# The convolution implementation should be choosen according # The convolution implementation should be choosen according
# to a heuristic # to a heuristic
alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM' alg = 'CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM'
choose_alg = '1' choose_alg = '1'
choose_alg_time = '0'
elif self.workmem == 'time': elif self.workmem == 'time':
# The convolution implementation should be choosen by timing # The convolution implementation should be choosen by timing
# every available implementation # every available implementation
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论