Skip to content

[OpenMP] OpenMP ThreadSet clause - basic runtime #144409

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions openmp/runtime/src/kmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2725,11 +2725,12 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
/* Same fields as in the #else branch, but in reverse order */
#if OMPX_TASKGRAPH
unsigned reserved31 : 5;
unsigned reserved31 : 4;
unsigned onced : 1;
#else
unsigned reserved31 : 6;
unsigned reserved31 : 5;
#endif
unsigned hidden_helper : 1;
unsigned target : 1;
unsigned native : 1;
unsigned freed : 1;
Expand All @@ -2741,7 +2742,7 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
unsigned task_serial : 1;
unsigned tasktype : 1;
unsigned reserved : 8;
unsigned hidden_helper : 1;
unsigned free_agent_eligible : 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put free_agent_eligible before reserved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you need to use reversed order for big endian here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if OMPX_TASKGRAPH
  unsigned reserved31 : 4;
  unsigned onced : 1;
#else
  unsigned reserved31 : 5;
#endif
  unsigned hidden_helper : 1;
  unsigned target : 1;
  unsigned native : 1;
  unsigned freed : 1;
  unsigned complete : 1;
  unsigned executing : 1;
  unsigned started : 1;
  unsigned team_serial : 1;
  unsigned tasking_ser : 1;
  unsigned task_serial : 1;
  unsigned tasktype : 1;
  unsigned reserved : 8;
  unsigned free_agent_eligible : 1;
  unsigned detachable : 1;
  unsigned priority_specified : 1;
  unsigned proxy : 1;
  unsigned destructors_thunk : 1;
  unsigned merged_if0 : 1;
  unsigned final : 1;
  unsigned tiedness : 1;

unsigned detachable : 1;
unsigned priority_specified : 1;
unsigned proxy : 1;
Expand All @@ -2762,7 +2763,8 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
unsigned priority_specified : 1; /* set if the compiler provides priority
setting for the task */
unsigned detachable : 1; /* 1 == can detach */
unsigned hidden_helper : 1; /* 1 == hidden helper task */
unsigned free_agent_eligible : 1; /* set if task can be executed by a
free-agent thread */
unsigned reserved : 8; /* reserved for compiler use */

/* Library flags */ /* Total library flags must be 16 bits */
Expand All @@ -2780,11 +2782,12 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
unsigned freed : 1; /* 1==freed, 0==allocated */
unsigned native : 1; /* 1==gcc-compiled task, 0==intel */
unsigned target : 1;
unsigned hidden_helper : 1; /* 1 == hidden helper task */
#if OMPX_TASKGRAPH
unsigned onced : 1; /* 1==ran once already, 0==never ran, record & replay purposes */
unsigned reserved31 : 5; /* reserved for library use */
unsigned reserved31 : 4; /* reserved for library use */
#else
unsigned reserved31 : 6; /* reserved for library use */
unsigned reserved31 : 5; /* reserved for library use */
#endif
#endif
} kmp_tasking_flags_t;
Expand Down
Loading