2_system_info
Description
This sample demonstrates Runtime basic system information query and common data type utility interfaces, suitable as a warm-up sample before device query-type samples.
Product Support
This sample supports the following products:
| Product | Supported |
|---|---|
| Ascend 950PR/Ascend 950DT | Yes |
| Atlas A3 training series products/Atlas A3 inference series products | Yes |
| Atlas A2 training series products/Atlas A2 inference series products | Yes |
Compile and Run
For environment installation details and general running steps, refer to README in the example directory.
CANN RUNTIME API
The key functionality points and their key interfaces involved in this sample are as follows:
- Initialization
- Call
aclInitinterface for initialization configuration. - Call
aclFinalizeinterface for deinitialization.
- Call
- Version Information Query
- Call
aclrtGetVersioninterface to query ACL Runtime API version number. - Call
aclsysGetVersionStrandaclsysGetVersionNuminterfaces to query CANN software package version information.
- Call
- Run Mode and Data Type Tools
- Call
aclrtGetRunModeinterface to determine whether currently running in Host or Device mode. - Call
aclFloatToFloat16andaclFloat16ToFloatinterfaces to complete float16/float32 mutual conversion. - Call
aclDataTypeSizeinterface to query byte size of commonaclDataType.
- Call
Sample Output
[INFO] ACL Runtime API version: 1.2.3
[INFO] CANN package [runtime] version string: 8.x.x
[INFO] CANN package [runtime] version number: 8000000
[INFO] Current run mode: ACL_HOST
[INFO] Float conversion: 1.625000 -> 0x3e80 -> 1.625000
[INFO] Data type size: ACL_FLOAT=4, ACL_FLOAT16=2, ACL_INT64=8