完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
准备工作:
1)下载头文件: 2)从RK3288 android 系统路径 /system/vendor/lib/egl 中库文件 libGLES_mali .so 1.打印平台信息; 2.打印设备信息; 3.总是工作项目; void print_openCL_platform_device() { int i, j; 字符信息[1024]; cl_int 错误; cl_uint n平台; cl_platform_id *listPlatform; cl_uint nDevice; cl_device_id *listDevice; cl_uint nMaxComputeUnits = 0; cl_uint nMaxWorkItemDims = 0; size_t *nMaxWorkItemSizes = NULL; size_t nMaxGlobalWorkSize = 1; size_t nMaxWorkGroupSize = 0; 错误 = clGetPlatformIDs(0, NULL, &nPlatform); if(err < 0) { perror("找不到任何平台。"); 退出(1); } listPlatform = (cl_platform_id*)malloc(nPlatform * sizeof(cl_platform_id)); clGetPlatformIDs(nPlatform, listPlatform, NULL); for (i = 0; i < nPlatform; i++) { //返回平台名称 clGetPlatformInfo(listPlatform , CL_PLATFORM_NAME, 1024, info, NULL); LOGD("############################################## ############"); LOGD("nt平台[%d]:", i); LOGD("ntNamett%s", info); //查看opencl版本 clGetPlatformInfo(listPlatform, CL_PLATFORM_VERSION, 1024, info, NULL); LOGD("ntVersiontt%s", info); //返回和平台相关的厂商 clGetPlatformInfo(listPlatform, CL_PLATFORM_VENDOR, 1024, info, NULL); LOGD("ntVendortt%s", info); //确认系统是否支持完整的opencl版本还是嵌入式版本 clGetPlatformInfo(listPlatform, CL_PLATFORM_PROFILE, 1024, info, NULL); LOGD("ntProfilett%s", info); //查看平台支持的浮点精度扩展 clGetPlatformInfo(listPlatform, CL_PLATFORM_EXTENSIONS, 1024, info, NULL); LOGD("ntExtensiont%s", info); LOGD("###########################################################"); err = clGetDeviceIDs(listPlatform, CL_DEVICE_TYPE_ALL, 0, NULL, &nDevice); if(err < 0) { perror("Couldn't find any devices"); exit(1); } listDevice = (cl_device_id*)malloc(nDevice * sizeof(cl_device_id)); clGetDeviceIDs(listPlatform, CL_DEVICE_TYPE_ALL, nDevice, listDevice, NULL); for (j = 0; j < nDevice; j++) { LOGD("n"); clGetDeviceInfo(listDevice[j], CL_DEVICE_NAME, 1024, info, NULL); LOGD("###########################################################"); LOGD("ntDevice[%d]:", j); LOGD("ntNamett%s", info); clGetDeviceInfo(listDevice[j], CL_DEVICE_VERSION, 1024, info, NULL); LOGD("ntVersiontt%s", info); clGetDeviceInfo(listDevice[j], CL_DEVICE_TYPE, 1024, info, NULL); switch (info[0]) { case CL_DEVICE_TYPE_DEFAULT:strcpy(info, "DEFAULT"); break; case CL_DEVICE_TYPE_CPU:strcpy(info, "CPU"); break; case CL_DEVICE_TYPE_GPU:strcpy(info, "GPU"); break; case CL_DEVICE_TYPE_ACCELERATOR:strcpy(info, "ACCELERATOR"); break; //case CL_DEVICE_TYPE_CUSTOM:strcpy_s(info, "CUSTOM"); break; //case CL_DEVICE_TYPE_ALL:strcpy(info, "ALL"); break; } LOGD("ntTypett%s", info); clGetDeviceInfo(listDevice[j], CL_DEVICE_VENDOR, 1024, info, NULL); LOGD("ntVdendortt%s", info); clGetDeviceInfo(listDevice[j], CL_DEVICE_PROFILE, 1024, info, NULL); LOGD("ntProfilett%s", info); LOGD("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); err = clGetDeviceInfo(listDevice[j],CL_DEVICE_MAX_COMPUTE_UNITS,sizeof(cl_uint),&nMaxComputeUnits,NULL); if(err==CL_SUCCESS){ LOGD("ntnMaxComputeUnits=%dn",nMaxComputeUnits); } err = clGetDeviceInfo(listDevice[j],CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,sizeof(cl_uint),&nMaxWorkItemDims,NULL); if(err==CL_SUCCESS){ LOGD("ntnMaxWorkItemDims=%dn",nMaxWorkItemDims); nMaxWorkItemSizes = (size_t*)malloc(sizeof(size_t)*nMaxWorkItemDims); err = clGetDeviceInfo(listDevice[j],CL_DEVICE_MAX_WORK_ITEM_SIZES,sizeof(size_t)*nMaxWorkItemDims,nMaxWorkItemSizes,NULL); if(err==CL_SUCCESS){ for(i=0;i LOGD("ntnMaxWorkItemSizes[%d]=%dn",i,nMaxWorkItemSizes); } LOGD("ntnMaxGlobalWorkSize=%dn",nMaxGlobalWorkSize); } 免费(nMaxWorkItemSizes); } err = clGetDeviceInfo(listDevice[j],CL_DEVICE_MAX_WORK_GROUP_SIZE,sizeof(size_t),&nMaxWorkGroupSize,NULL); if(err==CL_SUCCESS){ LOGD("ntnMaxWorkGroupSize=%dn",nMaxWorkGroupSize); } LOGD("############################################# #############"); } LOGD("nn"); 免费(列表设备); } 免费(列表平台); } |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1988 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2490 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5272 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 12:05 , Processed in 0.547485 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号