Skip to content

Commit 2384a39

Browse files
authored
Merge pull request intel#893 from bb-sycl/xmain
Auto pulldown and update tc files for xmain branch on 20220423
2 parents bc86718 + 5bdb661 commit 2384a39

34 files changed

+588
-66
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
* @vladimirlaz @romanovvlad @bader
1+
* @pvchupin
22

33
# Use runtime team as the umbrella for most of the tests
44
/SYCL/ @intel/llvm-reviewers-runtime
55

6-
76
# SYCL sub-directory matchers are grouped by code owner first, followed by
87
# alphabetical order within the group. Please, keep this ordering.
98

SYCL/Basic/buffer/buffer_create.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@ int main() {
1515
buffer<::cl_int, 1> Buffer(Size);
1616
Queue.submit([&](handler &cgh) {
1717
accessor Accessor{Buffer, cgh, read_write};
18-
if (NumOfDevices > 1)
19-
// Currently the Level Zero plugin uses host allocations for multi-device
20-
// contexts because such allocations are accessible by all devices.
21-
std::cerr << "Multi GPU should use zeMemAllocHost\n";
22-
else if (D.get_info<info::device::host_unified_memory>())
18+
if (D.get_info<info::device::host_unified_memory>())
2319
std::cerr << "Integrated GPU should use zeMemAllocHost\n";
2420
else
2521
std::cerr << "Discrete GPU should use zeMemAllocDevice\n";
26-
cgh.parallel_for<class CreateBuffer>(range<1>(Size), [=](id<1> ID) {});
22+
cgh.parallel_for<class CreateBuffer>(range<1>(Size),
23+
[=](id<1> ID) { Accessor[ID] = 0; });
2724
});
2825
Queue.wait();
2926

3027
return 0;
3128
}
3229

33-
// CHECK: {{Integrated|Multi|Discrete}} GPU should use [[API:zeMemAllocHost|zeMemAllocHost|zeMemAllocDevice]]
30+
// CHECK: {{Integrated|Discrete}} GPU should use [[API:zeMemAllocHost|zeMemAllocDevice]]
3431
// CHECK: ZE ---> [[API]](

SYCL/Basic/buffer/buffer_migrate.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// REQUIRES: gpu
2+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
4+
// RUN: env NEOReadDebugKeys=1 CreateMultipleRootDevices=2 %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: env NEOReadDebugKeys=1 CreateMultipleRootDevices=3 %GPU_RUN_PLACEHOLDER %t.out
6+
//
7+
// Test for buffer use in a context with multiple devices (all found
8+
// root-devices)
9+
//
10+
11+
#include <CL/sycl.hpp>
12+
using namespace cl::sycl;
13+
14+
int main() {
15+
16+
int Data = 0;
17+
int Result = 0;
18+
buffer<int, 1> Buffer(&Data, range<1>(1));
19+
20+
const auto &Devices =
21+
platform(gpu_selector{}).get_devices(info::device_type::gpu);
22+
std::cout << Devices.size() << " devices found" << std::endl;
23+
context C(Devices);
24+
25+
int Index = 0;
26+
for (auto D : Devices) {
27+
std::cout << "Using on device " << Index << ": "
28+
<< D.get_info<info::device::name>() << std::endl;
29+
Result |= (1 << Index);
30+
31+
queue Q(C, D);
32+
Q.submit([&](handler &cgh) {
33+
accessor Accessor{Buffer, cgh, read_write};
34+
cgh.parallel_for<class MigrateBuffer>(
35+
range<1>(1), [=](id<1> ID) { Accessor[ID] |= (1 << Index); });
36+
});
37+
Q.wait();
38+
++Index;
39+
}
40+
41+
auto HostAcc = Buffer.get_host_access();
42+
auto Passed = (HostAcc[0] == Result);
43+
std::cout << "Checking result on host: " << (Passed ? "passed" : "FAILED")
44+
<< std::endl;
45+
std::cout << HostAcc[0] << " ?= " << Result << std::endl;
46+
return !Passed;
47+
}

SYCL/Basic/context-with-multiple-devices.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// UNSUPPORTED: windows || linux
2+
// temporarily disabled
3+
14
// REQUIRES: accelerator, opencl-aot
25

36
// RUN: %clangxx -fsycl -fintelfpga -fsycl-unnamed-lambda %s -o %t2.out

SYCL/Basic/interop/check_carrying_real_kernel_IDs.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// UNSUPPORTED: windows || linux
2+
// temporarily disabled
3+
14
// REQUIRES: opencl, opencl_icd
25
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %opencl_lib
36
// RUN: %ACC_RUN_PLACEHOLDER %t.out

SYCL/DiscardEvents/invalid_event_exceptions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// UNSUPPORTED: windows || linux
2+
// temporarily disabled
3+
14
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
25
//
36
// RUN: %HOST_RUN_PLACEHOLDER %t.out

SYCL/ESIMD/api/functional/ctors/ctor_load.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ struct vector {
4646
static constexpr auto get_value() { return esimd::vector_aligned; }
4747
};
4848

