C++ 查询CL\ U设备\最大\工作\项目\大小

C++ 查询CL\ U设备\最大\工作\项目\大小,c++,opencl,C++,Opencl,我试图在笔记本电脑上查询并输出最大工作项大小。 查询的返回类型为size\u t[],如图所示 但是我仍然无法输出它。如何输出最大工作项大小? 我是否正确声明了变量 #include <iostream> #include <vector> #include <sstream> using namespace std; int main(void) { vector<cl::Platform> platforms; // availabl

我试图在笔记本电脑上查询并输出最大工作项大小。 查询的返回类型为
size\u t[]
,如图所示

但是我仍然无法输出它。如何输出最大工作项大小? 我是否正确声明了变量

#include <iostream>
#include <vector>
#include <sstream>
using namespace std;

int main(void)
{
    vector<cl::Platform> platforms; // available platforms
    vector<cl::Device> devices;     // devices available to a platform
    string outputString;                // string for output
    VECTOR_CLASS<::size_t> maxWorkItem[3];  // for MAX_WORK_ITEM_SIZES
    unsigned int i, j;                      // counters

        cl::Platform::get(&platforms);

        // for each platform
        for (i = 0; i < platforms.size(); i++)
        {
            vector<cl::Device> devices; // available devices 

            //get all devices available to the platform
            platforms[i].getDevices(CL_DEVICE_TYPE_ALL, &devices);

            //for each device 
            for (j = 0; j < devices.size(); j++)
            {
                cl_device_type type;
                devices[j].getInfo(CL_DEVICE_TYPE, &type);

                if (type == CL_DEVICE_TYPE_CPU)
                {
                    platforms[i].getInfo(CL_PLATFORM_NAME, &outputString);
                    cout << "\tName of Platform: " << outputString << std::endl;

                    cout << "\tType: " << "CPU" << endl;


                    //Help here
                    maxWorkItem[0] = devices[j].getInfo<CL_DEVICE_MAX_WORK_ITEM_SIZES>();
                    cout << "\tMax Work Item Size: " << maxWorkItem[0] << endl;

                    cout << "--------------------------------------------------" << endl;

                }
            }
        }
}
#包括
#包括
#包括
使用名称空间std;
内部主(空)
{
向量平台;//可用平台
vector devices;//平台可用的设备
string outputString;//用于输出的字符串
VECTOR_CLASS maxWorkItem[3];//用于最大工作项大小
无符号整数i,j;//计数器
cl::平台::获取(&platforms);
//对于每个平台
对于(i=0;icout根据您使用的
设备::getInfo()
重载,您可以通过两种方式完成此操作。请注意,最大工作项大小为您提供了工作组的每个维度中可以指定的最大工作项数:

一,

/。。。
向量maxWorkItem;
无符号整数i,j,k;
//...
//帮帮我
maxWorkItem=devices[j].getInfo();
对于(k=0;kcout根据您使用的
设备::getInfo()
重载,您可以通过两种方式完成此操作。请注意,最大工作项大小为您提供了工作组的每个维度中可以指定的最大工作项数:

一,

/。。。
向量maxWorkItem;
无符号整数i,j,k;
//...
//帮帮我
maxWorkItem=devices[j].getInfo();
对于(k=0;k