Using OpenCL in a project (fast beginner open source question)

Hello there,
As someone who is new to OpenCL, I wanted to know if legal-speaking I could add the OpenCL.Dll file into a project I am making.
Without altering its code of course.
Will I need special permission/ some sort of payment or can I add freely add it to my product?

Thanks in advance!

You do NOT want to ship this DLL with your project. The one installed on the system is the one you want to use. What problem are you trying to solve?

Would it cause bugs if I do?
I want to make it easier to use for clients that do not have the DLL installed

If your users have an OpenCL capable device and the necessary drivers installed, they will have an OpenCL.dll installed. If they don’t, shipping one with your application won’t help them - they need to have the right GPU/CPU driver installed in order to be able run any OpenCL applications.

Thanks for the reply,
A small part of my project uses OpenCL and the rest doesn’t depend on it. What I want is for the errors jumping around about not finding the “opencl.dll” to stop jumping for people who don’t have it.

I want to add the dll to bypass that problem, without actually giving them access to OpenCL. So no legal violation?

Whether it’s legal or not is immaterial; it simply won’t work. The Intel OpenCL.dll is different from the AMD one, which is different from the NVIDIA one. And they change with driver updates, bug fixes, and the like.

What you need is to use the OpenCL ICD, rather than linking directly with the vendor’s OpenCL.dll. The ICD detects which OpenCL implementations are installed and gives you a choice of which implementations to use. And thus, if there are none, it will tell you that, so you won’t be able to use OpenCL on that machine.

There’s a version of the ICD for OpenCL 1.2, but I haven’t found one for 2.0.

On Windows, OpenCL.dll is the ICD, but you still don’t want to ship it. It varies by version, for one thing (what if you ship a version 1.2 one, but the vendor driver updated the system ICD OpenCL.dll to version 2.0?). Also, just having OpenCL.dll on the system won’t allow your application to work, if you use OpenCL. If your OpenCL support is optional, you’re better off dynamically linking to OpenCL.dll and deal with the case of it not being there.