资源简介
Intel OpenCL示例项目,得到GPU的相关设备信息并打印,用于测试Windows下OpenCL环境搭建是否成功
代码片段和文件信息
// Copyright (c) 2009-2013 Intel Corporation
// All rights reserved.
//
// WARRANTY DISCLAIMER
//
// THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL
// EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE DATA OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
// MATERIALS EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Intel Corporation is the author of the Materials and requests that all
// problem reports or change requests be submitted to it directly
#include
#include
#include
#include
#include
#include
int main (int argc const char** argv)
{
// All stuff needed for sample is kept in this function body.
// There is a couple of help macros; so they are also defined
// directly inside this function and context dependent.
using namespace std;
// -----------------------------------------------------------------------
// 1. Parse command line.
// Default substring for platform name
const char* required_platform_subname = “Intel“;
// Sample accepts one optional argument only see usage information below
if(argc > 2)
{
cerr << “Error: too many command line arguments.\n“;
}
// Print usage information in case
if(
argc > 2 || // ... when wrong number of arguments is provided
argc == 2 && ( // or user asks for help
strcmp(argv[1] “-h“) == 0 ||
strcmp(argv[1] “--help“) == 0
)
)
{
cout
<< “Usage: “ << argv[0] << “ [-h | --help | ]\n\n“
<< “ -h --help Show this help message and exit.\n\n“
<< “ Platform name substring to select platform.\n“
<< “ Case sensitive. Default value is \““
<< required_platform_subname << “\“.\n“
<< “ In case of multiple matches the first matching\n“
<< “ platform is selected.\n“;
exit(argc > 2); // return non-zero only if an error occurs
}
if(argc == 2)
{
// User provided substring for platform name selection:
required_platform_subname = argv[1];
}
// -----------------------------------------------------------------------
// 2. Define error handling strategy.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-01-18 17:32 CapsBasic\
文件 15386 2015-01-18 16:44 CapsBasic\capsbasic.cpp
文件 8062 2015-01-18 16:44 CapsBasic\CapsBasic.vcxproj
文件 958 2015-01-18 16:44 CapsBasic\CapsBasic.vcxproj.filters
文件 1238 2015-01-18 16:44 CapsBasic\CapsBasic_2010.sln
文件 1243 2015-01-18 16:44 CapsBasic\CapsBasic_2012.sln
文件 8284 2015-01-18 16:44 CapsBasic\CapsBasic_2012.vcxproj
文件 1322 2015-01-18 16:44 CapsBasic\CapsBasic_2013.sln
文件 8285 2015-01-18 16:44 CapsBasic\CapsBasic_2013.vcxproj
文件 7163 2015-01-18 16:44 CapsBasic\README.TXT
文件 70028 2015-01-18 16:44 CapsBasic\user_guide.pdf
目录 0 2015-01-18 17:32 templates\
文件 1509 2015-01-18 16:44 templates\intelocl_win32_debug.props
文件 1506 2015-01-18 16:44 templates\intelocl_win32_release.props
文件 1509 2015-01-18 16:44 templates\intelocl_win64_debug.props
文件 1506 2015-01-18 16:44 templates\intelocl_win64_release.props
评论
共有 条评论