-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][E2E] Add some compile-time "tracking" tests (#16648)
We run `test-e2e/PerformanceTests` in post-commit and that can be used for * tracking the compilation time on these tests over time * running them in pre-commit to measure expected improvements I also think that since PerformanceTests are "opt-in" in precommit, there is little sense in enforcing no `<sycl/sycl.hpp>` header in them.
- Loading branch information
1 parent
69cbf2a
commit f0d0f7c
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// RUN: time -f "Elapsed real time: %es" %{build} -fsycl-device-only -fsyntax-only | ||
// RUN: time -f "Elapsed real time: %es" %{build} -o %t.out | ||
|
||
#include <sycl/detail/core.hpp> | ||
|
||
int main() { return 0; } |
33 changes: 33 additions & 0 deletions
33
sycl/test-e2e/PerformanceTests/CompileTime/single_task_overhead.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// RUN: time -f "Elapsed real time: %es" %{build} -fsycl-device-only -fsyntax-only | ||
// RUN: time -f "Elapsed real time: %es" %{build} -fsycl-device-only -fsyntax-only -DSUBMIT | ||
|
||
#include <sycl/detail/core.hpp> | ||
|
||
template <int N, int M> struct compile_time_heavy_krn { | ||
static void foo(int x = N) { compile_time_heavy_krn<N - 1, M>::foo(x); } | ||
}; | ||
|
||
template <int M> struct compile_time_heavy_krn<0, M> { | ||
static void foo(int x = 0) { std::ignore = x; } | ||
}; | ||
|
||
int main() { | ||
sycl::queue q; | ||
q.single_task([]() { std::ignore = 42; }); | ||
sycl::detail::loop<2>([&](auto outer_idx) { | ||
sycl::detail::loop<200>([&](auto idx) { | ||
auto krn = [=]() { | ||
compile_time_heavy_krn<idx * 5, outer_idx * 1000 + idx>::foo(); | ||
}; | ||
auto s = [&](sycl::handler &cgh) { | ||
#if SUBMIT | ||
cgh.single_task(krn); | ||
#endif | ||
}; | ||
#if SUBMIT | ||
q.submit(s); | ||
#endif | ||
}); | ||
}); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// RUN: time -f "Elapsed real time: %es" %{build} -fsycl-device-only -fsyntax-only | ||
// RUN: time -f "Elapsed real time: %es" %{build} -o %t.out | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
int main() { return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters