You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#89 introduced a host_allocator concept. It is a way to make sure that we can get a field that lives in host memory when we need. Currently, its used for setting the initial conditions, but I anticipate it'll soon be used for other purposes too.
The open matter on this is that one can accidentally mix and use get_block and release_block from backend%allocator and solver%host_allocator. In OpenMP backend this won't cause any immediate issues, because both allocators point to the same object, but this isn't the case in CUDA backend.
So lets discuss the best strategy to prevent such misuses if we can.
One thing I tried was having field pointers a type type(field_t) instead of class(field_t) so that a get_field from CUDA allocator will raise an error, it was okay with nvfortran but the gcc compiler didn't like this.
One thing I have in mind is implementing a get_host_field function in allocator, and using this instead with host_allocator. But this can still cause problems when we test things on OpenMP and try to run on CUDA. In the meeting we had a few recommendations but I'm not sure if I understand these, so could you explain here please?
The text was updated successfully, but these errors were encountered:
#89 introduced a host_allocator concept. It is a way to make sure that we can get a field that lives in host memory when we need. Currently, its used for setting the initial conditions, but I anticipate it'll soon be used for other purposes too.
The open matter on this is that one can accidentally mix and use
get_block
andrelease_block
frombackend%allocator
andsolver%host_allocator
. In OpenMP backend this won't cause any immediate issues, because bothallocator
s point to the same object, but this isn't the case in CUDA backend.So lets discuss the best strategy to prevent such misuses if we can.
One thing I tried was having
field
pointers a typetype(field_t)
instead ofclass(field_t)
so that aget_field
from CUDA allocator will raise an error, it was okay with nvfortran but the gcc compiler didn't like this.One thing I have in mind is implementing a
get_host_field
function inallocator
, and using this instead withhost_allocator
. But this can still cause problems when we test things on OpenMP and try to run on CUDA. In the meeting we had a few recommendations but I'm not sure if I understand these, so could you explain here please?The text was updated successfully, but these errors were encountered: