-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual method of a class cannot be used in other class' method on gpu hip #145
Comments
On the commit This returns a memory access fault on gpu hip path:
It seems that there are similar issues (ROCm/tensorflow-upstream#302) with |
This issue appears to be hardware specific. We were seeing the problems on our |
This is demonstrated in
DGNonLinearForm::evalFaceFlux_gpu()
as a minimal example on the branchgpu_dryair_transport
.A known problem in this approach is that it is not applicable to other places where data array indexing order is different.
While this is working at least for
d_rsolver->Eval_LF
, following the same approach ford_flux->ComputeViscousFluxes
does not work (see line 371 insrc/dgNonlinearForm.cpp
). Through a small test on the branchissue145
, it turns out that the problem is the calling of other objects' virtual methods, such asmixture->computeSpeciesEnthalpies
ortransport->ComputeFluxTransportProperties
withind_flux->ComputeViscousFluxes
.When all these methods are hard-coded within the function,
d_flux->ComputeViscousFluxes
works.If these virtual methods are changed to non-virtual, they work properly on gpu hip. On the branch
issue145
(see line 95 ofsrc/equation_of_state.cpp
),GasMixture::computeSpeciesEnthalpies
is defined as non-virtual, which can passcyl3d.gpu.test
. (For demonstration purpose, I hard-codedtransport->ComputeFluxTransportProperties
withind_flux->ComputeViscousFluxes
, on line 283 ofsrc/fluxs.cpp
. So other tests will fail exceptcyl3d.gpu.test
.)Defining these methods to be
const
did not make a difference.Both
computeSpeciesEnthalpies
andComputeFluxTransportProperties
are defined to beMFEM_HOST_DEVICE
.For an unknown reason,
mixture->ComputePressure
works even within other objects' method. Since this is definedinline
, I also triedinline
for other methods, but it didn't work.Just as
const RiemannSolver *d_rsolver = rsolver_;
, I attempted to define a pointerGasMixture *d_mix = mixture;
withinComputeViscousFluxes
routine, although this did not work. Perhaps the pointer must be defined outsideMFEM_FORALL
loop, but this is not attempted yet.It seems that the last point is the fundamental reason for the failure. @trevilo , why should these objects be defined outside
MFEM_FORALL
loop? Do you think there would be any workaround for this?The text was updated successfully, but these errors were encountered: