打开微信,使用扫一扫进入页面后,点击右上角菜单,
点击“发送给朋友”或“分享到朋友圈”完成分享
代码如下:
```
#include <iostream>
int main(int argc, char **argv)
{
cnrtRet_t ret;
int major;
int minor;
int patch;
// ret = cnrtGetLibVersion(&major, &minor, &patch);
// if (ret != cnrtSuccess) {
// std::cerr << "########cnrtGetLibVersion failed: " << ret << std::endl;
// return 1;
// }
// std::cout << "########################cnrtGetLibVersion: " << major << "." << minor << "." << patch << std::endl;
ret = cnrtInit(0);
if (ret != cnrtSuccess) {
std::cerr << "########cnrtInit failed: " << ret << std::endl;
return 1;
}
// // 获取device数量
unsigned int deviceCount = 0;
ret = cnrtGetDeviceCount(&deviceCount);
if (ret != cnrtSuccess) {
std::cerr << "########cnrtGetDeviceCount failed: " << ret << std::endl;
return 1;
}
std::cout << "ret: " << ret << " deviceCount: " << deviceCount << std::endl;
cnrtDestroy();
return 0;
}
```
执行时初始化报错,能帮忙看一下什么原因么?
热门帖子
精华帖子