Skip to content

Conversation

zahiraam
Copy link
Contributor

@zahiraam zahiraam commented Mar 29, 2021

This patch adds support of loop_min, loop_max and loop_avg attributes. They specify the minimum, maximum, or average number of iterations of a for loop.

@zahiraam zahiraam requested a review from smanna12 April 12, 2021 16:24
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
@zahiraam
Copy link
Contributor Author

I need to write the loop_count_min and loop_count_max too. I am trying to find out if there is a way to represent this attribute as a single one, loop_count with option min, max, avg instead of having an entry for each one.

@smanna12
Copy link
Contributor

smanna12 commented Apr 14, 2021

I need to write the loop_count_min and loop_count_max too. I am trying to find out if there is a way to represent this attribute as a single one, loop_count with option min, max, avg instead of having an entry for each one.

I think you can use Accessors here like
let Accessors =
[Accessor<"isMin", [CXX11<"intel", "loop_count_min">]>];

Same for Max or Avg

This was you can represent this attribute as a single one.
}

@AaronBallman, what is your opinion?

@zahiraam
Copy link
Contributor Author

I need to write the loop_count_min and loop_count_max too. I am trying to find out if there is a way to represent this attribute as a single one, loop_count with option min, max, avg instead of having an entry for each one.

I think you can use Accessors here like
let Accessors =
[Accessor<"isMin", [CXX11<"intel", "loop_count_min">]>];

Same for Max or Avg

This was you can represent this attribute as a single one.
}

@AaronBallman, what is your opinion?

It looks like it is the way to go.

Signed-off-by: Zahira Ammarguellat <[email protected]>
@AaronBallman
Copy link
Contributor

I need to write the loop_count_min and loop_count_max too. I am trying to find out if there is a way to represent this attribute as a single one, loop_count with option min, max, avg instead of having an entry for each one.

I think you can use Accessors here like
let Accessors =
[Accessor<"isMin", [CXX11<"intel", "loop_count_min">]>];
Same for Max or Avg
This was you can represent this attribute as a single one.
}
@AaronBallman, what is your opinion?

It looks like it is the way to go.

Yeah, I think that would be the right approach.

Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
@zahiraam zahiraam marked this pull request as ready for review April 25, 2021 01:16
@smanna12
Copy link
Contributor

@zahiraam, could you please update title and add brief summary about the support. Thanks.

@zahiraam zahiraam changed the title Control avg attr Adding loop control count attribute. Apr 26, 2021
@zahiraam zahiraam changed the title Adding loop control count attribute. Adding loop_count attribute. Apr 26, 2021
@zahiraam
Copy link
Contributor Author

Review please?

smanna12
smanna12 previously approved these changes Apr 27, 2021
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

LGTM. @AaronBallman, could you please take a look at the support? Thanks.

Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

Can you update the review title and description (this adds multiple attributes, none of which are named loop_count)?

let Category = DocCatVariable;
let Heading = "intel::loop_count_min, intel::loop_count_max, intel::loop_count_avg";
let Content = [{
The "loop_count" attribute specifies the minimum, maximum, or average number of
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
The "loop_count" attribute specifies the minimum, maximum, or average number of
The loop count attributes specify the minimum, maximum, or average number of

@zahiraam zahiraam changed the title Adding loop_count attribute. Adding support for loop count attribute. Apr 27, 2021
Signed-off-by: Zahira Ammarguellat <[email protected]>
Signed-off-by: Zahira Ammarguellat <[email protected]>
Comment on lines 413 to 414
void setSYCLIntelFPGAVariantCount(const char *var, unsigned int C) {
StagedAttrs.SYCLIntelFPGAVariantCount.push_back({var, C});
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
void setSYCLIntelFPGAVariantCount(const char *var, unsigned int C) {
StagedAttrs.SYCLIntelFPGAVariantCount.push_back({var, C});
void setSYCLIntelFPGAVariantCount(const char *Var, unsigned int Count) {
StagedAttrs.SYCLIntelFPGAVariantCount.push_back({Var, Count});

Signed-off-by: Zahira Ammarguellat <[email protected]>
AaronBallman
AaronBallman previously approved these changes Apr 27, 2021
Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM aside from a super small grammar nit with the documentation.

Signed-off-by: Zahira Ammarguellat <[email protected]>
AaronBallman
AaronBallman previously approved these changes Apr 27, 2021
Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Zahira Ammarguellat <[email protected]>
Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

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

LGTM

@bader bader changed the title Adding support for loop count attribute. [SYCL][FPGA] Add support for loop count attribute. Apr 29, 2021
@bader bader merged commit f74b4ef into intel:sycl Apr 29, 2021
smanna12 added a commit to smanna12/llvm that referenced this pull request Feb 9, 2022
The original implementation of this attribute in
intel#3438, did not support
the [[intel::loop_count()]] attribute spelling. This patch
adds support for that spelling.

Signed-off-by: Soumi Manna <[email protected]>
bader pushed a commit that referenced this pull request Feb 10, 2022
The original implementation of this attribute in
#3438, did not support
the [[intel::loop_count()]] attribute spelling. This patch
adds support for that spelling.

Signed-off-by: Soumi Manna <[email protected]>
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.

5 participants