Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Conversation

skatrak
Copy link
Contributor

@skatrak skatrak commented Aug 8, 2023

Aggregate @agozillon's commits in #217 and resolve merge conflicts with latest amd-trunk-dev branch.

There is still some work to do, since there is a single unit test "mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir" that is probably broken, so I didn't resolve conflicts there. Also, it's likely that some functionality is broken due to the amount of conflicts I went through, but hopefully it's a good starting point. It currently builds and runs.

wip

Initial Working Version, With Hacks

Extend Flang's Map to supprot declare target link case

Changes required for main_all.f95 example working

This is the initial set of changes for getting implicit, explicit and declare target link working, there's a lot
more that needs implemented.

These changes allows the following incredibly simple example to work:

module test_0
        implicit none
        integer :: decltar_v = 5
    !$omp declare target link(decltar_v)
end module test_0
program main
        integer :: hostArray(10), errors = 0
        do i = 1, 10
                hostArray(i) = 0
        end do
        call writeIndex(hostArray, 10)
        do i = 1, 10
                if ( hostArray(i) /= i ) then
                        errors = errors + 1
                end if
        end do
        if ( errors /= 0 ) then
                stop 1
        end if
        print*, "======= FORTRAN Test passed! ======="
!       stop 0
end program main
subroutine writeIndex(int_array, array_length)
        use test_0
        integer :: int_array(*)
        integer :: array_length
        integer :: new_len
        integer :: v = 5 ! global, when given value like this
        ! v = 5 ! local, when given value like this
!$omp target map(tofrom:new_len) map(tofrom:decltar_v)
        new_len = decltar_v + v
!$omp end target
        print*, new_len
        do index_ = 1, new_len
                int_array(index_) = index_
        end do
end subroutine writeIndex

Slightly extending the current support for implicit/external/declare target

A first attempt at tidying up and making declare target more robust/acceptable upstream

Cleanup the declareTarget load generation to be tidier, still wondering on interaction with multiple target ops

Fix issue with loop not going over every user due to modifications

wip

Some minor refactoring and fixes, main thing is allowing of types to be passed down to help create the kernel

Clang-format

Cleanup some print outs.

Some further cleaning to reduce noise

Update IRBuilder Test for recent changes

Fix new map attribute parsing and lowering

Fix Flang Tests I Murdered

Fix bad isa usage

Fix and adjust tests affected by changes

remove comment

WIP Bounds/Range

WIP Bounds/Range part 2

Initial implementation of map 1-D range working

Fix some rebase issues

Apply some fairly significant changes to work with new pass series

fix a few test failures, primarily caused by not checking things where neccessary.

Fix after rebase
@skatrak skatrak requested a review from agozillon August 8, 2023 18:37
@skatrak skatrak closed this Aug 9, 2023
@skatrak skatrak deleted the agozillon/milestone1-decltar-data branch September 11, 2023 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants