cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
60 stars 32 forks source link

Dust make type doesn't build on Crusher #219

Closed bcaddy closed 1 year ago

bcaddy commented 1 year ago

As part of testing the MHD code I've been running all the tests on AMD and NVIDIA. The dust build type won't build at all on AMD systems and throws this error

hipcc -std=c++17 --offload-arch=gfx90a -Wno-unused-result -DCUDA -DMPI_CHOLLA -DBLOCK -DPRECISION=2 -DPPMC -DHLLC -DAVERAGE_SLOW_CELLS -DTEMPERATURE_FLOOR -DVL -DSCALAR -DDUST -DCOOLING_GPU -DSLICES -DPROJECTION -DOUTPUT -DHDF5 -DMPI_GPU -DO_HIP -DGIT_HASH='"01e6cf2630ae9e0951e47c3e6e421a8d7428326b"' -DMACRO_FLAGS='"-DCUDA -DMPI_CHOLLA -DBLOCK -DPRECISION=2 -DPPMC -DHLLC -DAVERAGE_SLOW_CELLS -DTEMPERATURE_FLOOR -DVL -DSCALAR -DDUST -DCOOLING_GPU -DSLICES -DPROJECTION -DOUTPUT -DHDF5 -DMPI_GPU -DO_HIP -DGIT_HASH='"01e6cf2630ae9e0951e47c3e6e421a8d7428326b"'"' -Isrc -I/opt/cray/pe/hdf5/1.12.1.5/crayclang/14.0/include -I/opt/cray/pe/mpich/8.1.17/ofi/crayclang/10.0/include -Wall -ferror-limit=1 -c src/dust/dust_cuda.cu -o src/dust/dust_cuda.o
src/dust/dust_cuda.cu:114:17: error: __device__ function 'calc_tau_sp' cannot overload __host__ __device__ function 'calc_tau_sp'
__device__ Real calc_tau_sp(Real n, Real T) {
                ^
src/dust/dust_cuda.h:15:26: note: previous declaration is here
__device__ __host__ Real calc_tau_sp(Real n, Real T);
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 errors generated when compiling for gfx90a.
make: *** [Makefile:189: src/dust/dust_cuda.o] Error 1
alwinm commented 1 year ago

https://github.com/bcaddy/cholla/pull/14

Since I've seen this kind of thing before I made a PR to fix it--just needs to add __host__ consistently

evaneschneider commented 1 year ago

I believe this is fixed in PR #220, but perhaps @bcaddy can confirm and close.

bcaddy commented 1 year ago

It should have been automatically closed by #220 but I must have gotten the syntax wrong