Files
mql5-skills/skills/mql5/references/docs/29-opencl/1030-opencl-clsetkernelarg.md
T
2026-06-23 21:47:51 +08:00

39 lines
931 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CLSetKernelArg
Sets a parameter for the OpenCL function.
```
bool  CLSetKernelArg(
   int   kernel,        // Handle to the kernel of an OpenCL program
   uint  arg_index,     // The number of the argument of the OpenCL function
   void  arg_value      // Source code
   );
```
Parameters
kernel
[in]  Handle to a kernel of the OpenCL program.
arg_index
[in]  The number of the function argument, numbering starts with zero.
arg_value
[in]  The value of the function argument.
Return Value
Returns true if successful, otherwise returns false. For information about the error, use the [GetLastError()](/en/docs/check/getlasterror) function.
Note
At the moment, the following error codes are used:
- ERR_INVALID_PARAMETER,
- ERR_OPENCL_INVALID_HANDLE invalid handle to the OpenCL kernel.
- ERR_OPENCL_SET_KERNEL_PARAMETER - internal error of OpenCL.