Skip to content

Report the OpenCL error code when command queue creation fails - #59

Merged
galekseev merged 1 commit into
masterfrom
cursor/propagate-opencl-queue-error-code-9783
Aug 2, 2026
Merged

Report the OpenCL error code when command queue creation fails#59
galekseev merged 1 commit into
masterfrom
cursor/propagate-opencl-queue-error-code-9783

Conversation

@galekseev

Copy link
Copy Markdown

createQueue passed NULL for errcode_ret and threw a bare std::runtime_error, so a failure gave no indication of what the runtime had actually rejected. That is why the malformed property list fixed in #58 went unnoticed for years: the driver was returning CL_INVALID_VALUE and the message discarded it.

Capture errcode_ret and route it through the existing OpenCLException, which formats the code into the message. The same failure now reports "failed to create command queue (res = -30)".

The NULL guard is kept so a driver that returns NULL alongside CL_SUCCESS is still caught.

createQueue passed NULL for errcode_ret and threw a bare
std::runtime_error, so a failure gave no indication of what the runtime
had actually rejected. That is why the malformed property list fixed in
#58 went unnoticed for years: the driver was returning CL_INVALID_VALUE
and the message discarded it.

Capture errcode_ret and route it through the existing OpenCLException,
which formats the code into the message. The same failure now reports
"failed to create command queue (res = -30)".

The NULL guard is kept so a driver that returns NULL alongside
CL_SUCCESS is still caught.

Co-authored-by: Gleb Alekseev <alekseev.gleb@gmail.com>
@galekseev
galekseev merged commit b90e8a5 into master Aug 2, 2026
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.

2 participants