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

27 lines
914 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.
# CLContextCreate
Creates an OpenCL context and returns its handle.
```
int  CLContextCreate(
   int  device=CL_USE_ANY     // Serial number of the OpenCL device or macro
   );
```
Parameter
device
[in]  The ordinal number of the OpenCL-device in the system. Instead of a specific number, you can specify one of the following values:
- CL_USE_ANY any available device with OpenCL support is allowed;
- CL_USE_CPU_ONLY only OpenCL emulation on CPU is allowed;
- CL_USE_GPU_ONLY OpenCL emulation is prohibited and only specialized devices with OpenCL support (video cards) can be used;
- CL_USE_GPU_DOUBLE_ONLY  only the GPUs that support type [double](/en/docs/basis/types/double) are allowed.
Return Value
A handle to the OpenCL context if successful, otherwise -1. For information about the error, use the [GetLastError()](/en/docs/check/getlasterror) function.