| … | … | @@ -177,16 +177,23 @@ void OpenclNode::build_program(void) |
| 177 | 177 | // Build the interface definitions for the kernels. |
| 178 | 178 | GenIDL gidl; |
| 179 | 179 | HandleSeq ifcs = gidl.gen_idl(src); |
| 180 | HandleSeq asif; |
| 180 | 181 | AtomSpace *as = getAtomSpace(); |
| 181 | 182 | for (const Handle& h : ifcs) |
| 182 | | _kernel_interfaces.emplace_back(as->add_atom(h)); |
| 183 | { |
| 184 | Handle has = as->add_atom(h); |
| 185 | _kernel_interfaces.insert({ |
| 186 | has->getOutgoingAtom(0), |
| 187 | has->getOutgoingAtom(1)}); |
| 188 | asif.emplace_back(has); |
| 189 | } |
| 183 | 190 | |
| 184 | 191 | // Also publish them. Per sensory spec, (Predicate "*-description-*") |
| 185 | 192 | // is the right place. For now, stuff them into a ChoiceLink, |
| 186 | 193 | // because that seems to be the right thing to do. (you can only |
| 187 | 194 | // chose one.) They appear in the AtomSpace grouped together. |
| 188 | 195 | Handle descr = as->add_node(PREDICATE_NODE, "*-description-*"); |
| 189 | | Handle choice = as->add_link(CHOICE_LINK, HandleSeq(_kernel_interfaces)); |
| 196 | Handle choice = as->add_link(CHOICE_LINK, std::move(asif)); |
| 190 | 197 | setValue(descr, choice); |
| 191 | 198 | } |
| 192 | 199 | |