inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.04k stars 237 forks source link

Work around spurious size warnings #739

Closed matthiasdiener closed 2 months ago

matthiasdiener commented 2 months ago

Avoids warnings of the type:

  src/wrap_cl.hpp: In function ‘pyopencl::event* pyopencl::enqueue_svm_memfill(command_queue&, svm_pointer&, pybind11::object, pybind11::object, pybind11::object)’:
  src/wrap_cl.hpp:3970:34: warning: ‘size’ may be used uninitialized [-Wmaybe-uninitialized]
   3970 |       if (have_size && user_size > size)
        |                        ~~~~~~~~~~^~~~~~
  src/wrap_cl.hpp:3960:12: note: ‘size’ was declared here
   3960 |     size_t size;
        |            ^~~~