鲲鹏系统类

获取AVX2KI产品版本信息。

Avx2kiResult AVX2KI_GetProductVersion(Avx2kiProVersion *packageInfo);

参数

参数名

描述

取值范围

输入/输出

packageInfo

指向产品信息结构体的指针。

非空

输入/输出

返回值

错误码

错误码

描述

AVX2KI_STS_NULL_PTR_ERR

Avx2kiProVersion指针为空指针。

示例

  1. 创建testavx.cpp文件,文件内容如下。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>
    #include "avx2ki.h"
    #include "operatoroverload.h"
    
    void GetProductVersionExample()
    {
        Avx2kiProVersion versionGet;
        Avx2kiResult result = AVX2KI_GetProductVersion(&versionGet);
        if (result == AVX2KI_STS_NO_ERR) {
            printf("Product Name: %s\n", versionGet.productName);
            printf("Product Version: %s\n", versionGet.productVersion);
            printf("Component Name: %s\n", versionGet.componentName);
            printf("Component Version: %s\n", versionGet.componentVersion);
            printf("Component AppendInfo: %s\n", versionGet.componentAppendInfo);
            printf("Software Name: %s\n", versionGet.softwareName);
            printf("Software Version: %s\n", versionGet.softwareVersion);
        }
    }
    
    int main(void) {
        GetProductVersionExample();
        return 0;
    }
    

  2. 编译。

    g++ testavx.cpp -o testavx -I/usr/local/ksl/include -L/usr/local/ksl/lib -lavx2ki
    运行结果:
    1
    2
    3
    4
    5
    6
    7
    Product Name: Kunpeng Boostkit
    Product Version: 23.0.RC2
    Component Name: BoostKit-ksl
    Component Version: 1.0.0
    Component AppendInfo: gcc
    Software Name: boostkit-ksl-avx2neon
    Software Version: 1.0.0
    

    以上版本号和编译时间以实际运行结果为准,上述结果仅供参考。