Made most __device__
functions/methods __host__ __device__
#10
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.
Is blocked by #8. Current branch (host-device_instead_of_device
) is based onmove_copy_mechanisms
, so the corresponding PR should be approved before approving this, and new commits atmove_copy_mechanisms
should be merged into this branch if there are anyI think it's wrong to make most functions/methods
__device__
only because if their parameters are allocated in host memory, they should be executed on host. This enhancement also makes it possible to perform some object setup while it's in host memory and then copy it to device memory (before it was only possible to create an object in device memory and set it up there). However, it's absolutely ok if some function used in setup or simulation uses some CUDA feature(s) and therefore is made__device__
only (of course, it also requires all "parent" functions (which call that function) to be__device__
either)