kupl_graph_create
创建一个kupl图。
接口定义
kupl_graph_h kupl_graph_create(kupl_egroup_h egroup);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
egroup |
kupl_egroup_h |
该graph使用的executor的集合,可设置为KUPL_ALL_EXECUTORS,即使用全部可用的executors |
输入 |
返回值
- 成功:返回创建的kupl图
- 失败:返回nullptr
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <stdio.h> #include "kupl.h" int main() { int executor_num = kupl_get_num_executors(); int executors[executor_num]; for (int i =0; i < executor_num; i++) { executors[i] = i; } kupl_egroup_h egroup = kupl_egroup_create(executors, executor_num); kupl_graph_h graph = kupl_graph_create(egroup); kupl_graph_destroy(graph); kupl_egroup_destroy(egroup); return 0; } |

上述示例演示了创建egroup、graph图并最后销毁的流程。上述kupl_graph_create函数创建了使用全部executor的graph图。
父主题: 计算图编程函数