Skip to content
Merged
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions openmp/runtime/src/kmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,8 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
unsigned tasking_ser : 1;
unsigned task_serial : 1;
unsigned tasktype : 1;
unsigned reserved : 8;
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 reserved : 7;
unsigned hidden_helper : 1;
unsigned detachable : 1;
unsigned priority_specified : 1;
Expand All @@ -2763,7 +2764,9 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
setting for the task */
unsigned detachable : 1; /* 1 == can detach */
unsigned hidden_helper : 1; /* 1 == hidden helper task */
unsigned reserved : 8; /* reserved for compiler use */
unsigned reserved : 7; /* reserved for compiler use */
unsigned free_agent_eligible : 1; /* set if task can be executed by a

Choose a reason for hiding this comment

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

This needs to be reversed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't it be the reverse of the above?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you take one bit out of a reserved bits, you need to make it before the remaining bits.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you take one bit out of a reserved bits, you need to make it before the remaining bits.

If you look at the other bits, they are consumed in reverse order for this endianess. I'm still confused by inverting the bit order and not the byte order for endianess, but this is how they seem to be implemented.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, that reminds me of the big endian thingy that IBM folks fixed in the past.

Copy link
Collaborator

Choose a reason for hiding this comment

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

/* Compiler flags */ /* Total compiler flags must be 16 bits */
  unsigned tiedness : 1; /* 0: task is either tied (1) or untied (0) */
  unsigned final : 1; /* 1: task is final(1) so execute immediately */
  unsigned merged_if0 : 1; /* 2: no __kmpc_task_{begin/complete}_if0 calls in if0
                              code path */
  unsigned destructors_thunk : 1; /* 3: set if the compiler creates a thunk to
                                     invoke destructors from the runtime */
  unsigned proxy : 1; /* 4:task is a proxy task (it will be executed outside the
                         context of the RTL) */
  unsigned priority_specified : 1; /* 5: set if the compiler provides priority
                                      setting for the task */
  unsigned detachable : 1; /* 6: 1 == can detach */
  unsigned free_agent_eligible : 1; /* 7: 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 */
  unsigned tasktype : 1; /* task is either explicit(1) or implicit (0) */
  unsigned task_serial : 1; // task is executed immediately (1) or deferred (0)
  unsigned tasking_ser : 1; // all tasks in team are either executed immediately
  // (1) or may be deferred (0)
  unsigned team_serial : 1; // entire team is serial (1) [1 thread] or parallel
  // (0) [>= 2 threads]
  /* If either team_serial or tasking_ser is set, task team may be NULL */
  /* Task State Flags: */
  unsigned started : 1; /* 1==started, 0==not started     */
  unsigned executing : 1; /* 1==executing, 0==not executing */
  unsigned complete : 1; /* 1==complete, 0==not complete   */
  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 : 4; /* reserved for library use */
#else
  unsigned reserved31 : 5; /* reserved for library use */
#endif```

free-agent thread */

/* Library flags */ /* Total library flags must be 16 bits */
unsigned tasktype : 1; /* task is either explicit(1) or implicit (0) */
Expand Down
Loading