Skip to content
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

[SYCL][NVPTX][NFC] Refactor NVPTX target configuration #3535

Merged
merged 4 commits into from
Apr 15, 2021

Conversation

bader
Copy link
Contributor

@bader bader commented Apr 12, 2021

Avoid using -sycldevice for configuring NVPTX target.

@bader bader marked this pull request as ready for review April 12, 2021 17:40
@bader bader added the cuda CUDA back-end label Apr 12, 2021
@bader
Copy link
Contributor Author

bader commented Apr 12, 2021

+@Naghasan.

@bader
Copy link
Contributor Author

bader commented Apr 12, 2021

/summary:run

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.

Other changes look okay to me. Could you add tests for this if applicable?

@@ -48,7 +48,9 @@ class LocalAccessorToSharedMemory : public ModulePass {
// Access `nvvm.annotations` to determine which functions are kernel entry
// points.
auto NvvmMetadata = M.getNamedMetadata("nvvm.annotations");
assert(NvvmMetadata && "IR compiled to PTX must have nvvm.annotations");
if (!NvvmMetadata)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a related change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We skipped this pass for modules w/o -sycldevice triple component in llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp and now this pass is executed regardless of the environment component value. SYCL compiler always added nvvm.annotations metadata, but it might be missing. In case when this metadata is not emitted, we just skip the transformation instead of crashing (with enabled assertions).

@bader bader changed the title [SYCL][NVPTX] Refactor NVPTX target configuration [SYCL][NVPTX][NFC] Refactor NVPTX target configuration Apr 13, 2021
@bader
Copy link
Contributor Author

bader commented Apr 13, 2021

Could you add tests for this if applicable?

This patch doesn't add new functionality - it's a refactoring of existing features, so I think regression tests we already have should be enough.

@bader bader requested a review from premanandrao April 13, 2021 07:52
@premanandrao
Copy link
Contributor

Could you add tests for this if applicable?

This patch doesn't add new functionality - it's a refactoring of existing features, so I think regression tests we already have should be enough.

Thanks for explaining. But given the potential for affecting (one of your TODOs) non-sycl kernels, I would remove the [NFC] from the title, just to not mislead.

@bader
Copy link
Contributor Author

bader commented Apr 13, 2021

@Naghasan, does it look okay to you?

@bader bader merged commit 7d3e836 into intel:sycl Apr 15, 2021
@bader bader deleted the nvptx-remove-sycldevice branch April 15, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda CUDA back-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants