[all-commits] [llvm/llvm-project] d0bc04: [libomptarget] Fix a bug whereby firstprivates are...
George Rokos via All-commits
all-commits at lists.llvm.org
Fri May 21 10:56:50 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d0bc04d6b91d6bc5f15c981da9d2b911fb578c59
https://github.com/llvm/llvm-project/commit/d0bc04d6b91d6bc5f15c981da9d2b911fb578c59
Author: George Rokos <georgios.rokos at intel.com>
Date: 2021-05-21 (Fri, 21 May 2021)
Changed paths:
M openmp/libomptarget/src/omptarget.cpp
A openmp/libomptarget/test/mapping/lambda_by_value.cpp
Log Message:
-----------
[libomptarget] Fix a bug whereby firstprivates are not copied over to the device
The check for the TO flag when processing firstprivates is missing. As a result,
sometimes the device copy of a firstprivate never gets initialized. Currectly we
try to force lambda structs to be allocated immediately by marking them as a
non-firstprivate, so that PrivateArgumentManagerTy::addArg allocates memory for
them immediately. However, calling addArg with IsFirstPrivate=false makes the
function skip initializing the device copy. Whether an argument is firstprivate
and whether we need to allocate memory immediately are not synonyms, so this
patch introduces one more control variable for immediate allocation and sets it
apart from initialization.
Differential Revision: https://reviews.llvm.org/D102890
More information about the All-commits
mailing list