Skip to content

[SYCL] Add clang support for code_location in KernelInfo #5335

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 23 commits into from
Feb 4, 2022

Conversation

schittir
Copy link
Contributor

@schittir schittir commented Jan 19, 2022

Add code_location support in clang

This patch adds four methods to KernelInfo class to return filename,
kernel name, line number and column number.

These methods return meaningful information if NDEBUG is not defined,
else, they emit empty string or 0.

1. Avoid storing the code_location fields in KernelDesc
2. Avoid populating them during the construction of integration header
3. Calculate the fields as needed while emitting the integration header
(in SemaSYCL.cpp)
4. Add a test

ToDo: 1. Populate FunctionName 2. Expand test 3. Fix ColumnNumber?
@schittir schittir changed the title [SYCL] Add clang support for KernelInfo code_location() method [SYCL] Add clang support for code_location in KernelInfo Jan 27, 2022
@schittir schittir marked this pull request as ready for review January 31, 2022 18:23
@schittir schittir requested review from a team as code owners January 31, 2022 18:23
@schittir schittir requested a review from s-kanaev January 31, 2022 18:23
@schittir schittir requested a review from erichkeane February 2, 2022 14:11
@premanandrao
Copy link
Contributor

I think the host compilation variant run you added as well as the verification you did for the various forms for filenames is sufficient for me.

@schittir schittir requested a review from premanandrao February 2, 2022 22:41
premanandrao
premanandrao previously approved these changes Feb 3, 2022
Copy link
Contributor

@elizabethandrews elizabethandrews 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 add a test where kernel is defined as a functor?

@schittir
Copy link
Contributor Author

schittir commented Feb 3, 2022

Can you add a test where kernel is defined as a functor?

Like this?
Pushed 76a77f4

@bader bader merged commit 96d2e17 into intel:sycl Feb 4, 2022
alexbatashev added a commit to alexbatashev/llvm that referenced this pull request Feb 5, 2022
* upstream/sycl: (3571 commits)
  [ESIMD] Doxygen update part III - core APIs. (intel#5472)
  [SYCL][DOC] Move proposed FPGA extensions (intel#5453)
  [SYCL] Add -fsycl-fp32-prec-sqrt flag (intel#5309)
  [SYCL] Emit program build logs for warning levels >= 2 (intel#5319)
  [SYCL] Add clang support for code_location in KernelInfo (intel#5335)
  [SYCL][Doc] Move FPGA extensions (intel#5470)
  [ESIMD] Fix public simd and simd_view APIs. (intel#5465)
  [SYCL] Deprecate sycl::atomics in SYCL 2020 mode (intel#5440)
  [SYCL] Add unit test for PR 5414 (intel#5450)
  [XPTI] Allow arbitrary data types in metadata (intel#4998)
  [SYCL][DOC] Move discard queue events to supported (intel#5452)
  [Driver][SYCL] Initial support for allowing fat static -lname processing (intel#5413)
  [SYCL] Fix dead pointer usage if leaf buffer overflows (intel#5417)
  [SYCL][L0] Fix memory leak in USM prefetch (intel#5461)
  [SYCL][Doc] Add new free function queries proposal (intel#5106)
  [SYCL][ESIMD] Update vc-intrinsics deps to the top of the trunk (intel#5460)
  [SYCL][DOC] Move old spec constant extension spec (intel#5456)
  [SYCL][DOC] Move deprecated extensions (intel#5458)
  [SYCL][DOC] Fix links to old SubGroupMask doc (intel#5459)
  [ESIMD] Doxygen update part II - memory APIs. (intel#5443)
  ...
@schittir
Copy link
Contributor Author

schittir commented Feb 7, 2022

Thank you for reviewing this, @erichkeane @smanna12 @elizabethandrews @premanandrao @alexbatashev

@schittir schittir deleted the support_code_location branch February 7, 2022 18:55
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.

8 participants