Skip to content

Conversation

@pkienzle
Copy link
Contributor

@pkienzle pkienzle commented Sep 19, 2025

Cache the kernels as well as the program so that we avoid the following RepeatedKernelRetrieval warning:

sasmodels/model_test.py::ellipsoid[opencl]
  /.../sasmodels/kernelcl.py:469: RepeatedKernelRetrieval: Kernel 'ellipsoid_Iqxy' has been retrieved more than once. Each retrieval creates a new, independent kernel, at possibly considerable expense. To avoid the expense, reuse the retrieved kernel instance. To avoid this warning, use cl.Kernel(prg, name).
    functions = [getattr(program, k) for k in names]

Note: this code is used by SasView

@DrPaulSharp DrPaulSharp force-pushed the fix-ocl-duplicate-kernel branch from 8fb43a9 to d2ceae8 Compare November 3, 2025 16:20
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