Skip to content

pytest warnings from sasmodels for opencl #659

@pkienzle

Description

@pkienzle

The pytest command here:

$ pytest sasmodels/model_test.py::ellipsoid[opencl]

gives the following warnings:

sasmodels/model_test.py::ellipsoid[opencl]
  .../sasmodels/sasmodels/kernelcl.py:470: RepeatedKernelRetrieval: Kernel 'ellipsoid_Iq' 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]

sasmodels/model_test.py::ellipsoid[opencl]
  .../sasmodels/sasmodels/kernelcl.py:470: 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]

sasmodels/model_test.py::ellipsoid[opencl]
  .../sasmodels/sasmodels/kernelcl.py:470: RepeatedKernelRetrieval: Kernel 'ellipsoid_Imagnetic' 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]

It appears that the opencl compiler is being called multiple times. These warnings only appear for ellipsoid, cylinder, and sphere, which are the shapes which have a shape@structure test in their test suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions