Skip to content

Commit 028855e

Browse files
authored
Auto pulldown and update tc files for xmain-cand branch on 20221103
Auto pulldown and update tc files for xmain-cand branch on 20221103
2 parents d8e613f + 18eb04d commit 028855e

File tree

230 files changed

+4347
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+4347
-565
lines changed

MicroBenchmarks/ImageProcessing/Dither/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void BENCHMARK_ORDERED_DITHER(benchmark::State &state) {
6969
int height = state.range(0);
7070
int width = state.range(0);
7171
int m = state.range(1);
72-
int n = pow(m, 2);
72+
int n = pow((double)m, 2);
7373
int *outputImage = (int *)malloc(sizeof(int) * height * width);
7474
int *temp = (int *)malloc(sizeof(int) * height * width);
7575

MicroBenchmarks/libs/benchmark/test/benchmark_setup_teardown_test.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
// Test that Setup() and Teardown() are called exactly once
1212
// for each benchmark run (single-threaded).
13-
namespace single {
13+
namespace singlethreaded {
1414
static int setup_call = 0;
1515
static int teardown_call = 0;
16-
} // namespace single
16+
} // namespace singlethreaded
1717
static void DoSetup1(const benchmark::State& state) {
18-
++single::setup_call;
18+
++singlethreaded::setup_call;
1919

2020
// Setup/Teardown should never be called with any thread_idx != 0.
2121
assert(state.thread_index() == 0);
2222
}
2323

2424
static void DoTeardown1(const benchmark::State& state) {
25-
++single::teardown_call;
25+
++singlethreaded::teardown_call;
2626
assert(state.thread_index() == 0);
2727
}
2828

@@ -134,8 +134,8 @@ int main(int argc, char** argv) {
134134
assert(ret > 0);
135135

136136
// Setup/Teardown is called once for each arg group (1,3,5,7).
137-
assert(single::setup_call == 4);
138-
assert(single::teardown_call == 4);
137+
assert(singlethreaded::setup_call == 4);
138+
assert(singlethreaded::teardown_call == 4);
139139

140140
// 3 group of threads calling this function (3,5,10).
141141
assert(concurrent::setup_call.load(std::memory_order_relaxed) == 3);

MultiSource/Applications/ClamAV/libclamav_readdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ static int dirent_compare(const struct dirent *a, const struct dirent *b) {
10691069
int ret = strcmp(a->d_name, b->d_name);
10701070
if (ret != 0)
10711071
return ret;
1072-
#ifdef _AIX
1072+
#if defined(_AIX) || (defined(__sun__) && defined(__svr4__))
10731073
struct stat a_stat;
10741074
struct stat b_stat;
10751075
stat(a->d_name, &a_stat);

MultiSource/Applications/oggenc/oggenc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Portions from Vorbize, (c) Kenneth Arnold <[email protected]>
99
* and libvorbis examples, (c) Monty <[email protected]>
1010
*/
11+
#include <alloca.h>
1112
#include <assert.h>
1213
#include <ctype.h>
1314
#include <errno.h>
@@ -23,8 +24,8 @@
2324
#include <sys/types.h>
2425
#include <time.h>
2526
#include <unistd.h>
26-
#ifdef __XS1B__
2727
#include <stdint.h>
28+
#ifdef __XS1B__
2829
#include "xcoretestsuite.h"
2930
#endif
3031

@@ -129,9 +130,9 @@ extern int _getopt_internal (int ___argc, char *const *___argv,
129130

130131
/* these are filled in by configure */
131132
typedef int16_t ogg_int16_t;
132-
typedef u_int16_t ogg_uint16_t;
133+
typedef uint16_t ogg_uint16_t;
133134
typedef int32_t ogg_int32_t;
134-
typedef u_int32_t ogg_uint32_t;
135+
typedef uint32_t ogg_uint32_t;
135136
typedef int64_t ogg_int64_t;
136137

137138
typedef struct {

MultiSource/Applications/viterbi/read_dmatrix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include <string.h>
23
#include <memory.h>
34

45
#include "common.h"

MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// limitations under the License.
1616
//
1717

18-
#if !defined(__linux__) && !defined(__NetBSD__)
18+
#if !defined(__linux__) && !defined(__NetBSD__) && !(defined(__sun__) && defined(__svr4__))
1919

2020
#include <stdio.h>
2121
#include <stdlib.h>

MultiSource/Benchmarks/McCat/05-eks/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
/* contains the eigenvalues for each of the matrixes. */
3333
/* */
3434
/************************************************************************/
35+
#include <stdio.h>
36+
#include <string.h>
3537
#include "main.h"
3638
#include "QRfact.h"
3739
#include "Triang.h"
3840
#include "Jacobi.h"
39-
#include <stdio.h>
40-
#include <string.h>
4141
Matrix A,Q,U;
4242

4343
int comp(const double *a,const double *b)

MultiSource/Benchmarks/MiBench/consumer-lame/rtp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <unistd.h>
55
#include <stdlib.h>
66
#include <stdio.h>
7+
#include <alloca.h>
78
#include <sys/types.h>
89
#include <sys/socket.h>
910
#include <arpa/inet.h>

MultiSource/Benchmarks/MiBench/office-ispell/term.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static char Rcs_Id[] =
7272
#include "msgs.h"
7373
#include <signal.h>
7474

75-
#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
75+
#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || (defined(__sun__) && defined(__svr4__))
7676
/* Use termios under at least glibc */
7777
#include <termios.h>
7878
#define USE_TERMIOS

SYCL/AtomicRef/add_local.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// See https://github.com/intel/llvm-test-suite/issues/867 for detailed status
2+
// UNSUPPORTED: hip
3+
14
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
25
// RUN: %GPU_RUN_PLACEHOLDER %t.out
36
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/AtomicRef/min_local.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// See https://github.com/intel/llvm-test-suite/issues/867 for detailed status
2+
// UNSUPPORTED: hip
3+
14
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
25
// RUN: %GPU_RUN_PLACEHOLDER %t.out
36
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/AtomicRef/sub_local.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// See https://github.com/intel/llvm-test-suite/issues/867 for detailed status
2+
// UNSUPPORTED: hip
3+
14
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
25
// RUN: %GPU_RUN_PLACEHOLDER %t.out
36
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/Basic/accessor/accessor.cpp

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,62 @@ template <typename Acc> struct Wrapper2 {
6060

6161
template <typename Acc> struct Wrapper3 { Wrapper2<Acc> w2; };
6262

63+
template <typename GlobAcc, typename LocAcc>
64+
void testLocalAccItersImpl(sycl::handler &cgh, GlobAcc &globAcc, LocAcc &locAcc,
65+
bool testConstIter) {
66+
if (testConstIter) {
67+
cgh.single_task([=]() {
68+
size_t Idx = 0;
69+
for (auto &It : locAcc) {
70+
It = globAcc[Idx++];
71+
}
72+
Idx = 0;
73+
for (auto It = locAcc.cbegin(); It != locAcc.cend(); It++)
74+
globAcc[Idx++] = *It * 2 + 1;
75+
Idx = locAcc.size() - 1;
76+
for (auto It = locAcc.crbegin(); It != locAcc.crend(); It++)
77+
globAcc[Idx--] += *It;
78+
});
79+
} else {
80+
cgh.single_task([=]() {
81+
size_t Idx = 0;
82+
for (auto It = locAcc.begin(); It != locAcc.end(); It++)
83+
*It = globAcc[Idx++] * 2;
84+
for (auto &It : locAcc) {
85+
It++;
86+
}
87+
for (auto It = locAcc.rbegin(); It != locAcc.rend(); It++) {
88+
*It *= 2;
89+
*It += 1;
90+
}
91+
Idx = 0;
92+
for (auto &It : locAcc) {
93+
globAcc[Idx++] = It;
94+
}
95+
});
96+
}
97+
}
98+
99+
void testLocalAccIters(std::vector<int> &vec, bool testConstIter = false,
100+
bool test2D = false) {
101+
try {
102+
sycl::queue queue;
103+
sycl::buffer<int, 1> buf(vec.data(), vec.size());
104+
queue.submit([&](sycl::handler &cgh) {
105+
auto globAcc = buf.get_access<sycl::access::mode::read_write>(cgh);
106+
if (test2D) {
107+
sycl::local_accessor<int, 2> locAcc(sycl::range<2>{2, 16}, cgh);
108+
testLocalAccItersImpl(cgh, globAcc, locAcc, testConstIter);
109+
} else {
110+
sycl::local_accessor<int, 1> locAcc(32, cgh);
111+
testLocalAccItersImpl(cgh, globAcc, locAcc, testConstIter);
112+
}
113+
});
114+
} catch (sycl::exception &e) {
115+
std::cout << e.what() << std::endl;
116+
}
117+
}
118+
63119
int main() {
64120
// Host accessor.
65121
{
@@ -771,5 +827,40 @@ int main() {
771827
}
772828
}
773829

830+
// Test iterator methods with 1D local_accessor
831+
{
832+
std::vector<int> v(32);
833+
for (int i = 0; i < v.size(); ++i) {
834+
v[i] = i;
835+
}
836+
testLocalAccIters(v);
837+
for (int i = 0; i < v.size(); ++i)
838+
assert(v[i] == ((i * 2 + 1) * 2 + 1));
839+
840+
for (int i = 0; i < v.size(); ++i) {
841+
v[i] = i;
842+
}
843+
testLocalAccIters(v, true);
844+
for (int i = 0; i < v.size(); ++i)
845+
assert(v[i] == ((i * 2 + 1) + i));
846+
}
847+
// Test iterator methods with 2D local_accessor
848+
{
849+
std::vector<int> v(32);
850+
for (int i = 0; i < v.size(); ++i) {
851+
v[i] = i;
852+
}
853+
testLocalAccIters(v, false, true);
854+
for (int i = 0; i < v.size(); ++i)
855+
assert(v[i] == ((i * 2 + 1) * 2 + 1));
856+
857+
for (int i = 0; i < v.size(); ++i) {
858+
v[i] = i;
859+
}
860+
testLocalAccIters(v, true, true);
861+
for (int i = 0; i < v.size(); ++i)
862+
assert(v[i] == ((i * 2 + 1) + i));
863+
}
864+
774865
std::cout << "Test passed" << std::endl;
775866
}

SYCL/Basic/device-selectors.cpp

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,69 @@ int main() {
117117
} catch (exception &e) {
118118
}
119119

120+
// ------ aspect_selectors --------
121+
122+
// Unrestrained selection, equivalent to default_selector.
123+
device dev0 = device{aspect_selector()};
124+
assert(dev0 == default_queue.get_device() &&
125+
"unrestrained aspect selector should result in same device as "
126+
"default_selector");
127+
128+
// -- Individual test runs may or may not have desired device available.
129+
// Ignore any exception.
130+
131+
// Pass aspects in a vector.
132+
try {
133+
device dev1 =
134+
device{aspect_selector(std::vector{aspect::cpu, aspect::image})};
135+
assert(dev1.is_cpu() && "Incorrect device, expected CPU.");
136+
assert(dev1.has(aspect::image) && "Device should support aspect::image.");
137+
} catch (exception &e) {
138+
}
139+
140+
// Pass aspects without a vector.
141+
try {
142+
device dev2 = device{aspect_selector(aspect::gpu, aspect::image)};
143+
assert(dev2.is_gpu() && "Incorrect device, expected GPU.");
144+
assert(dev2.has(aspect::image) && "Device should support aspect::image.");
145+
} catch (exception &e) {
146+
}
147+
148+
// Pass aspects as compile-time parameters
149+
try {
150+
device dev3 = device{aspect_selector<aspect::cpu, aspect::fp64>()};
151+
assert(dev3.is_cpu() && "Incorrect device, expected CPU.");
152+
assert(dev3.has(aspect::fp64) && "Device should support aspect::fp64.");
153+
} catch (exception &e) {
154+
}
155+
156+
// Pass aspects in an allowlist and a denylist.
157+
try {
158+
device dev4 = device{aspect_selector(std::vector{aspect::accelerator},
159+
std::vector{aspect::image})};
160+
assert(dev4.is_accelerator() && "Incorrect device, expected accelerator.");
161+
assert(!dev4.has(aspect::image) &&
162+
"Device should NOT support aspect::image.");
163+
} catch (exception &e) {
164+
}
165+
166+
// Validate errors.
167+
try {
168+
device dev5 = device{aspect_selector<aspect::cpu, aspect::gpu>()};
169+
assert(
170+
"We should not be here. No known device that is both a CPU and a GPU.");
171+
} catch (exception &e) {
172+
assert(e.code() == sycl::errc::runtime && "Incorrect error code.");
173+
}
174+
175+
try {
176+
device dev6 = device{
177+
aspect_selector(std::vector{aspect::cpu}, std::vector{aspect::cpu})};
178+
assert("We should not be here. RequireList and DenyList impossible to "
179+
"fulfill.");
180+
} catch (exception &e) {
181+
assert(e.code() == sycl::errc::runtime && "Incorrect error code.");
182+
}
183+
120184
return 0;
121185
}

SYCL/Basic/intel-ext-device.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ int main(int argc, char **argv) {
122122
}
123123
std::cout << "\n";
124124
}
125+
if (SYCL_EXT_INTEL_DEVICE_INFO >= 5 &&
126+
dev.has(aspect::ext_intel_device_id)) {
127+
int deviceID =
128+
dev.get_info<ext::intel::info::device::device_id>();
129+
std::cout << "Device ID = " << deviceID << std::endl;
130+
}
125131
} // SYCL_EXT_INTEL_DEVICE_INFO
126132
}
127133

0 commit comments

Comments
 (0)