Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYCL: Get Pointer Type #3434

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions Src/Base/AMReX_GpuUtility.H
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ namespace Gpu {
CUresult r = cuPointerGetAttributes(1, &attrib, data, (CUdeviceptr)p);
return r == CUDA_SUCCESS && is_managed;
#elif defined(AMREX_USE_SYCL)
amrex::ignore_unused(p);
// xxxxx SYCL todo: get_pointer_type
// auto const info = sycl::get_pointer_info(p);
// auto type = sycl::get_pointer_type(p,Device::syclContext());
return false;
auto type = sycl::get_pointer_type(p,Device::syclContext());
return type == sycl::usm::alloc::shared;
#else
amrex::ignore_unused(p);
return false;
Expand All @@ -74,9 +71,8 @@ namespace Gpu {
CUresult r = cuPointerGetAttributes(1, &attrib, data, (CUdeviceptr)p);
return r == CUDA_SUCCESS && mem_type == CU_MEMORYTYPE_DEVICE;
#elif defined(AMREX_USE_SYCL)
amrex::ignore_unused(p);
// xxxxx SYCL todo: get_pointer_type
return false;
auto type = sycl::get_pointer_type(p,Device::syclContext());
return type == sycl::usm::alloc::device;
#else
amrex::ignore_unused(p);
return false;
Expand All @@ -95,9 +91,8 @@ namespace Gpu {
CUresult r = cuPointerGetAttributes(1, &attrib, data, (CUdeviceptr)p);
return r == CUDA_SUCCESS && mem_type == CU_MEMORYTYPE_HOST;
#elif defined(AMREX_USE_SYCL)
amrex::ignore_unused(p);
// xxxxx SYCL todo: get_pointer_type
return false;
auto type = sycl::get_pointer_type(p,Device::syclContext());
return type == sycl::usm::alloc::host;
#else
amrex::ignore_unused(p);
return false;
Expand Down Expand Up @@ -126,9 +121,8 @@ namespace Gpu {
mem_type == CU_MEMORYTYPE_ARRAY ||
mem_type == CU_MEMORYTYPE_UNIFIED);
#elif defined(AMREX_USE_SYCL)
amrex::ignore_unused(p);
// xxxxx SYCL todo: get_pointer_type
return false;
auto type = sycl::get_pointer_type(p,Device::syclContext());
return type != sycl::usm::alloc::unknown;
#else
amrex::ignore_unused(p);
return false;
Expand Down
Loading