-
Notifications
You must be signed in to change notification settings - Fork 116
Prepare PiecewiseLinearTwoPhaseMaterial for GPU support #4153
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
Conversation
|
|
||
| template <class TraitsT, class ContainerType, class ViewType> | ||
| PiecewiseLinearTwoPhaseMaterialParams<TraitsT, ViewType> make_view(const PiecewiseLinearTwoPhaseMaterialParams<TraitsT, ContainerType>& params) { | ||
| ViewType SwPcwnSamples = make_view<const float, float>(params.SwPcwnSamples()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be float unconditionally, and not depend on the underlying scalar type requested in the ViewType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, It should depend on the viewType which should store something that matches the containerType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a static_assert in your future...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the type and added the static assert now
|
Jenkins build this please |
1 similar comment
|
Jenkins build this please |
kjetilly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. A lot of files include both config.h and gpuDecorators.h, but the former is only needed for the macros gpuDecorators.h, which already include config.h. Also, there seems to be some inconsistencies with the defintions in gpuDecorators.h
opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterial.hpp
Outdated
Show resolved
Hide resolved
7fab79f to
259d3ba
Compare
|
Jenkins build this please |
e38d557 to
de6bbcc
Compare
|
Jenkins build this please |
1 similar comment
|
Jenkins build this please |
|
I haven't looked at anything here, but for future reference we usually prefer that PRs be made from branches on your own fork instead of a development branch created directly in the main OPM/opm-common repository. |
|
Good catch @bska, this was probably caused by an unintentional |
|
Jenkins build this please |
cuistl will soon be renamed gpuistl in opm-simulators
ac44e51 to
71e216a
Compare
|
Jenkins build this please |
|
A comment on config.h: This file shall be included in all compilation units (= .cpp files) as the first thing, before any other includes. No header files shall include it! If a header file contains conditional compilation depending on config.h-defined things, it will get the definition of any such macros via the .cpp file including config.h, not by including it itself. |
True, although we do break that rule in a couple of important cases. For instance in PR OPM/opm-simulators#5227. |
I get that from a technical standpoint this needs to be the case (since This problem has probably not been relevant up until now, but with the CUDA/HIP definitions that do rely on the defines in If we look at other libraries, they typically include a |
|
In light of these comments I have removed the include of the config.h file from gpuDecorators.hpp. |
|
Jenkins build this please |
|
The PR was merged and I think we should delete the branch now, at least unless it will be needed in the near future. |
|
@bska you can safely delete the branch now |
Thanks for letting me know. I'll delete the branch now. |
Start work on property evaluation on GPUs