是否有任何OpenCL主机具有多个平台? [英] Does any OpenCL host have more than one platform?

查看:181
本文介绍了是否有任何OpenCL主机具有多个平台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Khronos的OpenCL 1.0和1.1中平台的定义规范:

The definition of a platform in Khronos' OpenCL 1.0 and 1.1 specification:

平台:主机以及由OpenCL框架管理的一系列设备,这些应用程序允许应用程序共享资源并在平台上的设备上执行内核.

Platform: The host plus a collection of devices managed by the OpenCL framework that allow an application to share resources and execute kernels on devices in the platform.

OpenCL函数 clGetPlatformIDs 创建一系列平台,这意味着可以使用多个平台.是否可以安全地假设给定的OpenCL主机只有一个平台?

The OpenCL function clGetPlatformIDs creates an array of platforms, implying that multiple platforms are possible. Is it safe to assume that a given OpenCL host has only one platform?

换句话说,我会在任何主机上丢失任何东西吗?

In other words, will I lose anything on any host by doing this:

cl_platform_id platform_id;
cl_uint num_platforms;
errcode = clGetPlatformIDs(1, &platform_id, &num_platforms);

推荐答案

我不会依赖只有一个平台.当您在一个系统上有多个OpenCL实现时(尽管我不确定这是仅计划中的还是已经完成的,但OpenCL ICD应该可以实现),您应该获得多个平台,每个opencl实现一个.一个可能有多个opencl实现的示例是一个在gpu上运行opencl的nvidia实现和一个在cpu上运行的amd实现,因此也不至于如此.

I wouldn't rely on there being only one Platform. When you have multiple OpenCL implementations on one system (which should be possible with the OpenCL ICD, although I'm not sure if that is only planned or already finished), you should get multiple platforms, one for each opencl implementation. One example where there could be multiple opencl implementations would be an nvidia implementation to run opencl on gpu and an amd implementation to run on cpu, so that it not that far fetched either.

查看 http://developer. amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71 (更好)对此进行了描述

edit: look at http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71 for (better) desciption of this

这篇关于是否有任何OpenCL主机具有多个平台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