void OpenCLInterface::printOCLPlatformInfo(const cl::Platform &platform) const { std::string platform_name; std::string platform_vendor; cl_int error; error = platform.getInfo(CL_PLATFORM_NAME, &platform_name); if (error != CL_SUCCESS) { Logger::writeLine("OpenCLInterface::printOCLPlatformInfo(): Error during query for CL_PLATFORM_NAME: " + std::to_string(error)); } error = platform.getInfo(CL_PLATFORM_VENDOR, &platform_vendor); if (error != CL_SUCCESS) { Logger::writeLine("OpenCLInterface::printOCLPlatformInfo(): Error during query for CL_PLATFORM_VENDOR: " + std::to_string(error)); } Logger::writeLine("OpenCLInterface::printOCLPlatformInfo(): OpenCL platform info: " + platform_name + ", vendor " + platform_vendor + "."); }
std::string Convolution3DCLBuffer::getPlatformInfo(cl::Platform platform, cl_platform_info info) { std::string result; cl_int status = platform.getInfo(info,&result); CHECK_ERROR(status, "cl::Platform::getInfo"); return result; }
void printDevices( std::vector<cl::Device> devices, cl::Platform platform ){ // name of the current platform for debugging messages std::string platformName; platform.getInfo((cl_platform_info)CL_PLATFORM_NAME, &platformName); // print informations on devices cout << devices.size() << " devices found on " << platformName << ".\n"; for( auto dev : devices ){ string devName; string devOpenCLVersion; string devProfile; string devVersion; string driverVersion; std::vector<size_t> maxWorkItemSizes; dev.getInfo( CL_DEVICE_MAX_WORK_ITEM_SIZES, &maxWorkItemSizes ); dev.getInfo( CL_DEVICE_NAME , &devName ); dev.getInfo( CL_DEVICE_OPENCL_C_VERSION , &devOpenCLVersion ); dev.getInfo( CL_DEVICE_PROFILE , &devProfile ); dev.getInfo( CL_DEVICE_VERSION , &devVersion ); dev.getInfo( CL_DRIVER_VERSION , &driverVersion ); cout << "device : " << devName << "\n"; cout << "OpenCl ver: " << devOpenCLVersion << "\n"; cout << "profile : " << devProfile << "\n"; cout << "device ver: " << devVersion << "\n"; cout << "driver ver: " << driverVersion << "\n"; cout << "max work item sizes:"; for( size_t size : maxWorkItemSizes ) cout << " " << size; cout << "\n"; } }
void CLHelper::printVendor(cl::Platform platform) { cl_int err; std::string vendorString; err = platform.getInfo(CL_PLATFORM_VENDOR, &vendorString); CHECK_OPENCL_ERROR(err, "cl::Platform::getInfo() failed."); std::cout << "Platform Vendor : " << vendorString << std::endl; }
void CL_Program::printPlatformInfo(cl::Platform p) { std::string platformVendor; std::string platformName; std::string platformVersion; std::string platformProfile; std::string icd_suffix; std::string platform_ext; p.getInfo((cl_platform_info)CL_PLATFORM_VENDOR, &platformVendor); p.getInfo((cl_platform_info)CL_PLATFORM_NAME, &platformName); p.getInfo((cl_platform_info)CL_PLATFORM_VERSION, &platformVersion); p.getInfo((cl_platform_info)CL_PLATFORM_PROFILE, &platformProfile); p.getInfo((cl_platform_info)CL_PLATFORM_ICD_SUFFIX_KHR, &icd_suffix); p.getInfo((cl_platform_info)CL_PLATFORM_EXTENSIONS, &platform_ext); std::cout << "\tVendor: " << platformVendor << "\n\tName: " << platformName << "\n\tVersion: " << platformVersion << "\n\tPlatormProfile: " << platformProfile << "\n\ticdsuffix: " << icd_suffix << "\n\tplatform extensions: " << platform_ext << std::endl; std::ofstream out("gpu_debug.txt", std::ios::app ); out << "\tVendor: " << platformVendor << "\n\tName: " << platformName << "\n\tVersion: " << platformVersion << "\n\tPlatormProfile: " << platformProfile << "\n\ticdsuffix: " << icd_suffix << "\n\tplatform extensions: " << platform_ext; out.close(); }