---
title: KesVectorCreate
description: "KesReturnCode KesVectorCreate(KesVector *X, KesScalarType type, KesVectorFormat format);"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_1044.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_1044.html
indexId: 729a2daf5118f3cb1e6e3d6d443fd941173230e07508ac24829e893146e1ffe661
---
# KesVectorCreate

#### 接口定义

KesReturnCode KesVectorCreate(KesVector *X, KesScalarType type, KesVectorFormat format);


#### 接口说明

创建向量，并指定数据类型、向量形式。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| X | KesVector \* | 向量句柄，不能为空指针。 | 输入/输出 |
| type | KesScalarType | 数据类型。 | 输入 |
| format | KesVectorFormat | 向量类型。 | 输入 |


| KesVectorFormat | 类型描述 |
| --- | --- |
| KES\_EMPTY\_VECTOR | 空向量 |
| KES\_DENSE | 采用BLAS数组列优先存储的方式，向量数据由（首元素指针，向量长度，向量个数，leading dimension）指定。 |


| KesScalarType | 类型描述 | 对应C的类型 |
| --- | --- | --- |
| KES\_SCALAR\_FP32 | 单精度实数浮点类型。 | float |
| KES\_SCALAR\_FP32C | 单精度复数浮点类型。 | float \_Complex |
| KES\_SCALAR\_FP64 | 双精度实数浮点类型。 | double |
| KES\_SCALAR\_FP64C | 双精度复数浮点类型。 | double \_Complex |
