Skip to content

Commit aa4e84a

Browse files
denis-kabanovbb-sycl
authored andcommitted
[SYCL][HIP] Expect failure of some tests that have 'has(aspect::atomic64)' (intel#854)
* [SYCL][HIP] Disable some tests that have 'has(aspect::atomic64)' Disable some tests that have 'has(aspect::atomic64)' because hip backend does not have such check implementation * Disable Basic test with 'has(aspect::atomic64)'
1 parent 47ad7ef commit aa4e84a

10 files changed

+366
-0
lines changed

SYCL/AtomicRef/add_atomic64.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \
2+
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60
3+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
7+
8+
// XFAIL: hip
9+
// Expected failure because hip does not have atomic64 check implementation
10+
11+
#include "add.h"
12+
#include <iostream>
13+
using namespace sycl;
14+
15+
// Floating-point types do not support pre- or post-increment
16+
template <> void add_test<double>(queue q, size_t N) {
17+
add_fetch_test<::sycl::ext::oneapi::atomic_ref,
18+
access::address_space::global_space, double>(q, N);
19+
add_fetch_test<::sycl::atomic_ref, access::address_space::global_space,
20+
double>(q, N);
21+
add_plus_equal_test<::sycl::ext::oneapi::atomic_ref,
22+
access::address_space::global_space, double>(q, N);
23+
add_plus_equal_test<::sycl::atomic_ref, access::address_space::global_space,
24+
double>(q, N);
25+
}
26+
27+
int main() {
28+
queue q;
29+
30+
if (!q.get_device().has(aspect::atomic64)) {
31+
std::cout << "Skipping test\n";
32+
return 0;
33+
}
34+
35+
constexpr int N = 32;
36+
add_test<double>(q, N);
37+
38+
// Include long tests if they are 64 bits wide
39+
if constexpr (sizeof(long) == 8) {
40+
add_test<long>(q, N);
41+
add_test<unsigned long>(q, N);
42+
}
43+
44+
// Include long long tests if they are 64 bits wide
45+
if constexpr (sizeof(long long) == 8) {
46+
add_test<long long>(q, N);
47+
add_test<unsigned long long>(q, N);
48+
}
49+
50+
// Include pointer tests if they are 64 bits wide
51+
if constexpr (sizeof(char *) == 8) {
52+
add_test<char *, ptrdiff_t>(q, N);
53+
}
54+
55+
std::cout << "Test passed." << std::endl;
56+
}

SYCL/AtomicRef/assignment_atomic64.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out
55
// RUN: %ACC_RUN_PLACEHOLDER %t.out
66

7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
710
#include "assignment.h"
811
#include <iostream>
912
using namespace sycl;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "compare_exchange.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
compare_exchange_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
compare_exchange_test<long>(q, N);
28+
compare_exchange_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
compare_exchange_test<long long>(q, N);
34+
compare_exchange_test<unsigned long long>(q, N);
35+
}
36+
37+
// Include pointer tests if they are 64 bits wide
38+
if constexpr (sizeof(char *) == 8) {
39+
compare_exchange_test<char *>(q, N);
40+
}
41+
42+
std::cout << "Test passed." << std::endl;
43+
}

SYCL/AtomicRef/exchange_atomic64.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "exchange.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
exchange_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
exchange_test<long>(q, N);
28+
exchange_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
exchange_test<long long>(q, N);
34+
exchange_test<unsigned long long>(q, N);
35+
}
36+
37+
// Include pointer tests if they are 64 bits wide
38+
if constexpr (sizeof(char *) == 8) {
39+
exchange_test<char *>(q, N);
40+
}
41+
42+
std::cout << "Test passed." << std::endl;
43+
}

SYCL/AtomicRef/load_atomic64.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "load.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
load_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
load_test<long>(q, N);
28+
load_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
load_test<long long>(q, N);
34+
load_test<unsigned long long>(q, N);
35+
}
36+
37+
// Include pointer tests if they are 64 bits wide
38+
if constexpr (sizeof(char *) == 8) {
39+
load_test<char *>(q, N);
40+
}
41+
42+
std::cout << "Test passed." << std::endl;
43+
}

