-
Notifications
You must be signed in to change notification settings - Fork 738
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
[NFC][SYCL] Update tests to reflect new offload model #14539
Conversation
Update existing SYCL based driver tests to use the new offload model and retain the equivalent old offloading model tests be creating copies. These tests use the --offload-new-driver and --no-offload-new-driver options to force a particular model to follow.
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// Make three distinct BC files | ||
// RUN: %clangxx -fsycl -fsycl-device-only -DTYPE1 %s -o %t1.bc |
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.
Is --no-offload-new-driver
not required here?
I see it added here for generating BC files.
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.
It is required - will add.
@@ -0,0 +1,20 @@ | |||
// Test -ftarget-compile-fast behaviors |
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.
Some of the comments are updated with // Old offloading model only
Can be made consistent by updating all comments as necessary.
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 files that are commented with 'Old offload model only' are tests that already exist that were not converted for the new model as those behaviors being tested do not make sense for the new model.
@@ -1,20 +1,21 @@ | |||
// Test -ftarget-compile-fast behaviors |
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.
Comment can be updated to mention the use of new offload driver
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 files where an 'old-model' variant was added I do not update the comments to reflect. The naming should take care of that. Once the old model goes away, all of these tests will also be updated to remove the --offload-new-driver
options being set.
// RUN: %clang -### -fsycl -fsycl-add-default-spec-consts-image -fsycl-targets=spir64 2>&1 %s | FileCheck %s -check-prefix=CHECK-NON-AOT | ||
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image 2>&1 %s | FileCheck %s -check-prefix=CHECK-NON-AOT | ||
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image 2>&1 %s | FileCheck %s -check-prefix=CHECK-NON-AOT | ||
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=spir64 2>&1 %s | FileCheck %s -check-prefix=CHECK-NON-AOT | ||
// CHECK-NON-AOT: warning: -fsycl-add-default-spec-consts-image flag has an effect only in Ahead of Time Compilation mode (AOT) | ||
|
||
// Check that non-AOT target doesn't add command line option into sycl-post-link invocation | ||
// CHECK-NON-AOT-NOT: {{.*}}sycl-post-link{{.*}} "-generate-device-image-default-spec-consts" | ||
|
||
// Check that no warnings are issued in correct cases and "-generate-device-image-default-spec-consts" is passed to sycl-post-link |
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.
Comment update.
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.
Can you clarify?
@@ -0,0 +1,233 @@ | |||
/// | |||
/// Perform several driver tests for SYCL device libraries on Linux |
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.
Is there a test file for tests using the new offload driver?
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.
For this, no. Any device libraries or objects aren't touched by the driver with the new model, so there aren't any behaviors to verify.
@@ -7,227 +7,184 @@ | |||
/// ########################################################################### | |||
|
|||
/// test behavior of device library default link and fno-sycl-device-lib-jit-link | |||
// RUN: %clangxx -fsycl %s --sysroot=%S/Inputs/SYCL -### 2>&1 \ | |||
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -### 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.
nit - filename can be updated to mention new offload model.
// CHECK-DEFAULT-NOT: "-fsycl-is-device" | ||
|
||
/// Check "-fsycl-is-device" is passed when compiling for device: | ||
// RUN: %clang -### -fsycl-device-only %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.
Should --no-offload-new-driver
be passed here?
|
||
/// Check that "-Wno-sycl-strict" is set on compiler invocation with "-fsycl" | ||
/// or "-fsycl-device-only" or both: | ||
// RUN: %clang -### -fsycl %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.
Same, should --no-offload-new-driver
be used here?
// CHECK-SYCL-AUX-TRIPLE: clang{{.*}} "-aux-triple" "aarch64-unknown-linux-gnu" | ||
|
||
/// Verify output files are properly specified given -o | ||
// RUN: %clang -### -fsycl -fsycl-device-only -o dummy.out %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.
Same question as above.
// CHECK-SYCL-STD_VERSION: clang{{.*}} "-sycl-std=2020" | ||
|
||
/// Check that -aux-triple is set correctly | ||
// RUN: %clang -### -fsycl -target aarch64-linux-gnu %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.
Same question.
@@ -1,11 +1,11 @@ | |||
/// Check that optimizations for sycl device are enabled by default: | |||
// RUN: %clang -### -fsycl %s 2>&1 \ | |||
// RUN: %clang -### -fsycl --offload-new-driver %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.
nit: All test files with the the old driver option have "old model" in their name.
Test files with the new driver model can have their names updated too.
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.
I'd rather not shuffle the names around too much. The idea is that the 'old model' will be going away once we make it the default, so the files renamed as 'old-model' can just be removed (as well as the existing tests that weren't converted to the new offloading model)
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.
I've thought about this a little, and I'm going to rename all of the tests that I'm not converting/adding to the new model to use 'old-model'. This way, we know which ones will go away cleanly (have old-model in the name) and we don't have to worry about the comments.
|
||
#include <sycl/sycl.hpp> | ||
#include <sycl/sycl.hpp> |
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.
All of the non-visual changes are due to a cleanup of some carriage return characters.
// RUN: cmp %t_unbundled.o `grep .o$ %t_list.txt` | ||
|
||
void foo() { | ||
} |
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.
Similar comment - non-visual changes to clean up carriage return characters.
@intel/llvm-gatekeepers, please take a look, should be ready for merge. |
Update existing SYCL based driver tests to use the new offload model and retain the equivalent old offloading model tests be creating copies. These tests use the --offload-new-driver and --no-offload-new-driver options to force a particular model to follow.
Update existing SYCL based driver tests to use the new offload model and retain the equivalent old offloading model tests be creating copies. These tests use the --offload-new-driver and --no-offload-new-driver options to force a particular model to follow.