|
8 | 8 |
|
9 | 9 | #define SYCL2020_DISABLE_DEPRECATION_WARNINGS
|
10 | 10 |
|
11 |
| -#include "HelperKernelInfo.hpp" |
12 | 11 | #include "detail/context_impl.hpp"
|
13 | 12 | #include "detail/kernel_bundle_impl.hpp"
|
14 | 13 | #include "detail/kernel_program_cache.hpp"
|
15 |
| -#include <CL/sycl.hpp> |
16 | 14 | #include <helpers/CommonRedefinitions.hpp>
|
17 | 15 | #include <helpers/PiImage.hpp>
|
18 | 16 | #include <helpers/PiMock.hpp>
|
| 17 | +#include <helpers/TestKernel.hpp> |
19 | 18 |
|
20 | 19 | #include <gtest/gtest.h>
|
21 | 20 |
|
22 | 21 | #include <iostream>
|
23 | 22 |
|
24 | 23 | using namespace sycl;
|
25 | 24 |
|
26 |
| -class MultTestKernel; |
27 |
| - |
28 |
| -__SYCL_INLINE_NAMESPACE(cl) { |
29 |
| -namespace sycl { |
30 |
| -namespace detail { |
31 |
| -template <> struct KernelInfo<MultTestKernel> : public MockKernelInfo { |
32 |
| - static constexpr const char *getName() { return "MultTestKernel"; } |
33 |
| -}; |
34 |
| -} // namespace detail |
35 |
| -} // namespace sycl |
36 |
| -} // __SYCL_INLINE_NAMESPACE(cl) |
37 |
| - |
38 |
| -static sycl::unittest::PiImage generateDefaultImage() { |
39 |
| - using namespace sycl::unittest; |
40 |
| - |
41 |
| - PiPropertySet PropSet; |
42 |
| - |
43 |
| - std::vector<unsigned char> Bin{0, 1, 2, 3, 4, 5}; // Random data |
44 |
| - |
45 |
| - PiArray<PiOffloadEntry> Entries = makeEmptyKernels({"MultTestKernel"}); |
46 |
| - |
47 |
| - PiImage Img{PI_DEVICE_BINARY_TYPE_SPIRV, // Format |
48 |
| - __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec |
49 |
| - "", // Compile options |
50 |
| - "", // Link options |
51 |
| - std::move(Bin), |
52 |
| - std::move(Entries), |
53 |
| - std::move(PropSet)}; |
54 |
| - |
55 |
| - return Img; |
56 |
| -} |
57 |
| - |
58 |
| -static sycl::unittest::PiImage Img = generateDefaultImage(); |
59 |
| -static sycl::unittest::PiImageArray<1> ImgArray{&Img}; |
60 |
| - |
61 | 25 | static pi_result redefinedContextCreate(
|
62 | 26 | const pi_context_properties *properties, pi_uint32 num_devices,
|
63 | 27 | const pi_device *devices,
|
@@ -188,11 +152,11 @@ TEST_F(MultipleDeviceCacheTest, ProgramRetain) {
|
188 | 152 | auto Bundle = cl::sycl::get_kernel_bundle<sycl::bundle_state::input>(
|
189 | 153 | Queue.get_context());
|
190 | 154 | Queue.submit([&](cl::sycl::handler &cgh) {
|
191 |
| - cgh.single_task<MultTestKernel>([]() {}); |
| 155 | + cgh.single_task<TestKernel>([]() {}); |
192 | 156 | });
|
193 | 157 |
|
194 | 158 | auto BundleObject = cl::sycl::build(Bundle, Bundle.get_devices());
|
195 |
| - auto KernelID = cl::sycl::get_kernel_id<MultTestKernel>(); |
| 159 | + auto KernelID = cl::sycl::get_kernel_id<TestKernel>(); |
196 | 160 | auto Kernel = BundleObject.get_kernel(KernelID);
|
197 | 161 |
|
198 | 162 | // Because of emulating 2 devices program is retained for each one in
|
|
0 commit comments