简体   繁体   English

自定义OpenCL平台/设备

[英]Custom OpenCL Platform/Device

I am quite new to opencl and would like to do a bit of experimenting. 我对opencl很陌生,想做一些实验。 Specifically, I want to know if anyone can point me in the right direction to create a custom platform or device with an opencl interface attached. 具体来说,我想知道是否有人可以指出正确的方向来创建带有opencl界面的自定义平台或设备。 How this is to be used is to create a simple simulator/debugger that runs alongside the GPU and CPU. 如何使用此方法是创建一个与GPU和CPU一起运行的简单模拟器/调试器。 Are there any official documents relating to the development of custom opencl platforms, devices etc.? 是否有任何有关定制opencl平台,设备等开发的正式文件? Also, are there any good online resources that covers this area? 此外,是否有涵盖该领域的良好在线资源?

Thank you for any help. 感谢您的任何帮助。

Yes, you can write your own OpenCL driver that shows up as a platform with devices on a system. 是的,您可以编写自己的OpenCL驱动程序,该驱动程序显示为带有系统设备的平台。 Khronos has released sample ICD source code you can use. Khronos已经发布了您可以使用的示例ICD源代码 This is part of the OpenCL API registry . 这是OpenCL API注册表的一部分

What you want can be achived by implementing a self made OpenCL implmentation. 您可以通过实施自制的OpenCL实现来实现。 This means you have to implement a library that provides an interface according to the OpenCL standard. 这意味着您必须实现根据OpenCL标准提供接口的库。 If you want this for debugging and/or device emulation you have to interrupt the calls to the device query mechanisms from an underlying OpenCL implementation (eg, Intel's) add an additional device and pass this to the program, which requested the devices from your OpenCL library. 如果您希望将其用于调试和/或设备仿真,则必须中断来自底层OpenCL实施(例如,英特尔公司)对设备查询机制的调用,添加其他设备并将其传递给程序,该程序会从OpenCL请求设备图书馆。 Your proxy implementation can than just pass all operations involving real devices to the underlaying OpenCL implementation, while operations involving your virtual device get handled by your own code. 您的代理实现不仅可以将涉及真实设备的所有操作传递给底层的OpenCL实施,而涉及虚拟设备的操作则由您自己的代码处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM