Skip to content

Add DPCPP_ENABLE_OPAQUE_POINTERS option #6378

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 21 commits into from
Jul 21, 2022
Merged

Conversation

bader
Copy link
Contributor

@bader bader commented Jun 30, 2022

This option controls the default behavior of LLVM projects regarding
opaque pointers. The default value is OFF as most of the SYCL compiler
components are not ready to handle opaque pointers.

This change adds a new nightly job testing SYCL compiler with enabled
opaque pointers by default.

bader added 4 commits June 30, 2022 03:09
This option controls the default behavior of LLVM projects regarding
opaque pointers. The default value is OFF as most of the SYCL compiler
components are not ready to handle opaque pointers.
@bader bader added the disable-lint Skip linter check step and proceed with build jobs label Jun 30, 2022
@bader bader removed the disable-lint Skip linter check step and proceed with build jobs label Jun 30, 2022
@bader bader marked this pull request as ready for review June 30, 2022 17:59
@bader bader requested review from a team and pvchupin as code owners June 30, 2022 17:59
@bader
Copy link
Contributor Author

bader commented Jun 30, 2022

pvchupin
pvchupin previously approved these changes Jun 30, 2022
Copy link
Contributor

@pvchupin pvchupin left a comment

Choose a reason for hiding this comment

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

CI changes looks ok

asudarsa
asudarsa previously approved these changes Jul 1, 2022
Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

'Tools' related changes look ok to me. Thanks

bader added 4 commits July 2, 2022 05:16
The test was added to validate emitted SPIR-V file. SPIR-V emitter
support was removed with ff0f21d and
eb20ee7.
Now this test is a duplicate of
clang/test/CodeGenOpenCL/private-array-initialization.cl.
The intended functionality is already tested by
llvm-spirv/test/transcoding/clk_event_t.cl.
ff0f21d and
eb20ee7 invalidated the test.
Allow configuring opaque pointers for clang project independently from
DPCPP_ENABLE_OPAQUE_POINTERS option.
@bader bader dismissed stale reviews from asudarsa and pvchupin via 04d5e15 July 2, 2022 12:44
@bader bader changed the title Add LLVM_ENABLE_OPAQUE_POINTERS option Add DPCPP_ENABLE_OPAQUE_POINTERS option Jul 2, 2022
premanandrao
premanandrao previously approved these changes Jul 6, 2022
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.

FE changes look okay to me.

smanna12
smanna12 previously approved these changes Jul 6, 2022
@bader
Copy link
Contributor Author

bader commented Jul 7, 2022

@andykaylor, @asudarsa, could you take a look at new commits, please?

@bader
Copy link
Contributor Author

bader commented Jul 13, 2022

@andykaylor, @asudarsa, could you take a look at new commits, please?

Ping.

@asudarsa
Copy link
Contributor

Hi @bader
Sorry for delay in response. LGTM except for one issue I have highlighted.
Thanks

asudarsa
asudarsa previously approved these changes Jul 13, 2022
Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@bader
Copy link
Contributor Author

bader commented Jul 17, 2022

@andykaylor, this PR holds off follow-up fixes, so I'd like to merge it as soon as possible. Is it okay to commit current version and address further comments (if any) separately?

@bader bader dismissed stale reviews from asudarsa, smanna12, premanandrao, and mdtoguchi via 3c43979 July 18, 2022 13:59
@bader
Copy link
Contributor Author

bader commented Jul 18, 2022

@jchlanda, do you think that this failure on NVIDIA GPU https://github.com/intel/llvm/runs/7391421134?check_suite_focus=true is related to this change? This change is not expected to change the default behavior.

@bader bader requested a review from a team as a code owner July 18, 2022 15:13
@bader bader requested a review from smaslov-intel July 18, 2022 15:13
@bader
Copy link
Contributor Author

bader commented Jul 18, 2022

@jcranmer-intel, I've added ab05021, which updates a few tests.

  • sycl/test/check_device_code/id_queries_fit_int.cpp - now checks are invariant to opaque pointer setting (perfect case).
  • sycl/test/check_device_code/kernel_arguments_as.cpp - the purpose of the checks is to validate that address space information is passed via LLVM IR and pointer type is not relevant for this test. I forced opaque pointers use and updated the checks.
  • sycl/test/check_device_code/no_offset.cpp - what is interesting in this test is that compiler is able to remove certain kernel parameters if nooffset accessor property is set. Pointer types are not relevant here as well, so I applied the same approach as in sycl/test/check_device_code/kernel_arguments_as.cpp test.
  • sycl/test/extensions/sub_group_as.cpp - this is an example of the test where further test updates are required. Type are not important for some of the checks (e.g. spirv_GenericCastToPtrExplicit_ToLocal doesn't change the type, just an address space), but there are examples where LLVM IR must have type information somewhere. I'm hesitant to update more tests like this because not all changes are in place to make the final test fix. We need to figure out what is the plan for ESIMD/matrix types and decide whether we go with [Attr] Extend uses of elementtype attribute #6397 before updating LLVM IR check. Let me know your thoughts on this.

@jchlanda
Copy link
Contributor

@jchlanda, do you think that this failure on NVIDIA GPU https://github.com/intel/llvm/runs/7391421134?check_suite_focus=true is related to this change? This change is not expected to change the default behavior.

It doesn't look related, even if we ignore the assert messages which are a bit flaky, upon hitting the assert PI runtime should generate error 710:

PI CUDA ERROR:
        Value:           710
        Name:            CUDA_ERROR_ASSERT

but this one reports -999 - Unknown PI error (https://github.com/intel/llvm/runs/7391421134?check_suite_focus=true#step:8:1168)

@jcranmer-intel
Copy link
Contributor

We need to figure out what is the plan for ESIMD/matrix types and decide whether we go with #6397 before updating LLVM IR check. Let me know your thoughts on this.

My current thinking for the matrix type situation in the LLVM-SPIRV translator is a short-term fix that has the clang frontend just lower to the correct name of the LLVM struct type in the first place (obviating the need to change in the translator itself), with a longer-term fix of adding the LLVM opaque type support I proposed in the RFC.

@bader
Copy link
Contributor Author

bader commented Jul 21, 2022

@jchlanda, do you think that this failure on NVIDIA GPU https://github.com/intel/llvm/runs/7391421134?check_suite_focus=true is related to this change? This change is not expected to change the default behavior.

It doesn't look related, even if we ignore the assert messages which are a bit flaky, upon hitting the assert PI runtime should generate error 710:

PI CUDA ERROR:
        Value:           710
        Name:            CUDA_ERROR_ASSERT

but this one reports -999 - Unknown PI error (https://github.com/intel/llvm/runs/7391421134?check_suite_focus=true#step:8:1168)

I can't reproduce this issue locally, so I restarted CI jobs and it failed again, but with the different error:

error: command failed with exit status: 255

https://github.com/intel/llvm/runs/7450227286?check_suite_focus=true

These look like flaky llvm-test-suite issues not caused by this patch. I'll file a report to investigate them and merge this PR.

@bader bader merged commit a364383 into intel:sycl Jul 21, 2022
@bader bader deleted the opaque-pointers-option branch July 21, 2022 16:39
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.

9 participants