Cl не имеет вектора членов

Я пытаюсь написать приложение Hello World, используя реализацию OpenCL от AMD.
http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/introductory-tutorial-to-opencl/

Я установил каталог, lib и т. Д. как здесь

Следующие компиляции:

#include "stdafx.h"#include <CL/cl.h>

int _tmain(int argc, _TCHAR* argv[])
{
cl_platform_id test;
cl_uint num;
cl_uint ok = 1;
clGetPlatformIDs(ok, &test, &num);

return 0;

}

Тем не мение,

#include "stdafx.h"
#include <utility>
#include <CL/cl.hpp>int _tmain(int argc, _TCHAR* argv[])
{
cl::vector< cl::Platform > platformList;

return 0;
}

не.

Я получаю следующие ошибки:

Error   1   error C2039: 'vector' : is not a member of 'cl' D:\Documents\Projects\Visual Studio\C++\cl_helloworld\cl_helloworld\cl_helloworld.cpp   12  1   cl_helloworld
Error   2   error C2065: 'vector' : undeclared identifier   D:\Documents\Projects\Visual Studio\C++\cl_helloworld\cl_helloworld\cl_helloworld.cpp   12  1   cl_helloworld
Error   3   error C2275: 'cl::Platform' : illegal use of this type as an expression D:\Documents\Projects\Visual Studio\C++\cl_helloworld\cl_helloworld\cl_helloworld.cpp   12  1   cl_helloworld
Error   4   error C2065: 'platformList' : undeclared identifier D:\Documents\Projects\Visual Studio\C++\cl_helloworld\cl_helloworld\cl_helloworld.cpp   12  1   cl_helloworld

IntelliSense подчеркивает vector< cl::Platform > platformList, и когда я набираю cl :: я не вижу векторный класс.

РЕДАКТИРОВАТЬ

Если я вручную копирую содержимое cl.hpp в main.cpp, я вижу вектор в IntelliSense, но все равно не могу скомпилировать проект.

3

Решение

использование std::vector<cl:XXXX> вместо.
Это то, что я использую, нет проблем вообще, и у меня есть очень сложные приложения OpenCL C ++.

Вы также можете включить внутренний cl::vector класс, определив перед #include <cl.hpp> #define __NO_STD_VECTOR, Но я не рекомендую это, так как функциональность хуже, чем стандартная.

Пример:
Если у вас есть вектор событий, в std вы можете выборочно удалять события. Но в cl :: vector вы должны сделать это вручную.

6

Другие решения

Других решений пока нет …