[Openmp-commits] [PATCH] D14031: [OpenMP] Initial implementation of OpenMP offloading library - libomptarget.

Christopher Bergström via Openmp-commits openmp-commits at lists.llvm.org
Thu Feb 11 12:07:56 PST 2016


cbergstrom added a comment.

Please take this comment as more a nitpick instead of having tested it
----------------------------------------------------------------------

In general I see a lot of really dirty code - Why so many casts? What makes "long long" universally correct and portable.. are there standard types we can use to represent pointers?

https://docs.oracle.com/cd/E19683-01/806-6543/chapter3-10/index.html
http://stackoverflow.com/questions/25211015/using-x-to-print-the-hex-address-contained-in-a-pointer

uintptr_t
printf("%" PRIxPTR "\n", (uintptr_t) p);

--------

Is it really a good idea to have two functions which are almost the same, but one is blocking and the other isn't?

__tgt_target_data_begin_nowait vs __tgt_target_data_begin

Would it not be "better" or more clean for it to take a parameter?


================
Comment at: libomptarget/src/omptarget.cpp:348
@@ +347,3 @@
+        DP("Deleting tgt data 0x%016llx of size %lld\n",
+           (long long)HT.TgtPtrBegin, (long long)Size);
+        RTL->data_delete(RTLDeviceID, (void *)HT.TgtPtrBegin);
----------------
Instead of casting to long long and friends - what about making the type  uintptr_t ?


http://reviews.llvm.org/D14031





More information about the Openmp-commits mailing list