-
Couldn't load subscription status.
- Fork 793
[SYCL][Driver] Update devicelib link logic to stop handling deprecated options. #19592
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
Conversation
…ption Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
|
Hi, @mdtoguchi |
|
Hi, @mdtoguchi |
clang/lib/Driver/ToolChains/SYCL.cpp
Outdated
| return LibraryList; | ||
| } | ||
|
|
||
| using SYCLDeviceLibsList = SmallVector<StringRef, 8>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of elements defined exceeds its declared inline capacity for SYCLDeviceLibs (more than 8 elements)
We could omit the number of inlined elements N, and just have SmallVector<StringRef>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks very much.
clang/lib/Driver/ToolChains/SYCL.cpp
Outdated
| LibSuffix = IsWindowsMSVCEnv ? ".new.obj" : ".new.o"; | ||
| auto addLibraries = [&](const SYCLDeviceLibsList &LibsList) { | ||
| for (const StringRef &Lib : LibsList) { | ||
| SmallString<128> LibName(Lib); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new String and copying data can have performance implications, especially in loops.
Any reason to have SmallVector<StringRef> instead of SmallVector<String> ?
| // RUN: %clangxx -### -nogpulib -fno-sycl-libspirv --sysroot=%S/Inputs/SYCL \ | ||
| // RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \ | ||
| // RUN: %clangxx -### -fsycl -fsycl-targets=amdgcn-amd-amdhsa -fno-sycl-libspirv --sysroot=%S/Inputs/SYCL \ | ||
| // RUN: -Xsycl-target-backend --offload-arch=gfx908 --rocm-path=%S/Inputs/rocm %s 2>&1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is --offload-arch value changed from gfx906 to gfx908 and -nogpulib removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @srividya-sundaram
Previously, the test didn't add --rocm-path, so the test would run fail on machines without AMD toolchain and reported some amd device rtl files were missing. To workaround this, "nogpulib" was added and this option wouldn't impact sycl device libraries link at that time.
Now, we reuse community "--no-offloadlib" option to disable all sycl device libraries and "nogpulib" is an alias for "--no-offloadlib", so we must remove this option otherwise all sycl device libraries will be disabled and the test will fail.
After removing "nogpulib", we need to specify --rocm-path to indicate where to find the required amd device rtl files and current syclos only have dummy amd device rtl files for gfx908, so we have to change offload-arch to gfx908 otherwise the test still reported error that amd device rtl files are missing.
Thanks very much.
| } | ||
|
|
||
| SmallVector<std::string, 8> | ||
| SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a quick note/comment about what this function does and a description of the edge cases if applicable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks very much.
| // TODO: remove getDeviceLibrariesLegacy when we remove deprecated options | ||
| // related to sycl device library link. | ||
| static SmallVector<std::string, 8> | ||
| getDeviceLibrariesLegacy(const Compilation &C, const llvm::Triple &TargetTriple, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment describing what this functions does and why it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks very much.
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
|
Hi, @intel/llvm-gatekeepers |
|
Looks like you were just unlucky and hit the driver uplift from #19880 but the test changes didn't get through. Should be good to go. |
We have marked "f[no-]sycl-device-lib=" option as deprecated and will remove in future major release and we also decide to reuse community "no-offloadlib" option to disable all sycl device libraries for debug purpose. This PR updates getDeviceLibraries to get rid of deprecated options and honor "no-offloadlib" while keeping previous legacy logic to handle deprecated options since they haven't been removed.
Once users touch the deprecated option, will delegate the handling to legacy "getDeviceLibraries" function. We will remove the legacy function in next major release.