| 42 | } |
| 43 | |
| 44 | std::string getFuncName(const vector<Node *> &output_nodes, |
| 45 | const vector<int> &output_ids, |
| 46 | const vector<Node *> &full_nodes, |
| 47 | const vector<Node_ids> &full_ids, const bool is_linear, |
| 48 | const bool loop0, const bool loop1, const bool loop2, |
| 49 | const bool loop3) { |
| 50 | std::string funcName; |
| 51 | funcName.reserve(512); |
| 52 | funcName = (is_linear ? 'L' : 'G'); |
| 53 | funcName += (loop0 ? '0' : 'X'); |
| 54 | funcName += (loop1 ? '1' : 'X'); |
| 55 | funcName += (loop2 ? '2' : 'X'); |
| 56 | funcName += (loop3 ? '3' : 'X'); |
| 57 | |
| 58 | for (const auto &node : output_nodes) { |
| 59 | funcName += '_'; |
| 60 | funcName += node->getNameStr(); |
| 61 | } |
| 62 | |
| 63 | for (const int id : output_ids) { |
| 64 | funcName += '-'; |
| 65 | funcName += std::to_string(id); |
| 66 | } |
| 67 | |
| 68 | for (int i = 0; i < static_cast<int>(full_nodes.size()); i++) { |
| 69 | full_nodes[i]->genKerName(funcName, full_ids[i]); |
| 70 | } |
| 71 | |
| 72 | return "KER" + std::to_string(deterministicHash(funcName)); |
| 73 | } |
| 74 | |
| 75 | bool NodePtr_equalto::operator()(const Node *l, const Node *r) const noexcept { |
| 76 | return *l == *r; |
no test coverage detected