Remove dummy OpenMP Op and rollback OpenMP changes in CTC wrapper

上级 1c2f24a4
...@@ -21,9 +21,6 @@ class ConnectionistTemporalClassification(gof.COp): ...@@ -21,9 +21,6 @@ class ConnectionistTemporalClassification(gof.COp):
def __init__(self, compute_grad=True): def __init__(self, compute_grad=True):
super(ConnectionistTemporalClassification, self).__init__(self.func_file, super(ConnectionistTemporalClassification, self).__init__(self.func_file,
self.func_name) self.func_name)
# Instantiate dummy OpenMP Op to check OpenMP support, pull headers and
# compilation options
self.openmp_op = gof.OpenMPOp()
self.compute_grad = compute_grad self.compute_grad = compute_grad
self.costs = T.fvector(name="ctc_cost") self.costs = T.fvector(name="ctc_cost")
...@@ -35,9 +32,6 @@ class ConnectionistTemporalClassification(gof.COp): ...@@ -35,9 +32,6 @@ class ConnectionistTemporalClassification(gof.COp):
'to the root directory of the CTC library in ' 'to the root directory of the CTC library in '
'your system.') 'your system.')
def c_compile_args(self):
return self.openmp_op.c_compile_args()
def c_lib_dirs(self): def c_lib_dirs(self):
dirs = [] dirs = []
if ctc_enabled: if ctc_enabled:
...@@ -58,7 +52,7 @@ class ConnectionistTemporalClassification(gof.COp): ...@@ -58,7 +52,7 @@ class ConnectionistTemporalClassification(gof.COp):
return dirs return dirs
def c_headers(self): def c_headers(self):
return ["ctc.h"] + self.openmp_op.c_headers() return ["ctc.h"]
def make_node(self, activations, labels, input_lengths=None): def make_node(self, activations, labels, input_lengths=None):
if not ctc_enabled: if not ctc_enabled:
......
...@@ -187,11 +187,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations, ...@@ -187,11 +187,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctcOptions ctc_options; ctcOptions ctc_options;
memset( &ctc_options, 0, sizeof(ctcOptions) ); memset( &ctc_options, 0, sizeof(ctcOptions) );
ctc_options.loc = CTC_CPU; ctc_options.loc = CTC_CPU;
#if defined(_OPENMP)
ctc_options.num_threads = omp_get_num_threads();
#else
ctc_options.num_threads = 1; ctc_options.num_threads = 1;
#endif
size_t cpu_workspace_size; size_t cpu_workspace_size;
int ctc_error; int ctc_error;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论