[Openmp-commits] [llvm] [openmp] [OpenMP][OMPT] Error when registering EMI and non-EMI callbacks (PR #213697)
Jan André Reuter via Openmp-commits
openmp-commits at lists.llvm.org
Tue Aug 4 07:25:43 PDT 2026
Thyre wrote:
> Out of curiosity: Is that restriction something that the runtime has to enforce?
That's a good question. With the wording in OpenMP v5.1 / v5.2
> These callbacks must not be registered at the same time.
and v6.0 / TR15:
> The deprecated target callback must not be registered if a target_emi callback is registered.
I'd understand this as a user not being allowed to register both callbacks at the same time. From my perspective, "must not" is pretty clear in this case. A runtime returning `ompt_set_always` in a case where a user violates this restriction seems incorrect.
A runtime could decide to ignore this restriction, but this opens a wholer can of worms for implementation-defined behavior. For example, does a tool get both callbacks? If so, in which order? Does `target` still set `target_id`, and will the `target_emi` callback receive that `target_id` via `target_data->value`, or its own set `target_data`?
I think this is one reason why this restriction exists in the first place.
I wasn't involved in any of that discussion though. Maybe @jprotze has a better answer.
https://github.com/llvm/llvm-project/pull/213697
More information about the Openmp-commits
mailing list