---
title: kpccl_graph_destroy
description: "销毁一个kpccl图。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/KunoengHPCKit_developer_036.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/KunoengHPCKit_developer_036.html
indexId: 2eae2d47269a01a4220e63ede5add9230583622409a68cb2fefd750bcbe9daa473
---
# kpccl_graph_destroy

销毁一个kpccl图。

#### 接口定义

void kpccl_graph_destroy(kpccl_graph_h graph);


#### 参数


**表1 参数定义**

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| graph | kpccl\_graph\_h | 需要销毁的kpccl graph | 输入 |


#### 示例

```
#include <stdio.h>
#include "kpccl.h"
int main()
{
int executor_num = kpccl_get_num_executors();
int executors[executor_num];
for (int i =0; i < executor_num; i++) {
executors[i] = i;
}
kpccl_egroup_h egroup = kpccl_egroup_create(executors, executor_num);
kpccl_graph_h graph = kpccl_graph_create(egroup);
kpccl_graph_destroy
(graph);
kpccl_egroup_destroy(egroup);
return 0;
}
```


上述示例演示了创建egroup、graph图并最后销毁的流程。上述kpccl_graph_destroy函数销毁了之前创建的graph图。
