<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [OpenMP5.0]'isa' and 'arch' trait in 'device' context selector not supported"
   href="https://bugs.llvm.org/show_bug.cgi?id=46338">46338</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[OpenMP5.0]'isa' and 'arch' trait in 'device' context selector not supported
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sulinna@cn.fujitsu.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In OpenMP5.0's specifiction(2.3.1  OpenMP Context) of the url below, device set
includes traits: kind, isa, arch, but clang seems not supported the 'isa',
'arch' trait. 

<a href="https://www.openmp.org/spec-html/5.0/openmpsu25.html#x42-490002.3.1">https://www.openmp.org/spec-html/5.0/openmpsu25.html#x42-490002.3.1</a>


test case:
----------------------
#include <omp.h>

void   base_saxpy(int, float, float *, float *);
void avx512_saxpy(int, float, float *, float *);

#pragma omp declare variant( avx512_saxpy ) \
                      match( device={isa("core-avx512")} )
void base_saxpy(int n, float s, float *x, float *y)    // base function
{
   #pragma omp parallel for
   for(int i=0; i<n; i++) y[i] = s*x[i] + y[i];
}

void avx512_saxpy(int n, float s, float *x, float *y)    //function variant
{
                                     //assume 64-byte alignment for AVX-512
   #pragma omp parallel for simd simdlen(16) aligned(x,y:64)
   for(int i=0; i<n; i++) y[i] = s*x[i] + y[i];
}

test command:
-------------------------
# clang --version
clang version 10.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix

# clang -fopenmp-version=50 -fopenmp -S declare_variant.2.c
declare_variant.2.c:7:41: warning: unknown context selector in 'device' context
selector set of 'omp declare variant' directive, ignored [-Wopenmp-clauses]
                      match( device={isa("core-avx512")} )
                                        ^
1 warning generated.


When i change test case selector to 'match( device={arch("x86")} )', It
unrecognized device selector 'arch' too.

declare_variant.2.c:7:42: warning: unknown context selector in 'device' context
selector set of 'omp declare variant' directive, ignored [-Wopenmp-clauses]
                      match( device={arch("x86")} )
                                         ^
1 warning generated.

Is Clang supposed not to support 'isa', 'arch' trait in 'device' context
selector?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>