commit | 2e353a635b90a6c31eee5fd4ec0335f37f130628 | [log] [tgz] |
---|---|---|
author | Andre Kuhlenschmidt <andre.kuhlenschmidt@gmail.com> | Mon Apr 14 09:08:21 2025 -0700 |
committer | GitHub <noreply@github.com> | Mon Apr 14 09:08:21 2025 -0700 |
tree | 3d51c304847239530b880a2715bfd017e4a53063 | |
parent | 71d10590dbc041139644f00144513c7f487a94ba [diff] |
[flang][openacc] Relax constraint on OpenACC declare statement (#135238) OpenACC declare statements are restricted from having having clauses that reference assumed size arrays. It should be the case that we can implement `deviceptr` and `present` clauses for assumed-size arrays. This is a first step towards relaxing this restriction. Note running flang on the following example results in an error in lowering. ``` $ cat t.f90 subroutine vadd (a, b, c, n) real(8) :: a(*), b(*), c(*) !$acc declare deviceptr(a, b, c) !$acc parallel loop do i = 1,n c(i) = a(i) + b(i) enddo end subroutine $ flang -fopenacc -c t.f90 error: loc("/home/akuhlenschmi/work/p4/ta/tests/openacc/src/t.f90":3:7): expect declare attribute on variable in declare operation error: Lowering to LLVM IR failed error: loc("/home/akuhlenschmi/work/p4/ta/tests/openacc/src/t.f90":4:7): unsupported OpenACC operation: acc.private.recipe error: loc("/home/akuhlenschmi/work/p4/ta/tests/openacc/src/t.f90":4:7): LLVM Translation failed for operation: acc.private.recipe error: failed to create the LLVM module ``` I would like to to share this code, because others are currently working on the implementation of `deviceptr`, but it is obviously not running end-to-end. I think the cleanest approach to this would be to put this exception to the rule behind some feature flag, but I am not certain what the precedence for that is.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.