Skip to content

Use strstr to check if fp16 supported#1611

Merged
ggerganov merged 2 commits intoggml-org:masterfrom
howard0su:opencl_checkfp16
May 28, 2023
Merged

Use strstr to check if fp16 supported#1611
ggerganov merged 2 commits intoggml-org:masterfrom
howard0su:opencl_checkfp16

Conversation

@howard0su
Copy link
Copy Markdown
Contributor

No description provided.

@KerfuffleV2
Copy link
Copy Markdown
Contributor

Is clGetDeviceInfo with CL_DEVICE_EXTENSIONS guaranteed to terminate its result with \0?

Doesn't seem completely clear from the docs here: https://man.opencl.org/clGetDeviceInfo.html

If not, then it wouldn't be safe to use string functions like strstr,

@howard0su
Copy link
Copy Markdown
Contributor Author

Is clGetDeviceInfo with CL_DEVICE_EXTENSIONS guaranteed to terminate its result with \0?

Doesn't seem completely clear from the docs here: https://man.opencl.org/clGetDeviceInfo.html

If not, then it wouldn't be safe to use string functions like strstr,

Upon reviewing the OpenCL 3.0 specification, I found that it does not explicitly mention whether the CL_DEVICE_EXTENSIONS string returned by clGetDeviceInfo is guaranteed to be null-terminated. The specification only states that the returned value is a "space-separated list of extension names" without specifying the null-termination.

@ggerganov ggerganov merged commit ca74884 into ggml-org:master May 28, 2023
@howard0su howard0su deleted the opencl_checkfp16 branch May 29, 2023 08:45
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Use strstr to check if fp16 supported

* Ensure ext_buffer is null terminated
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* Use strstr to check if fp16 supported

* Ensure ext_buffer is null terminated
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* Use strstr to check if fp16 supported

* Ensure ext_buffer is null terminated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants