OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomese-simd commits / 4b78e6c

Make it a map, not a sequence
4b78e6ca308a7d28f9096ec4ee07a46b8ec1eda9
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-12T03:03:53.000Z

Changed files (2) +10 -3

opencog/atoms/opencl/OpenclNode.cc +9 -2
……@@ -177,16 +177,23 @@ void OpenclNode::build_program(void)
177177 // Build the interface definitions for the kernels.
178178 GenIDL gidl;
179179 HandleSeq ifcs = gidl.gen_idl(src);
180 HandleSeq asif;
180181 AtomSpace *as = getAtomSpace();
181182 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 }
183190
184191 // Also publish them. Per sensory spec, (Predicate "*-description-*")
185192 // is the right place. For now, stuff them into a ChoiceLink,
186193 // because that seems to be the right thing to do. (you can only
187194 // chose one.) They appear in the AtomSpace grouped together.
188195 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));
190197 setValue(descr, choice);
191198}
192199
opencog/atoms/opencl/OpenclNode.h +1 -1
……@@ -68,7 +68,7 @@ protected:
6868
6969 // List of interfaces provided by the program.
7070 // Its a bunch of kernels, described in Atomese.
71 HandleSeq _kernel_interfaces;
71 HandleMap _kernel_interfaces;
7272
7373 // Execution context.
7474 // (TODO: I guess we could have several of these per device!?)