Skip to content

Conversation

@vchuravy
Copy link
Member

Enzyme performs external codegen that needs to access current_task and
the ptls. We have three options:

  1. Hard-code it per Julia version/architecture
  2. "Introspect" it by doing a code_llvm to get the offset
  3. Expose a variable that Enzyme can read to get a stable answer.

We used to do 1. in the past which lead to fun crashes everytime it changed on the
Julia side.

We currently do 2., which leads to bad initialization times.

This is option 3.

@gbaraldi
Copy link
Member

Is int fine here or should this be a ptrdiff_t?

@vchuravy
Copy link
Member Author

Int should be fine. these are between 12-14

@vchuravy vchuravy requested a review from vtjnash April 27, 2023 23:00
@vchuravy vchuravy merged commit faced27 into master Apr 29, 2023
@vchuravy vchuravy deleted the vc/task_offset branch April 29, 2023 23:14
@vchuravy vchuravy added the backport 1.9 Change should be backported to release-1.9 label May 2, 2023
@KristofferC KristofferC mentioned this pull request May 8, 2023
51 tasks
KristofferC pushed a commit that referenced this pull request May 8, 2023
KristofferC pushed a commit that referenced this pull request May 8, 2023
KristofferC pushed a commit that referenced this pull request May 27, 2023
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label May 28, 2023
kpamnany pushed a commit that referenced this pull request Jun 21, 2023
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.

4 participants