SYCL/AtomicRef/max_atomic64.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "max.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
max_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
max_test<long>(q, N);
28+
max_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
max_test<long long>(q, N);
34+
max_test<unsigned long long>(q, N);
35+
}
36+
37+
std::cout << "Test passed." << std::endl;
38+
}

SYCL/AtomicRef/min_atomic64.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "min.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
min_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
min_test<long>(q, N);
28+
min_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
min_test<long long>(q, N);
34+
min_test<unsigned long long>(q, N);
35+
}
36+
37+
std::cout << "Test passed." << std::endl;
38+
}

SYCL/AtomicRef/store_atomic64.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
10+
#include "store.h"
11+
#include <iostream>
12+
using namespace sycl;
13+
14+
int main() {
15+
queue q;
16+
17+
if (!q.get_device().has(aspect::atomic64)) {
18+
std::cout << "Skipping test\n";
19+
return 0;
20+
}
21+
22+
constexpr int N = 32;
23+
store_test<double>(q, N);
24+
25+
// Include long tests if they are 64 bits wide
26+
if constexpr (sizeof(long) == 8) {
27+
store_test<long>(q, N);
28+
store_test<unsigned long>(q, N);
29+
}
30+
31+
// Include long long tests if they are 64 bits wide
32+
if constexpr (sizeof(long long) == 8) {
33+
store_test<long long>(q, N);
34+
store_test<unsigned long long>(q, N);
35+
}
36+
37+
// Include pointer tests if they are 64 bits wide
38+
if constexpr (sizeof(char *) == 8) {
39+
store_test<char *>(q, N);
40+
}
41+
42+
std::cout << "Test passed." << std::endl;
43+
}

SYCL/AtomicRef/sub_atomic64.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \
2+
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60
3+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
7+
8+
// XFAIL: hip
9+
// Expected failure because hip does not have atomic64 check implementation
10+
11+
#include "sub.h"
12+
#include <iostream>
13+
using namespace sycl;
14+
15+
// Floating-point types do not support pre- or post-decrement
16+
template <> void sub_test<double>(queue q, size_t N) {
17+
sub_fetch_test<::sycl::ext::oneapi::atomic_ref,
18+
access::address_space::global_space, double>(q, N);
19+
sub_fetch_test<::sycl::atomic_ref, access::address_space::global_space,
20+
double>(q, N);
21+
sub_plus_equal_test<::sycl::ext::oneapi::atomic_ref,
22+
access::address_space::global_space, double>(q, N);
23+
sub_plus_equal_test<::sycl::atomic_ref, access::address_space::global_space,
24+
double>(q, N);
25+
}
26+
27+
int main() {
28+
queue q;
29+
30+
if (!q.get_device().has(aspect::atomic64)) {
31+
std::cout << "Skipping test\n";
32+
return 0;
33+
}
34+
35+
constexpr int N = 32;
36+
sub_test<double>(q, N);
37+
38+
// Include long tests if they are 64 bits wide
39+
if constexpr (sizeof(long) == 8) {
40+
sub_test<long>(q, N);
41+
sub_test<unsigned long>(q, N);
42+
}
43+
44+
// Include long long tests if they are 64 bits wide
45+
if constexpr (sizeof(long long) == 8) {
46+
sub_test<long long>(q, N);
47+
sub_test<unsigned long long>(q, N);
48+
}
49+
50+
// Include pointer tests if they are 64 bits wide
51+
if constexpr (sizeof(char *) == 8) {
52+
sub_test<char *, ptrdiff_t>(q, N);
53+
}
54+
55+
std::cout << "Test passed." << std::endl;
56+
}

SYCL/Basic/aspects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// Hip is missing some of the parameters tested here so it fails with NVIDIA
55
// XFAIL: hip_nvidia
66

7+
// XFAIL: hip
8+
// Expected failure because hip does not have atomic64 check implementation
9+
710
//==--------------- aspects.cpp - SYCL device test ------------------------==//
811
//
912
// Returns the various aspects of a device and platform.

0 commit comments

Comments
 (0)