[all-commits] [llvm/llvm-project] 4d680f: [HIP][Clang][Sema] Add Sema support for `hipstdpar`

Alex Voicu via All-commits all-commits at lists.llvm.org
Tue Oct 3 05:29:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d680f56475ce17d8fb793655eb3d77ac8aee1b9
      https://github.com/llvm/llvm-project/commit/4d680f56475ce17d8fb793655eb3d77ac8aee1b9
  Author: Alex Voicu <alexandru.voicu at amd.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M clang/lib/Sema/SemaCUDA.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaStmtAsm.cpp
    A clang/test/SemaHipStdPar/device-can-call-host.cpp

  Log Message:
  -----------
  [HIP][Clang][Sema] Add Sema support for `hipstdpar`

This patch adds the Sema changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. This change impacts the CUDA / HIP language specific checks, and only manifests if compiling in `hipstdpar` mode. In this case, we essentially do three things:

1. Allow device side callers to call host side callees - since the user visible HLL would be standard C++, with no annotations / restriction mechanisms, we cannot unambiguously establish that such a call is an error, so we conservatively allow all such calls, deferring actual cleanup to a subsequent pass over IR;
2. Allow host formed lambdas to capture by reference;
3. Allow device functions to use host global variables.

Reviewed by: yaxunl

Differential Revision: https://reviews.llvm.org/D155833




More information about the All-commits mailing list