This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Add support for the generic address space in tests for sycl::a… #619
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a05ec9d
[SYCL] Add support for the generic address space in tests for sycl::a…
5ff34bd
[SYCL][NFC] Fix formatting issues
0d233ec
[SYCL] Add support for the generic address space in more tests
d9fcc1a
[SYCL][NFC] Fix formatting issues
a605e77
[SYCL] Move tests for the generic address space in separated .cpp files
03efd80
[SYCL] Fix compilation errors in the add and sub tests
ddcc038
[SYCL] Trigger precommit tests
a859ab4
[SYCL] Trigger precommit tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,52 @@ | ||
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \ | ||
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60 | ||
// RUN: %HOST_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
|
||
// CUDA backend has had no support for the generic address space yet | ||
// XFAIL: cuda | ||
|
||
#include "add.h" | ||
#include <iostream> | ||
using namespace sycl; | ||
|
||
// Floating-point types do not support pre- or post-increment | ||
template <> void add_generic_test<double>(queue q, size_t N) { | ||
add_fetch_test<::sycl::atomic_ref, access::address_space::generic_space, | ||
double>(q, N); | ||
add_plus_equal_test<::sycl::atomic_ref, access::address_space::generic_space, | ||
double>(q, N); | ||
} | ||
|
||
int main() { | ||
queue q; | ||
|
||
if (!q.get_device().has(aspect::atomic64)) { | ||
std::cout << "Skipping test\n"; | ||
return 0; | ||
} | ||
|
||
constexpr int N = 32; | ||
add_generic_test<double>(q, N); | ||
|
||
// Include long tests if they are 64 bits wide | ||
if constexpr (sizeof(long) == 8) { | ||
add_generic_test<long>(q, N); | ||
add_generic_test<unsigned long>(q, N); | ||
} | ||
|
||
// Include long long tests if they are 64 bits wide | ||
if constexpr (sizeof(long long) == 8) { | ||
add_generic_test<long long>(q, N); | ||
add_generic_test<unsigned long long>(q, N); | ||
} | ||
|
||
// Include pointer tests if they are 64 bits wide | ||
if constexpr (sizeof(char *) == 8) { | ||
add_generic_test<char *, ptrdiff_t>(q, N); | ||
} | ||
|
||
std::cout << "Test passed." << std::endl; | ||
} |
This file contains hidden or 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,43 @@ | ||
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out \ | ||
// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_60 | ||
// RUN: %HOST_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
|
||
// CUDA backend has had no support for the generic address space yet | ||
// XFAIL: cuda | ||
|
||
#include "add.h" | ||
#include <iostream> | ||
using namespace sycl; | ||
|
||
// Floating-point types do not support pre- or post-increment | ||
template <> void add_generic_test<float>(queue q, size_t N) { | ||
add_fetch_test<::sycl::atomic_ref, access::address_space::generic_space, | ||
float>(q, N); | ||
add_plus_equal_test<::sycl::atomic_ref, access::address_space::generic_space, | ||
float>(q, N); | ||
} | ||
|
||
int main() { | ||
queue q; | ||
|
||
constexpr int N = 32; | ||
add_generic_test<int>(q, N); | ||
add_generic_test<unsigned int>(q, N); | ||
add_generic_test<float>(q, N); | ||
|
||
// Include long tests if they are 32 bits wide | ||
if constexpr (sizeof(long) == 4) { | ||
add_generic_test<long>(q, N); | ||
add_generic_test<unsigned long>(q, N); | ||
} | ||
|
||
// Include pointer tests if they are 32 bits wide | ||
if constexpr (sizeof(char *) == 4) { | ||
add_generic_test<char *, ptrdiff_t>(q, N); | ||
} | ||
|
||
std::cout << "Test passed." << std::endl; | ||
} |
This file contains hidden or 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
This file contains hidden or 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,43 @@ | ||
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out | ||
// RUN: %HOST_RUN_PLACEHOLDER %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
|
||
// CUDA backend has had no support for the generic address space yet | ||
// XFAIL: cuda | ||
|
||
#include "assignment.h" | ||
#include <iostream> | ||
using namespace sycl; | ||
|
||
int main() { | ||
queue q; | ||
|
||
if (!q.get_device().has(aspect::atomic64)) { | ||
std::cout << "Skipping test\n"; | ||
return 0; | ||
} | ||
|
||
constexpr int N = 32; | ||
assignment_generic_test<double>(q, N); | ||
|
||
// Include long tests if they are 64 bits wide | ||
if constexpr (sizeof(long) == 8) { | ||
assignment_generic_test<long>(q, N); | ||
assignment_generic_test<unsigned long>(q, N); | ||
} | ||
|
||
// Include long long tests if they are 64 bits wide | ||
if constexpr (sizeof(long long) == 8) { | ||
assignment_generic_test<long long>(q, N); | ||
assignment_generic_test<unsigned long long>(q, N); | ||
} | ||
|
||
// Include pointer tests if they are 64 bits wide | ||
if constexpr (sizeof(char *) == 8) { | ||
assignment_generic_test<char *>(q, N); | ||
} | ||
|
||
std::cout << "Test passed." << std::endl; | ||
} |
This file contains hidden or 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,34 @@ | ||
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out | ||
// RUN: %HOST_RUN_PLACEHOLDER %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
|
||
// CUDA backend has had no support for the generic address space yet | ||
// XFAIL: cuda | ||
|
||
#include "assignment.h" | ||
#include <iostream> | ||
using namespace sycl; | ||
|
||
int main() { | ||
queue q; | ||
|
||
constexpr int N = 32; | ||
assignment_generic_test<int>(q, N); | ||
assignment_generic_test<unsigned int>(q, N); | ||
assignment_generic_test<float>(q, N); | ||
|
||
// Include long tests if they are 32 bits wide | ||
if constexpr (sizeof(long) == 4) { | ||
assignment_generic_test<long>(q, N); | ||
assignment_generic_test<unsigned long>(q, N); | ||
} | ||
|
||
// Include pointer tests if they are 32 bits wide | ||
if constexpr (sizeof(char *) == 4) { | ||
assignment_generic_test<char *>(q, N); | ||
} | ||
|
||
std::cout << "Test passed." << std::endl; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.