Skip to content

[SYCL][FPGA] Add Intel FPGA bank_bits attribute #876

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

Merged
merged 2 commits into from
Dec 5, 2019
Merged

Conversation

vmaksimo
Copy link
Contributor

This attribute forces the memory system to implement the variable or struct
member in a memory with 2^(N+1) banks, with (b0, ..., bn) forming the
bank-select bits.

This attribute forces the memory system to implement the variable or struct
member in a memory with 2^(N+1) banks, with (b0, ..., bn) forming the
bank-select bits.

Signed-off-by: Viktoria Maksimova <[email protected]>
@vmaksimo vmaksimo requested a review from MrSidims November 27, 2019 13:19
@AGindinson AGindinson self-requested a review November 29, 2019 09:12
return 0;
}
static unsigned getMaxValue() {
return 1024*1024;
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this limit should be documented. The current documentation doesn't imply this value, or, for that matter, any particular number of bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I see, the limits for another attributes were not documented, so I just followed the common documenting style :)

Signed-off-by: Viktoria Maksimova <[email protected]>
@bader bader changed the title [SYCL] Add Intel FPGA bank_bits attribute [SYCL][FPGA] Add Intel FPGA bank_bits attribute Nov 29, 2019
@MrSidims
Copy link
Contributor

MrSidims commented Dec 2, 2019

Overall LGTM. But I'm starting to be more and more confused with all these memory attribute magic and implicit code insertion.

/// The values must be consecutive values (i.e. 3,4,5 or 2,1).
static void handleIntelFPGABankBitsAttr(Sema &S, Decl *D,
const ParsedAttr &Attr) {
checkForDuplicateAttribute<IntelFPGABankBitsAttr>(S, D, Attr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add D decl validity check:
if (D->isInvalidDecl()) return;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure we need this check? It seems that other attributes handling has no such check. I think that it is handled higher in the call stack.

Copy link
Contributor

Choose a reason for hiding this comment

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

It depends on a contract we have with clang code:

  1. We trust function inputs;
  2. We don't trust function inputs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have here a strong evidences to push anyone to follow my own preferences, but as far as I'm a pedantic person - I'd prefer to add this check at least in a code what I write.

Copy link
Contributor

Choose a reason for hiding this comment

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

Quickly looking into the code I did not find such checks.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean declaration invalidation checks before attribute handling earlier in the code.

@MrSidims MrSidims self-requested a review December 4, 2019 15:21
@bader bader merged commit 7becb9d into intel:sycl Dec 5, 2019
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