资源简介
基于并行异构计算架构OpenCL实现的双边滤波的美颜功能
代码片段和文件信息
#include “stdafx.h“
#include
#include
#include
#include
#include
#include
#include
void DisplayPlatformInfo(
cl_platform_id id
cl_platform_info name
std::string str)
{
cl_int errNum;
std::size_t paramValueSize;
errNum = clGetPlatformInfo(
id
name
0
NULL
¶mValueSize);
if (errNum != CL_SUCCESS)
{
std::cerr << “Failed to find OpenCL platform “ << str << “.“ << std::endl;
return;
}
char * info = (char *)alloca(sizeof(char) * paramValueSize);
errNum = clGetPlatformInfo(
id
name
paramValueSize
info
NULL);
if (errNum != CL_SUCCESS)
{
std::cerr << “Failed to find OpenCL platform “ << str << “.“ << std::endl;
return;
}
std::cout << “\t“ << str << “:\t“ << info << std::endl;
}
template
void appendBitfield(T info T value std::string name std::string & str)
{
if (info & value)
{
if (str.length() > 0)
{
str.append(“ | “);
}
str.append(name);
}
}
///
// Display information for a particular device.
// As different calls to clGetDeviceInfo may return
// values of different types a template is used.
// As some values returned are arrays of values a templated class is
// used so it can be specialized for this case see below.
//
template
class InfoDevice
{
public:
static void display(
cl_device_id id
cl_device_info name
std::string str)
{
cl_int errNum;
std::size_t paramValueSize;
errNum = clGetDeviceInfo(
id
name
0
NULL
¶mValueSize);
if (errNum != CL_SUCCESS)
{
std::cerr << “Failed to find OpenCL device info “ << str << “.“ << std::endl;
return;
}
T * info = (T *)alloca(sizeof(T) * paramValueSize);
errNum = clGetDeviceInfo(
id
name
paramValueSize
info
NULL);
if (errNum != CL_SUCCESS)
{
std::cerr << “Failed to find OpenCL device info “ << str << “.“ << std::endl;
return;
}
// Handle a few special cases
switch (name)
{
case CL_DEVICE_TYPE:
{
std::string deviceType;
appendBitfield(
*(reinterpret_cast(info))
CL_DEVICE_TYPE_CPU
“CL_DEVICE_TYPE_CPU“
deviceType);
appendBitfield(
*(reinterpret_cast(info))
CL_DEVICE_TYPE_GPU
“CL_DEVICE_TYPE_GPU“
deviceType);
appendBitfield(
*(reinterpret_cast(info))
CL_DEVICE_TYPE_ACCELERATOR
“CL_DEVICE_TYPE_ACCELERATOR“
deviceType);
appendBitfield(
*(reinterpret_cast(info))
CL_DEVICE_TYPE_DEFAULT
“CL_DEVICE_TYPE_DEFAULT“
deviceType);
std::cout << “\t\t“ << str << “:\t“ << deviceType << std::endl;
}
break;
case CL_DEVICE_SINGLE_FP_CONFIG:
{
std::string fpType;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-02-22 23:11 bilateralBlur\
目录 0 2017-02-22 23:11 bilateralBlur\Debug\
文件 2146 2017-02-19 12:02 bilateralBlur\Debug\bilateralBlur.cl
文件 2136064 2014-04-15 17:14 bilateralBlur\Debug\opencv_core249.dll
文件 3515392 2014-04-15 17:18 bilateralBlur\Debug\opencv_core249d.dll
文件 2146816 2014-04-15 17:15 bilateralBlur\Debug\opencv_highgui249.dll
文件 3697152 2014-04-15 17:19 bilateralBlur\Debug\opencv_highgui249d.dll
文件 1876480 2014-04-15 17:14 bilateralBlur\Debug\opencv_imgproc249.dll
文件 3144192 2014-04-15 17:18 bilateralBlur\Debug\opencv_imgproc249d.dll
文件 1239040 2014-04-15 17:16 bilateralBlur\Debug\opencv_legacy249.dll
文件 2627072 2014-04-15 17:19 bilateralBlur\Debug\opencv_legacy249d.dll
文件 155620 2017-02-20 19:17 bilateralBlur\Debug\output.jpg
文件 1193074 2017-02-19 10:17 bilateralBlur\Debug\test.png
目录 0 2017-02-22 23:11 bilateralBlur\cl_test\
文件 1302 2017-02-09 20:49 bilateralBlur\cl_test\ReadMe.txt
文件 2141 2017-02-20 20:45 bilateralBlur\cl_test\bilateralBlur.cl
文件 29498 2017-02-22 22:41 bilateralBlur\cl_test\bilateralBlur.cpp
文件 4908 2017-02-09 21:02 bilateralBlur\cl_test\cl_test.cpp
文件 4709 2017-02-11 11:19 bilateralBlur\cl_test\cl_test.vcproj
文件 1427 2017-02-11 12:42 bilateralBlur\cl_test\cl_test.vcproj.DESKTOP-2MVQ67C.三米上.user
文件 9362 2017-02-19 12:32 bilateralBlur\cl_test\cl_test.vcxproj
文件 1444 2017-02-19 12:32 bilateralBlur\cl_test\cl_test.vcxproj.filters
目录 0 2017-02-19 10:33 bilateralBlur\cl_test\include\
目录 0 2017-02-19 10:33 bilateralBlur\cl_test\include\CL\
文件 63975 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl.h
文件 311347 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl.hpp
文件 5009 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl_d3d10.h
文件 4724 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl_d3d10_ext.h
文件 5003 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl_d3d11.h
文件 4724 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl_d3d11_ext.h
文件 5635 2016-09-05 22:51 bilateralBlur\cl_test\include\CL\cl_d3d9_ext.h
............此处省略212个文件信息
相关资源
- OpenCL编程指南 高清PDF版
- opencl异构并行计算原理机制与优化实
- AMD-APP-SDK-v2.9-Windows-64位
- GPU编程与优化 大众高性能计算(高清
- OpenCL异构并行计算(完整版)
- OpenCL坡度提取GDAL
- intel fpga opencl 编程指南
- intel opencl sdk 用户手册
- 解决并修复opencl出错intel_sdk_for_openc
- intel_ocl_caps_basic_win.zip
- 操作系统之文件系统设计一个n 个用户
- openCL编程指导随书源代码
- windows intel_sdk_for_opencl
- No.1_OpenCLSampler
- OpenCL 历史版本更新信息
- intel_sdk_for_opencl_2017
- intel opencl sdk安装手册
评论
共有 条评论