Skip to content

Commit 3ccb19f

Browse files
Adding onnx rpath to Makefile and ObjectNode change for COMB
1 parent ed4e098 commit 3ccb19f

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

CLA/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ifeq ($(strip $(ONNX_PATH)),)
1818
else
1919
# Library found
2020
$(info ONNX path is set to ${ONNX_PATH})
21-
ONNX_LIB := -L$(ONNX_PATH)/lib -lonnxruntime
21+
ONNX_LIB := -L$(ONNX_PATH)/lib -lonnxruntime -Wl,-rpath,$(ONNX_PATH)/lib
2222
ONNX_INC := -I$(ONNX_PATH)/include
2323
endif
2424

@@ -153,4 +153,3 @@ clean:
153153
# clean everything including the auxiliaries we depend on
154154
cleanall: clean
155155
$(MAKE) -C $(SUBDIRLOC)analysis_core clean
156-

analysis_core/OMENode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ class OMENode : public Node{
6363
uint32_t coreml_flags = 0;
6464
// coreml_flags |= COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE;
6565
// coreml_flags |= COREML_FLAG_ENABLE_ON_SUBGRAPH;
66-
coreml_flags |= COREML_FLAG_USE_CPU_ONLY;
66+
// coreml_flags |= COREML_FLAG_USE_CPU_ONLY;
6767

68-
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CoreML(session_options, coreml_flags));
68+
// Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CoreML(session_options, coreml_flags));
6969
session = new Ort::Session(env, model_file.c_str(), session_options);
7070

7171
Ort::AllocatorWithDefaultOptions allocator;

analysis_core/ObjectNode.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25152515
alv.SetPxPyPzE(0,0,0,0);
25162516
DEBUG("\n");
25172517
}
2518-
ao->combos.insert( pair <string,vector<dbxParticle> > (name, combination) );
2518+
(ao->combos)[name] = combination;
25192519

25202520
vector<vector<int>> bad_combinations;
25212521
set<vector<int>> good_combinations;
@@ -2569,8 +2569,8 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25692569
particles->at(jp)->index =temp_index[abs(1+tidx1)]; // means we respect order -1, -2
25702570
DEBUG("new index: "<< particles->at(jp)->index <<"\n");
25712571
} else {
2572-
// particles->at(jp)->index=ipart;
2573-
// particles->at(jp)->collection=name;
2572+
particles->at(jp)->index=ipart;
2573+
particles->at(jp)->collection=name;
25742574
;
25752575
}
25762576
}
@@ -2579,10 +2579,9 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25792579
DEBUG("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ P or F: ~~~~~~ "<<ppassed<<"\n");
25802580
if (!ppassed) {
25812581

2582-
DEBUG("Removing:"<<name<<" " <<ipart<<"th combi.\n");
2583-
(ao->combos).find(name)->second.erase( (ao->combos).find(name)->second.begin()+ipart);
2584-
bad_combinations.push_back(combi_out[ipart]);
2585-
good_combinations.erase(combi_out[ipart]);
2582+
DEBUG("marking as bad:"<<name<<" " <<ipart<<"th combi.\n");
2583+
bad_combinations.push_back(combi_out[ipart]);
2584+
good_combinations.erase(combi_out[ipart]);
25862585
} else {
25872586
good_combinations.insert(combi_out[ipart]);
25882587
}
@@ -2650,10 +2649,20 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
26502649
cutIterator++;
26512650
}// end of cut iterator loop
26522651

2652+
// remove the bad combinations here
2653+
for (int ipart=ipart_max-1; ipart>=0; ipart--){ // loop over combis
2654+
std::vector< vector<int> >::iterator itb; // bad list iterator
2655+
itb=find (bad_combinations.begin(), bad_combinations.end(), combi_out[ipart]);
2656+
if ( itb != bad_combinations.end() ) {
2657+
DEBUG("Removing:" <<ipart<<" of combis:"<<(ao->combos).find(name)->second.size() );
2658+
(ao->combos).find(name)->second.erase( (ao->combos).find(name)->second.begin()+ipart);
2659+
}
2660+
}
2661+
26532662
if (requested_max<=0) { //probably no particle available,never here
26542663
vector<vector<int>> table_B;
26552664
indicesA indexA={table_B, 0, 0};
2656-
ao->combosA.insert( pair <string, indicesA > (name, indexA) );
2665+
(ao->combosA)[name] = indexA;
26572666
return;
26582667
}
26592668

@@ -2739,7 +2748,7 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
27392748
}
27402749

27412750
indicesA indexA={table_B, amaxrow, (int)table_B.size() };
2742-
ao->combosA.insert( pair <string, indicesA > (name, indexA) );
2751+
(ao->combosA)[name] = indexA;
27432752

27442753
out_selection.clear();
27452754
// NANT's code, to be commented in later

0 commit comments

Comments
 (0)