Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lbushi25 committed Jan 31, 2024
1 parent cd07943 commit b3ad06d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 29 deletions.
4 changes: 2 additions & 2 deletions sycl/test-e2e/GroupAlgorithm/root_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void testQueriesAndProperties() {

void testRootGroup() {
sycl::queue q;
if (!q.get_device().has(aspect::usm_shared_allocations))
if (!q.get_device().has(sycl::aspect::usm_shared_allocations))
return;
const auto bundle =
sycl::get_kernel_bundle<sycl::bundle_state::executable>(q.get_context());
Expand Down Expand Up @@ -68,7 +68,7 @@ void testRootGroup() {

void testRootGroupFunctions() {
sycl::queue q;
if (!q.get_device().has(aspect::usm_shared_allocations))
if (!q.get_device().has(sycl::aspect::usm_shared_allocations))
return;
const auto bundle =
sycl::get_kernel_bundle<sycl::bundle_state::executable>(q.get_context());
Expand Down
54 changes: 30 additions & 24 deletions sycl/test-e2e/USM/alloc_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,25 @@ int main() {
[&]() { return AHost(Align, q, property_list{}); },
[&]() { return AHost(Align, ctx, property_list{}); }});

auto AShared = [&](size_t Align, auto... args) {
return aligned_alloc_shared(Align, sizeof(std::max_align_t), args...);
};
CheckAll(FAlign,
std::tuple{
[&]() { return AShared(FAlign / 2, q); },
[&]() { return AShared(FAlign / 2, d, ctx); },
[&]() { return AShared(FAlign / 2, q, property_list{}); },
[&]() { return AShared(FAlign / 2, d, ctx, property_list{}); }});
CheckAll(
Align,
std::tuple{[&]() { return AShared(Align, q); },
[&]() { return AShared(Align, d, ctx); },
[&]() { return AShared(Align, q, property_list{}); },
[&]() { return AShared(Align, d, ctx, property_list{}); }});
if (q.get_device().has(aspect::usm_device_allocations) &&
d.has(aspect::usm_device_allocations)) {
auto AShared = [&](size_t Align, auto... args) {
return aligned_alloc_shared(Align, sizeof(std::max_align_t), args...);
};
CheckAll(
FAlign,
std::tuple{
[&]() { return AShared(FAlign / 2, q); },
[&]() { return AShared(FAlign / 2, d, ctx); },
[&]() { return AShared(FAlign / 2, q, property_list{}); },
[&]() { return AShared(FAlign / 2, d, ctx, property_list{}); }});
CheckAll(
Align,
std::tuple{[&]() { return AShared(Align, q); },
[&]() { return AShared(Align, d, ctx); },
[&]() { return AShared(Align, q, property_list{}); },
[&]() { return AShared(Align, d, ctx, property_list{}); }});
}

auto TDevice = [&](auto... args) {
return malloc_device<Aligned>(1, args...);
Expand Down Expand Up @@ -179,15 +183,17 @@ int main() {
[&]() { return ATHost(Align / 2, ctx); }});
CheckAll(Align * 2, std::tuple{[&]() { return ATHost(Align * 2, q); },
[&]() { return ATHost(Align * 2, ctx); }});

auto ATShared = [&](size_t Align, auto... args) {
return aligned_alloc_shared<Aligned>(Align, 1, args...);
};
CheckAll(Align, std::tuple{[&]() { return ATShared(Align / 2, q); },
[&]() { return ATShared(Align / 2, d, ctx); }});
CheckAll(Align * 2,
std::tuple{[&]() { return ATShared(Align * 2, q); },
[&]() { return ATShared(Align * 2, d, ctx); }});
if (q.get_device().has(aspect::usm_device_allocations) &&
d.has(aspect::usm_device_allocations)) {
auto ATShared = [&](size_t Align, auto... args) {
return aligned_alloc_shared<Aligned>(Align, 1, args...);
};
CheckAll(Align, std::tuple{[&]() { return ATShared(Align / 2, q); },
[&]() { return ATShared(Align / 2, d, ctx); }});
CheckAll(Align * 2,
std::tuple{[&]() { return ATShared(Align * 2, q); },
[&]() { return ATShared(Align * 2, d, ctx); }});
}

auto Malloc = [&](auto... args) {
return malloc(sizeof(std::max_align_t), args...);
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/USM/memcpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int main() {
TEST_MEMCPY(inArray, init_on_device, outArray, check_on_device)

// Test device to aligned device
USM_MALLOC(inArray, shared)
USM_MALLOC(inArray, device)
USM_ALIGNED_ALLOC_DEVICE(outArray)
TEST_MEMCPY(inArray, init_on_device, outArray, check_on_device)

Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/syclcompat/kernel/Inputs/kernel_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
//
//
// ===---------------------------------------------------------------------===//
// REQUIRES: usm_shared_allocations
#ifdef _WIN32
#include <windows.h>
#else
Expand Down Expand Up @@ -110,7 +109,7 @@ void test_kernel_functor_ptr() {

int sharedSize = 10;
void **param = nullptr, **extra = nullptr;

if (!q_ct1->get_device().has(sycl::aspect::usm_shared_allocations) return;
int *dev = sycl::malloc_shared<int>(16, *q_ct1);
for (int i = 0; i < 16; i++) {
dev[i] = 0;
Expand Down

0 comments on commit b3ad06d

Please sign in to comment.