r326590 - [OPENMP] Treat local variables in CUDA mode as thread local.

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 2 09:28:45 PST 2018


Hi Alexey,

Am 2018-03-02 18:17, schrieb Alexey Bataev via cfe-commits:
> Author: abataev
> Date: Fri Mar  2 09:17:12 2018
> New Revision: 326590
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=326590&view=rev
> Log:
> [OPENMP] Treat local variables in CUDA mode as thread local.
> 
> In CUDA mode all local variables are actually thread
> local|threadprivate, not private, and, thus, they cannot be shared
> between threads|lanes.
> 
> Added:
>     cfe/trunk/test/OpenMP/nvptx_target_cuda_mode_messages.cpp
> Modified:
>     cfe/trunk/include/clang/Driver/Options.td
>     cfe/trunk/lib/Sema/SemaOpenMP.cpp
> 
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=326590&r1=326589&r2=326590&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Fri Mar  2 09:17:12 2018
> @@ -1427,7 +1427,7 @@ def fopenmp_simd : Flag<["-"], "fopenmp-
>    HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
>  def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>,
> Flags<[CC1Option, NoArgumentUnused]>;
>  def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">,
> Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
> -def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">,
> Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
> +def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">,
> Group<f_Group>, Flags<[NoArgumentUnused]>;

Did you remove CC1Option intentionally? I think we need this with the 
method Carlo chose.
Btw unless I muss something OpenMPCUDAMode is not the default? If I 
remember correctly we discussed this on Phabricator?

Regards,
Jonas


More information about the cfe-commits mailing list