Skip to content

[SYCL][CUDA] Skip target options when preprocessing. #4805

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

Closed
wants to merge 6 commits into from

Conversation

jchlanda
Copy link
Contributor

Resolves #4758

@bader bader added the cuda CUDA back-end label Oct 22, 2021
AGindinson
AGindinson previously approved these changes Oct 23, 2021
Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

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

LGTM overall

Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

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

Revoking the approval verbally (so as to avoid automation blocking). Could you please add a test for this (e.g. by extending clang/test/Driver/sycl-offload-nvptx.cpp? Sorry for the initial haste with the review.

Co-authored-by: Artem Gindinson <artem.gindinson@intel.com>
@jchlanda
Copy link
Contributor Author

sycl-offload-nvptx.cpp

My bad, sorry. Added now.

@jchlanda jchlanda requested a review from AGindinson October 25, 2021 06:29
bader
bader previously approved these changes Oct 25, 2021
@jchlanda jchlanda requested a review from AGindinson October 26, 2021 12:39
Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

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

Many thanks, LGTM!

@jchlanda
Copy link
Contributor Author

Looks like I was to hasty with the early return, there are tests that rely on the code happening afterwards. The problem is more fundamental and to do with the fact that not all actions get the default bound arch propagated.

I'm closing this PR and will have to look into the bound arch more.

@jchlanda jchlanda closed this Oct 28, 2021
dm-vodopyanov pushed a commit that referenced this pull request Nov 9, 2021
With this patch the bound arch is correctly propagated through the phases:

```
      +- 0: input, "./../tickets/dashE/woof.cpp", c++, (device-sycl, sm_50)
   +- 1: preprocessor, {0}, c++-cpp-output, (device-sycl, sm_50)
+- 2: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {1}, c++-cpp-output
|        +- 3: input, "./../tickets/dashE/woof.cpp", c++, (host-sycl)
|        |- 4: compiler, {1}, none, (device-sycl, sm_50)
|     +- 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {4}, c++
|  +- 6: append-footer, {5}, c++, (host-sycl)
|- 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
8: clang-offload-bundler, {2, 7}, c++-cpp-output, (host-sycl)
```

Previously the `compiler` phase (`4`) was lacking the bound arch, which is the root cause of #4758:

```
 |- 4: compiler, {1}, none, (device-sycl)
```

Resolves: #4758

Previous discussion in: #4805
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.

CUDA target with -E hits assert
3 participants