Add vectorized version of the getValue function in ScalarField. - #2
Open
damienmarchal wants to merge 1 commit into
Open
Add vectorized version of the getValue function in ScalarField.#2damienmarchal wants to merge 1 commit into
damienmarchal wants to merge 1 commit into
Conversation
This allows to accelerates a lot the evaluation of field defined in python as the conversion has to be done a limited amount of time. On The example-mesh-extraction-from-implicit.py exemple the computation time goes from 26 seconds with the current implementation using getValue down to 4 seconds with the getValues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the scalar field can be evaluated only one by one. This is very time consuming and not CUDA friendly. So I add a new method getValues to get a bunch of values in a single call.
Using the vector version accelerates a lot the the evaluation of fields especially when defined in python because the traversal from c++ to python has to be done one time.
A simple benchmark made on the file example-mesh-extraction-from-implicit.py.
It takes 26 seconds on my machine with the getValue API and only 4 seconds with the vector version.