glotzerlab / hoomd-blue

Molecular dynamics and Monte Carlo soft matter simulation on GPUs.

Home Page:http://glotzerlab.engin.umich.edu/hoomd-blue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUDA warnings in 4.6.0

mphoward opened this issue · comments

Description

Compiling the new release of HOOMD with CUDA enabled generates a ton of warnings from the BoxDim such as

hoomd-blue/hoomd/BoxDim.h(154): warning #20013-D: calling a constexpr __host__ function("operator[]") from a __host__ __device__ function("BoxDim") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
hoomd-blue/hoomd/BoxDim.h(155): warning #20015-D: calling a constexpr __host__ function from a __host__ __device__ function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

The reason for this seems to be the use of the host method [] from std::array inside a device constructor. As far as I know, this is actually OK to do because the contents of array aren't being modified. However, HOOMD should compile without warnings. A possible solution would be to make this constructor available only on the host if it isn't actually needed in device code. Another solution would be to force the caller to unpack the array themselves.

Script

This warning is produced by the GitHub Actions builds. See:

https://github.com/glotzerlab/hoomd-blue/actions/runs/8359002625/job/22881455368

Input files

No response

Output

See above.

Expected output

No warnings.

Platform

Linux

Installation method

Compiled from source

HOOMD-blue version

4.6.0

Python version

3.11.3