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

[Driver][SYCL] Handle invalid characters from device in temp files #14563

Merged
merged 4 commits into from
Jul 26, 2024

Conversation

mdtoguchi
Copy link
Contributor

When using command lines such as -fsycl -fsycl-targets=spir64_gen --offload-new-driver -Xsycl-target-backend "-device *" there is a temporary file that is generated that contains the arch value. Eliminate any possible invalid characters from being used with this temporary file.

When using command lines such as -fsycl -fsycl-targets=spir64_gen
--offload-new-driver -Xsycl-target-backend "-device *" there is a
temporary file that is generated that contains the arch value.
Eliminate any possible invalid characters from being used with this
temporary file.
@mdtoguchi mdtoguchi requested a review from a team as a code owner July 12, 2024 18:31

// RUN: %clang -### --target=x86_64-pc-windows-msvc -fsycl \
// RUN: -fsycl-targets=spir64_gen --offload-new-driver \
// RUN: -Xsycl-target-backend "-device arch1:arch2" %s 2>&1 \
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the behavior when the device arch values are comma separated or space separated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The strings are not modified. Now, using commas is fine for file names AFAIK, but this could throw a wrench into the arch settings for the clang-offload-packager.

@asudarsa, any thoughts on how we can handle comma separated arch values when passed in like -device arch1,arch2,arch3 and is embedded in the clang-offload-packager image-file stringmap? As the values are comma separated I think it would be parsed incorrectly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srividya-sundaram, I have added some additional changes to convert commas. Additional side discussions to be had with @asudarsa to resolve other issues with the packager.

// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \
// RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" %s 2>&1 \
// RUN: | FileCheck -check-prefix COMMA_FILE %s
// COMMA_FILE: clang-offload-packager{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,bdw,kind=sycl"
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an additional comma here arch=pvc,bdw,
Is this expected or is this the issue you were referring to in your comment?

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 of now, it is expected and we will resolve with discussions with Arvind.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can create a GitHub issue and link that to this PR.

@mdtoguchi
Copy link
Contributor Author

@intel/llvm-gatekeepers, please take a look - should be ready for merge, thanks!

@asudarsa asudarsa merged commit cd8d6d8 into intel:sycl Jul 26, 2024
15 checks passed
hdelan pushed a commit to hdelan/llvm that referenced this pull request Jul 26, 2024
…ntel#14563)

When using command lines such as -fsycl -fsycl-targets=spir64_gen
--offload-new-driver -Xsycl-target-backend "-device *" there is a
temporary file that is generated that contains the arch value. Eliminate
any possible invalid characters from being used with this temporary
file.
@mdtoguchi mdtoguchi deleted the device-temp-name-fix branch August 6, 2024 00:00
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.

None yet

3 participants