[llvm-bugs] [Bug 46338] New: [OpenMP5.0]'isa' and 'arch' trait in 'device' context selector not supported

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 15 23:00:39 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46338

            Bug ID: 46338
           Summary: [OpenMP5.0]'isa' and 'arch' trait in 'device' context
                    selector not supported
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sulinna at cn.fujitsu.com
                CC: llvm-bugs at lists.llvm.org

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. 

https://www.openmp.org/spec-html/5.0/openmpsu25.html#x42-490002.3.1


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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200616/1579f2f4/attachment.html>


More information about the llvm-bugs mailing list