#include #include #include int main() { cl_int error; cl_uint platformIdCount = 0; clGetPlatformIDs (0, nullptr, &platformIdCount); std::vector platformIds (platformIdCount); clGetPlatformIDs (platformIdCount, platformIds.data(), nullptr); std::cout << "Platform count: " << platformIdCount << std::endl; cl_uint deviceIdCount = 0; clGetDeviceIDs (platformIds [0], CL_DEVICE_TYPE_ALL, 0, nullptr, &deviceIdCount); std::cout << "Device in Platform 0 count: " << deviceIdCount << std::endl; std::vector deviceIds (deviceIdCount); clGetDeviceIDs (platformIds [0], CL_DEVICE_TYPE_ALL, deviceIdCount, deviceIds.data (), nullptr); const cl_context_properties contextProperties [] = { CL_CONTEXT_PLATFORM, reinterpret_cast (platformIds [0]), 0, 0 }; cl_context context = clCreateContext ( contextProperties, deviceIdCount, deviceIds.data (), nullptr, nullptr, &error); return 0; }