Skip to content

opencl: bugfix increment ref_count in ggml_backend_opencl_init()#26162

Open
akleine wants to merge 1 commit into
ggml-org:masterfrom
akleine:master
Open

opencl: bugfix increment ref_count in ggml_backend_opencl_init()#26162
akleine wants to merge 1 commit into
ggml-org:masterfrom
akleine:master

Conversation

@akleine

@akleine akleine commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Overview

Increment ref_count in ggml_backend_opencl_init()
This is important later in the free() method of ggml_backend_opencl_context at program end.

Additional information

If we do not increment the ref_count, the result would be -1 here, and consequently, some parts of free() would not executed. For example the profiling data would not be flushed and written. ( #ifdef GGML_OPENCL_PROFILING )

Requirements

Incrementing `ref_count` at the beginning is important later
in the `free()` method of the `ggml_backend_opencl_context` at program end.
If we do not increment the `ref_count`, the result would be -1 here,
and consequently, the profiling data would not be flushed and written.
( #ifdef GGML_OPENCL_PROFILING )
@akleine
akleine requested a review from a team as a code owner July 27, 2026 05:38
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend labels Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant