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

Fix _wrapper_device_link artifact name conflict #135

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

cloudhan
Copy link
Collaborator

Compile the newly added example with _wrapper_device_link with rdc cause artifact name conflict

cuda_library(
name = "b",
srcs = ["b.cu"],
hdrs = ["b.cuh"],
rdc = True,
)

The reason is because our compile always compile to <target_output_dir>/_objs:

cuda_library(name="b") --> artifact base name is `b` during `compile`

with `compile` for following srcs
"b.cu" ------------------> artifact `<target_output_dir>/_objs/b.rdc.o`
`fatbin.cu` ------rdc----> artifact `<target_output_dir>/_objs/b.rdc.o`

After this PR:
"b.cu" ------------------> artifact `<target_output_dir>/_objs/b.rdc.o`
`fatbin.cu` ------rdc----> artifact `<target_output_dir>/_objs/_dlink/b.rdc.o`

Note we reserve the _prefix keyword params for future change and keep it as (implicitly) internal.

@@ -9,7 +9,8 @@ def compile(
srcs,
common,
pic = False,
rdc = False):
rdc = False,
_prefix = "_objs"):
Copy link
Member

Choose a reason for hiding this comment

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

Aren't you missing the change in this function to actually make use of this prefix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! Burried in another branch.

@cloudhan cloudhan force-pushed the cloudhan/fix-wrapper-dlink-artifact-conflict branch from 101a137 to 177fff9 Compare July 20, 2023 01:04
@cloudhan cloudhan requested a review from jsharpe July 20, 2023 01:05
@cloudhan cloudhan merged commit 05fb8f4 into main Aug 9, 2023
12 checks passed
@cloudhan cloudhan deleted the cloudhan/fix-wrapper-dlink-artifact-conflict branch August 9, 2023 14:34
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.

2 participants