Commit 7b710a42 authored by Alexey Bataev's avatar Alexey Bataev
Browse files

[OPENMP]Improve diagnostics for unsupported unified addressing.

Improved diagnostics for better user experience.
parent 100e797a
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -4954,7 +4954,8 @@ void CGOpenMPRuntimeNVPTX::checkArchForUnifiedAddressing(
    const OMPRequiresDecl *D) {
  for (const OMPClause *Clause : D->clauselists()) {
    if (Clause->getClauseKind() == OMPC_unified_shared_memory) {
      switch (getCudaArch(CGM)) {
      CudaArch Arch = getCudaArch(CGM);
      switch (Arch) {
      case CudaArch::SM_20:
      case CudaArch::SM_21:
      case CudaArch::SM_30:
@@ -4966,10 +4967,14 @@ void CGOpenMPRuntimeNVPTX::checkArchForUnifiedAddressing(
      case CudaArch::SM_53:
      case CudaArch::SM_60:
      case CudaArch::SM_61:
      case CudaArch::SM_62:
        CGM.Error(Clause->getBeginLoc(),
                  "Target architecture does not support unified addressing");
      case CudaArch::SM_62: {
        SmallString<256> Buffer;
        llvm::raw_svector_ostream Out(Buffer);
        Out << "Target architecture " << CudaArchToString(Arch)
            << " does not support unified addressing";
        CGM.Error(Clause->getBeginLoc(), Out.str());
        return;
      }
      case CudaArch::SM_70:
      case CudaArch::SM_72:
      case CudaArch::SM_75:
+1 −1
Original line number Diff line number Diff line
@@ -21,5 +21,5 @@
#endif

#ifdef REGION_DEVICE
#pragma omp requires unified_shared_memory // expected-error {{Target architecture does not support unified addressing}} 
#pragma omp requires unified_shared_memory // expected-error-re {{Target architecture sm_{{20|21|30|32|35|37|50|52|53|60|61|62}} does not support unified addressing}}
#endif