exapde / Exasim

Exasim: Generating Discontinuous Galerkin Codes For Extreme Scalable Simulations
MIT License
65 stars 19 forks source link

Julia GPU compilation warnings NavierStokes/naca #31

Open e-dinesh opened 2 years ago

e-dinesh commented 2 years ago

warning message pops up in Julia/python versions, not in Matlab. [#26]

resulted in the warnings (below) but seems the simulation is not affected (to be verified). <<< compile code... ar: creating opuApp.a a - opuApp.o gpuInitu.cu(11): warning: variable "xdg1" was declared but never referenced detected during: instantiation of "void kernelgpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=double]" (26): here instantiation of "void gpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=double]" (29): here gpuInitu.cu(12): warning: variable "xdg2" was declared but never referenced detected during: instantiation of "void kernelgpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=double]" (26): here instantiation of "void gpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=double]" (29): here gpuInitu.cu(11): warning: variable "xdg1" was declared but never referenced detected during: instantiation of "void kernelgpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=float]" (26): here instantiation of "void gpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=float]" (30): here gpuInitu.cu(12): warning: variable "xdg2" was declared but never referenced detected during: instantiation of "void kernelgpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=float]" (26): here instantiation of "void gpuInitu(T *, T *, T *, T *, int, int, int, int, int, int) [with T=float]" (30): here
rloekvh commented 2 years ago

Right, the compilation string for gpuApp contains the "-w" flag in compilecode.m but this isn't in the py or jl versions. So an immediate hotfix would be to add this flag to the other compilecode files, but I personally don't think this should be default behavior. I think warnings should show by default and be blocked if the user finds them annoying.

So I'd recommend adding the -w flag for now (which can be passed in with pde.gpuappflags since #30 was merged) and I'll try to fix the warnings by not declaring unused variables