[PATCH] D136103: OpenMP asynchronous memory copy support

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 18 15:00:36 PDT 2022


jdoerfert added a comment.



> 6. Why do you access args_ for some parts and not for others? That said, where does the hidden helper need access to the dependences anyway?
>
> there's type cast for depend objects from 'omp_depend_t' to 'kmp_depend_info_t*', and the array of casted depend objects is consumed by '__kmpc_omp_task_with_deps' , to make it safe, I just make larray of casted depend objects to live longer, thus attached it to Args object.

So, you are saying the task_with_deps function does *not* copy the dependences and therefore the array has to outlive the function?



================
Comment at: openmp/libomptarget/src/private.h:248
+  kmp_depend_info_t* Depobjs;
+};
+    
----------------
As mentioned before. There is a lot of literal duplication here with no obvious benefit. Use a base class, or other schemes, to cut down on that. Also, the functions further above should share the same code.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136103/new/

https://reviews.llvm.org/D136103



More information about the cfe-commits mailing list