@@ -150,6 +150,7 @@ def read(self):
150
150
what namespace it is affiliated with. Once done, we have a dictionary where the key is the namespace
151
151
and the values are namespace class objects. These objects carry all information as extracted by parse.py.
152
152
"""
153
+ print ('reading headers from ' + self .include_root )
153
154
for (dirpath , dirnames , filenames ) in os .walk (self .include_root ):
154
155
for filename in filenames :
155
156
if filename .endswith ('.h' ) and not 'neural_networks' in dirpath and not any (filename .endswith (x ) for x in cython_interface .ignore_files ):
@@ -288,7 +289,7 @@ def to_hltype(self, ns, t):
288
289
if t .endswith ('ModelPtr' ):
289
290
thens = self .get_ns (ns , t , attrs = ['typedefs' ])
290
291
return ('daal::' + thens + '::ModelPtr' , 'class' , tns )
291
- if t in ['data_management::NumericTablePtr' , ] or t in ifaces .values ():
292
+ if t in ['data_management::NumericTablePtr' ] or t in ifaces .values ():
292
293
return ('daal::' + t , 'class' , tns )
293
294
if 'Batch' in self .namespace_dict [ns ].classes and t in self .namespace_dict [ns ].classes ['Batch' ].typedefs :
294
295
tns , tname = splitns (self .namespace_dict [ns ].classes ['Batch' ].typedefs [t ])
@@ -325,7 +326,7 @@ def get_values(self, ns, n):
325
326
if nns :
326
327
nn = splitns (n )[1 ]
327
328
if nn in self .namespace_dict [nns ].enums :
328
- return [nns + '::' + x for x in self .namespace_dict [nns ].enums [nn ]]
329
+ return [re . sub ( r'(?<!daal::)algorithms::' , r'daal::algorithms::' , nns + '::' + x ) for x in self .namespace_dict [nns ].enums [nn ]]
329
330
return ['unknown_' + nns + '_class_' + n ]
330
331
return ['unknown_' + n ]
331
332
@@ -341,7 +342,7 @@ def get_tmplarg(self, ns, n):
341
342
if nns :
342
343
nn = splitns (n )[1 ]
343
344
if nn in self .namespace_dict [nns ].enums :
344
- return nns + '::' + nn
345
+ return re . sub ( r'(?<!daal::)algorithms::' , r'daal::algorithms::' , nns + '::' + nn )
345
346
return 'unknown_' + nns + '_class_' + n
346
347
return 'unknown_' + n
347
348
@@ -460,7 +461,8 @@ def prepare_modelmaps(self, ns, mname='Model'):
460
461
if not any (g .endswith (x ) for x in ['SerializationTag' ,]):
461
462
gn = splitns (g )[1 ].replace ('get' , '' )
462
463
if not any (gn == x [1 ] for x in jparams ['named_gets' ]):
463
- jparams ['named_gets' ].append ((huhu [g ], gn ))
464
+ typ = re .sub (r'(?<!daal::)data_management' , r'daal::data_management' , huhu [g ])
465
+ jparams ['named_gets' ].append ((typ , gn ))
464
466
return jparams
465
467
466
468
@@ -555,7 +557,8 @@ def prepare_hlwrapper(self, ns, mode, func):
555
557
'template_args' : None ,
556
558
'pargs' : None })
557
559
for s in v ['specs' ]:
558
- tdecl .append ({'template_decl' : OrderedDict ([(x , v ['tmpl_decl' ][x ]) for x in s ['template_decl' ]]),
560
+ tdecl .append ({'template_decl' : OrderedDict ([(re .sub (r'(?<!daal::)algorithms::' , r'daal::algorithms::' , x ),
561
+ v ['tmpl_decl' ][x ]) for x in s ['template_decl' ]]),
559
562
'template_args' : [s ['expl' ][x ] if x in s ['expl' ] else x for x in v ['tmpl_decl' ]],
560
563
'pargs' : [s ['expl' ][x ] for x in s ['expl' ]]})
561
564
else :
@@ -624,6 +627,7 @@ def prepare_hlwrapper(self, ns, mode, func):
624
627
pval = tmp
625
628
if pval != None :
626
629
thetype = (hlt if hlt else parms [p ])
630
+ pval = re .sub (r'(?<!daal::)algorithms::' , r'daal::algorithms::' , pval )
627
631
if tmp in jparams ['params_req' ]:
628
632
td ['params_req' ][tmp ] = pval
629
633
decl_req .append ('const ' + thetype + ' ' + tmp )
@@ -645,7 +649,6 @@ def prepare_hlwrapper(self, ns, mode, func):
645
649
tmp_iargs_decl = []
646
650
tmp_iargs_call = []
647
651
tmp_input_args = []
648
- setinputs = ''
649
652
inp = self .get_class_for_typedef (ns , 'Batch' , 'InputType' )
650
653
if not inp and 'Input' in self .namespace_dict [ns ].classes :
651
654
inp = (ns , 'Input' )
@@ -665,6 +668,7 @@ def prepare_hlwrapper(self, ns, mode, func):
665
668
if 'NumericTablePtr' in itype :
666
669
#ns in has_dist and iname in has_dist[ns]['step_specs'][0].inputnames or iname in ['data', 'labels', 'dependentVariable', 'tableToFill']:
667
670
itype = 'TableOrFList *'
671
+ ins = re .sub (r'(?<!daal::)algorithms::' , r'daal::algorithms::' , ins )
668
672
tmp_iargs_decl .insert (i , 'const ' + itype + ' ' + iname + dflt )
669
673
tmp_iargs_call .insert (i , iname )
670
674
tmp_input_args .insert (i , (ins + '::' + iname , iname , itype ))
@@ -752,7 +756,7 @@ def hlapi(self, algo_patterns):
752
756
for e in self .namespace_dict [ns ].enums :
753
757
for v in self .namespace_dict [ns ].enums [e ]:
754
758
vv = ns + '::' + v
755
- cpp_begin += ' ' * 4 + '{"' + v + '", ' + vv + '},\n '
759
+ cpp_begin += ' ' * 4 + '{"' + v + '", daal:: ' + vv + '},\n '
756
760
cpp_begin += '};\n \n '
757
761
758
762
hlargs = {}
@@ -798,7 +802,6 @@ def gen_daal4py(daalroot, outdir, warn_all=False):
798
802
global no_warn
799
803
if warn_all :
800
804
no_warn = {}
801
-
802
805
iface = cython_interface (jp (daalroot , 'include' , 'algorithms' ))
803
806
iface .read ()
804
807
cpp_h , cpp_cpp , pyx_file = iface .hlapi (['kmeans' ,
0 commit comments