49-
template <unsigned int size = 16 /*oword alignment*/> struct overal {
50-
// Use 16 instead of std::max_align_t because of the fact that long double is
51-
// not a native type in Intel GPUs. So 16 is not driven by any type, but
52-
// rather the "oword alignment" requirement for all block loads. In that
53-
// sense, std::max_align_t would give wrong idea.
54-
49+
template <unsigned int size> struct overal {
5550
static std::string to_string() {
5651
return "overaligned<" + std::to_string(size) + ">";
5752
}

SYCL/ESIMD/api/functional/ctors/ctor_load_acc_core.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ int main(int, char **) {
4747
const auto offset_generators = ctors::coverage::get_all_offset_generators();
4848

4949
// Run over all types with element and vector alignment
50-
// Default tag for overaligned is configured in a way appropriate for any
51-
// type from the type coverage, so run over it as well
50+
// Using overaligned tag with alignment requirements appropriate for any
51+
// type from the type coverage
5252
{
53+
constexpr auto oword = 16;
5354
const auto alignments =
5455
named_type_pack<ctors::alignment::element, ctors::alignment::vector,
55-
ctors::alignment::overal<>>::generate();
56+
ctors::alignment::overal<oword>>::generate();
5657

5758
// Run for all combinations possible
5859
passed &= for_all_combinations<ctors::run_test>(

SYCL/ESIMD/api/functional/ctors/ctor_load_acc_fp_extra.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ int main(int, char **) {
4747
const auto offset_generators = ctors::coverage::get_all_offset_generators();
4848

4949
// Run over all types with element and vector alignment
50-
// Default tag for overaligned is configured in a way appropriate for any
51-
// type from the type coverage, so run over it as well
50+
// Using overaligned tag with alignment requirements appropriate for any
51+
// type from the type coverage
5252
{
53+
constexpr auto oword = 16;
5354
const auto alignments =
5455
named_type_pack<ctors::alignment::element, ctors::alignment::vector,
55-
ctors::alignment::overal<>>::generate();
56+
ctors::alignment::overal<oword>>::generate();
5657

5758
// Run for all combinations possible
5859
passed &= for_all_combinations<ctors::run_test>(

SYCL/ESIMD/api/functional/ctors/ctor_load_usm_core.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ int main(int, char **) {
3030
esimd_test::createExceptionHandler());
3131

3232
bool passed = true;
33+
constexpr auto oword = 16;
3334

3435
const auto types = get_tested_types<tested_types::core>();
3536
const auto sizes = get_all_sizes();
@@ -39,7 +40,7 @@ int main(int, char **) {
3940
ctors::rval_in_expr, ctors::const_ref>::generate();
4041
const auto alignments =
4142
named_type_pack<ctors::alignment::element, ctors::alignment::vector,
42-
ctors::alignment::overal<>>::generate();
43+
ctors::alignment::overal<oword>>::generate();
4344

4445
passed &= for_all_combinations<ctors::run_test>(types, sizes, contexts,
4546
alignments, queue);

SYCL/ESIMD/api/functional/ctors/ctor_load_usm_fp_extra.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ int main(int, char **) {
3030
esimd_test::createExceptionHandler());
3131

3232
bool passed = true;
33+
constexpr auto oword = 16;
34+
3335
const auto types = get_tested_types<tested_types::fp_extra>();
3436
const auto dims = get_all_dimensions();
3537

@@ -38,7 +40,7 @@ int main(int, char **) {
3840
ctors::rval_in_expr, ctors::const_ref>::generate();
3941
const auto alignments =
4042
named_type_pack<ctors::alignment::element, ctors::alignment::vector,
41-
ctors::alignment::overal<>>::generate();
43+
ctors::alignment::overal<oword>>::generate();
4244

4345
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts,
4446
alignments, queue);

SYCL/ESIMD/api/functional/functions/common.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ namespace esimd_test::api::functional::functions {
1919

2020
namespace esimd = sycl::ext::intel::esimd;
2121

22-
template <int NumElems, int NumSelectedElems, int Stride, int Offset,
23-
typename ContextT>
22+
template <int NumElems, typename ContextT>
2423
class TestDescription : public ITestDescription {
2524
public:
2625
TestDescription(const std::string &data_type) : m_data_type(data_type) {}
@@ -30,10 +29,6 @@ class TestDescription : public ITestDescription {
3029

3130
test_description += m_data_type + ", " + std::to_string(NumElems) + ">";
3231
test_description += ", with context: " + ContextT::get_description();
33-
test_description +=
34-
", with size selected elems: " + std::to_string(NumSelectedElems);
35-
test_description += ", with stride: " + std::to_string(Stride);
36-
test_description += ", with offset: " + std::to_string(Offset);
3732

3833
return test_description;
3934
}

SYCL/ESIMD/api/functional/functions/functions_1d_select.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ class run_test {
109109
static constexpr int NumSelectedElems = NumSelectedElemsT::value;
110110
static constexpr int Stride = StrideT::value;
111111
static constexpr int Offset = OffsetT::value;
112-
using TestDescriptionT =
113-
TestDescription<NumElems, NumSelectedElems, Stride, Offset, TestCaseT>;
112+
using TestDescriptionT = TestDescription<NumElems, TestCaseT>;
114113

115114
public:
116115
bool operator()(sycl::queue &queue, const std::string &data_type) {
@@ -198,7 +197,9 @@ class run_test {
198197
bool fail_test(size_t i, DataT expected, DataT retrieved,
199198
const std::string &data_type) {
200199
log::fail(TestDescriptionT(data_type), "Unexpected value at index ", i,
201-
", retrieved: ", retrieved, ", expected: ", expected);
200+
", retrieved: ", retrieved, ", expected: ", expected,
201+
", with size selected elems: ", NumSelectedElems,
202+
", with stride: ", Stride, ", with offset: ", Offset);
202203

203204
return false;
204205
}

0 commit comments

Comments
 (0)