Skip to content

xt-declare-target-ctors: Update for GCC#3

Open
tschwinge wants to merge 1 commit intodoru1004:mainfrom
tschwinge:xt-declare-target-ctors-GCC
Open

xt-declare-target-ctors: Update for GCC#3
tschwinge wants to merge 1 commit intodoru1004:mainfrom
tschwinge:xt-declare-target-ctors-GCC

Conversation

@tschwinge
Copy link
Copy Markdown

It's not clear from the revision log what compiler the xt-declare-target-ctors test has been written against, in particular, its
'xt-declare-target-ctors/expected' file. But it must've been a long time ago.

Updating this for current GCC:

  1. Like on the host, also for offloading: destructors run in reverse order of constructors.
  2. Offloading is initialized (and with that, offloading constructors are run) upon encountering the first offloading construct (here: '#pragma omp target'), and offloading is shut down (and with that, offloading destructors are run) at the end of 'main', before destructing host objects.

It's not clear from the revision log what compiler the xt-declare-target-ctors
test has been written against, in particular, its
'xt-declare-target-ctors/expected' file.  But it must've been a long time ago.

Updating this for current GCC:

 1. Like on the host, also for offloading: destructors run in reverse order of
    constructors.
 2. Offloading is initialized (and with that, offloading constructors are run)
    upon encountering the first offloading construct (here:
    '#pragma omp target'), and offloading is shut down (and with that,
    offloading destructors are run) at the end of 'main', before destructing
    host objects.
@tschwinge
Copy link
Copy Markdown
Author

Before merging, we should check what other current compilers are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant