[PATCH] D63009: [OpenMP] Add target task alloc function with device ID

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 07:50:22 PDT 2019


gtbercea marked an inline comment as done.
gtbercea added inline comments.


================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:5122
+    NewTask = CGF.EmitRuntimeCall(
+      createRuntimeFunction(OMPRTL__kmpc_omp_target_task_alloc), AllocArgs);
+  } else {
----------------
ABataev wrote:
> gtbercea wrote:
> > ABataev wrote:
> > > gtbercea wrote:
> > > > ABataev wrote:
> > > > > Can we use the same function in both modes, with nowait clause and without?
> > > > For nowait we need to use the target_task_alloc variant. There are runtimes - other than the open source one - for which this function does something different.
> > > Trunk relies only to libomptarget interfaces. Why we should take into account some other runtime libraries? Plus, what's so different for async and non-async versions of the directive?
> > Async is not yet fully supported in the OpenMP open source runtime but at some point it will be. This is the first step towards its support. I'm not sure what your objection is. The difference is clear. Device ID must be passed on the async version of this call.
> The difference is not obvious. Why we can't use the same function for sync directives? The fact the it has DeviceId parameter is not an argument here. What's so special from functional point of view?
When you have multiple device on the same system you have to be able to distinguish between then and manage dependencies across these different devices. Knowing the device is a crucial first step in handling these inter-device dependencies.


Repository:
  rC Clang

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

https://reviews.llvm.org/D63009





More information about the cfe-commits mailing list