-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[acc][flang] Checking scalar like variables when there's storage operand to fir.declare #163439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
65b02a4
add initial implementation
SusanTan 64d0110
tweak
SusanTan c7e7321
tweak
SusanTan 48733f4
code cleanup
SusanTan 32b5f71
add a test
SusanTan fa52cbb
cleanup code
SusanTan e2141ff
refactor code to parse in OpenACC.cpp
SusanTan c27d440
use collapseLoopCount in calculating tile loopcount
SusanTan d92e115
Merge remote-tracking branch 'origin/main' into susant/collapse-force
SusanTan 8c11d6f
format
SusanTan 7cca8e4
refactor
SusanTan 4fcf028
add checking storage to getBaseRef
SusanTan 41bb11d
Merge remote-tracking branch 'origin' into susant/getbaseref
SusanTan ed8bed6
add a test
SusanTan 49287c2
change return
SusanTan 25c4b31
format
SusanTan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
flang/test/Fir/OpenACC/openacc-type-categories-declare-storage.mlir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Use --mlir-disable-threading so that the diagnostic printing is serialized. | ||
// RUN: fir-opt %s -pass-pipeline='builtin.module(test-fir-openacc-interfaces)' -split-input-file --mlir-disable-threading 2>&1 | FileCheck %s | ||
|
||
module { | ||
// Build a scalar view via fir.declare with a storage operand into an array of i8 | ||
func.func @_QPdeclare_with_storage_is_nonscalar() { | ||
%c0 = arith.constant 0 : index | ||
%arr = fir.alloca !fir.array<4xi8> | ||
%elem_i8 = fir.coordinate_of %arr, %c0 : (!fir.ref<!fir.array<4xi8>>, index) -> !fir.ref<i8> | ||
%elem_f32 = fir.convert %elem_i8 : (!fir.ref<i8>) -> !fir.ref<f32> | ||
%view = fir.declare %elem_f32 storage(%arr[0]) {uniq_name = "_QFpi"} | ||
: (!fir.ref<f32>, !fir.ref<!fir.array<4xi8>>) -> !fir.ref<f32> | ||
// Force interface query through an acc op that prints type category | ||
%cp = acc.copyin varPtr(%view : !fir.ref<f32>) -> !fir.ref<f32> {name = "pi", structured = false} | ||
acc.enter_data dataOperands(%cp : !fir.ref<f32>) | ||
return | ||
} | ||
|
||
// CHECK: Visiting: %{{.*}} = acc.copyin varPtr(%{{.*}} : !fir.ref<f32>) -> !fir.ref<f32> {name = "pi", structured = false} | ||
// CHECK: Pointer-like and Mappable: !fir.ref<f32> | ||
// CHECK: Type category: array | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.