inducer / pyopencl

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

warning: unused argument during compilation #511

Open jeremymoran opened 3 years ago

jeremymoran commented 3 years ago

Started getting this warning after moving to Ubuntu 20.04.

Using RX Vega 64 and the AMD gpupro drivers. My Kernel executes and runs fine, but having the warning pop up is frustrating. Is it possible to resolve this? Or suppress the warning completely. Setting os.environ[ "PYOPENCL_COMPILER_OUTPUT" ] = "0" still displays a warning.

/home/jer/python/virtualenv/REDHOT4/lib/python3.8/site-packages/pyopencl/__init__.py:264: CompilerWarning: Built kernel retrieved from cache. Original from-source build had warnings:
Build on <pyopencl.Device 'gfx900' on 'AMD Accelerated Parallel Processing' at 0x256a660> succeeded, but said:

warning: argument unused during compilation: '-I /home/jer/python/virtualenv/REDHOT4/lib/python3.8/site-packages/pyopencl/cl'
1 warning generated.

  warn(text, CompilerWarning)
inducer commented 3 years ago

For now, pyopencl unconcditionally provides access to the include files that come "in the box", whether they're used or not. I'm not sure how I feel about compilers complaining about extra include directories. I'm not sure I agree with silencing all compiler warnings just to avoid this one, however you could easily install a warning filter (via warnings.filterwarnings in the standard library) in your code that filters this out.