Skip to content

Conversation

@skc7
Copy link
Contributor

@skc7 skc7 commented Nov 28, 2025

This is WIP PR for support of openmp 6.2 feature num_teams with dims modifier.

To not break the current code, named the clause as num_teams_multi_dim. Will name it back to num_teams once the ompIRBuilder supports creating teams with dims modifier argument.

def OpenMP_UseDevicePtrClause : OpenMP_UseDevicePtrClauseSkip<>;

//===----------------------------------------------------------------------===//
// V6.2: Multidimensional `num_teams` clause with dims modifier
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// V6.2: Multidimensional `num_teams` clause with dims modifier
// V6.1: Multidimensional `num_teams` clause with dims modifier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

// If dims not specified but we have values, it's implicitly unidimensional
if (!dims.has_value() && values.size() != 1) {
return parser.emitError(parser.getCurrentLocation())
<< "expected 1 value without dims modifier, got " << values.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<< "expected 1 value without dims modifier, got " << values.size();
<< "expected 1 value without dims modifier, but got " << values.size() << " values";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Thanks

}];
}

def OpenMP_NumTeamsMultiDimClause : OpenMP_NumTeamsMultiDimClauseSkip<>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be rather called modifier instead of clause? The clause still is num_threads, but the modifier is dims.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original design was to have a separate dims modifier(with dims and values args) class and then create num_teams and thread_limit clauses from it. But this leads to both clauses having the same argument names and when added to teams Op would create an issue.

So, now created just num_teams_multi_dim clause with arguments as num_teams_dims and num_teams_values.
Will remove the old num_teams clause and replace it with num_teams_multi_dim clause and move the name back to num_teams

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.

3 participants