Skip to content

Commit

Permalink
[SYCL] Remove deprecated sycl::host_ptr/sycl::device_ptr (#13240)
Browse files Browse the repository at this point in the history
They have been deprecated in #7680
more than a year ago.

---------

Co-authored-by: Greg Lueck <gregory.m.lueck@intel.com>
  • Loading branch information
aelovikov-intel and gmlueck authored Apr 2, 2024
1 parent 16ff5a5 commit ec3d9ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ supports.
`sycl::ext::intel::decorated_host_ptr`, `sycl::ext::intel::device_ptr`,
`sycl::ext::intel::raw_device_ptr` and `sycl::ext::intel::decorated_device_ptr`.
`sycl::host_ptr` and `sycl::device_ptr` are deprecated.

|3
|`sycl::host_ptr` and `sycl::device_ptr` are removed.

|===

== Modifications to SYCL 2020
Expand Down Expand Up @@ -159,21 +163,6 @@ Add `device_ptr`, `host_ptr`, `raw_device_ptr`, `raw_host_ptr`,
`multi_ptr` aliases as follows:
```c++
namespace sycl {

// Deprecated.
template<typename ElementType,
access::decorated IsDecorated = access::decorated::legacy>
using device_ptr =
multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
IsDecorated>

// Deprecated.
template<typename ElementType,
access::decorated IsDecorated = access::decorated::legacy>
using host_ptr =
multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
IsDecorated>

namespace ext {
namespace intel {

Expand Down
20 changes: 1 addition & 19 deletions sycl/include/sycl/pointers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#pragma once

#include <sycl/access/access.hpp> // for decorated, address_space
#include <sycl/detail/defines_elementary.hpp> // for __SYCL_DEPRECATED
#include <sycl/access/access.hpp> // for decorated, address_space

namespace sycl {
inline namespace _V1 {
Expand All @@ -29,23 +28,6 @@ template <typename ElementType,
using global_ptr =
multi_ptr<ElementType, access::address_space::global_space, IsDecorated>;

// Note: Templated alias deprecation is not currently working in clang. See
// https://github.com/llvm/llvm-project/issues/18236.
template <typename ElementType,
access::decorated IsDecorated = access::decorated::legacy>
using device_ptr __SYCL_DEPRECATED(
"Use 'sycl::ext::intel::device_ptr' instead.") =
multi_ptr<ElementType, access::address_space::ext_intel_global_device_space,
IsDecorated>;

// Note: Templated alias deprecation is not currently working in clang. See
// https://github.com/llvm/llvm-project/issues/18236.
template <typename ElementType,
access::decorated IsDecorated = access::decorated::legacy>
using host_ptr __SYCL_DEPRECATED("Use 'sycl::ext::intel::host_ptr' instead.") =
multi_ptr<ElementType, access::address_space::ext_intel_global_host_space,
IsDecorated>;

template <typename ElementType,
access::decorated IsDecorated = access::decorated::legacy>
using local_ptr =
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/feature_test.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ inline namespace _V1 {
#define SYCL_EXT_INTEL_FPGA_REG 1
#define SYCL_EXT_INTEL_KERNEL_ARGS_RESTRICT 1
#define SYCL_EXT_INTEL_MEM_CHANNEL_PROPERTY 1
#define SYCL_EXT_INTEL_USM_ADDRESS_SPACES 2
#define SYCL_EXT_INTEL_USM_ADDRESS_SPACES 3
#define SYCL_EXT_INTEL_RUNTIME_BUFFER_LOCATION 1
#define SYCL_EXT_INTEL_QUEUE_INDEX 1
#define SYCL_EXT_INTEL_FPGA_MEM 1
Expand Down
4 changes: 2 additions & 2 deletions sycl/test/extensions/fpga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ int main() {
auto *in_ptr = sycl::malloc_host<int>(1, Queue.get_context());
Queue.submit([&](sycl::handler &cgh) {
cgh.single_task<class HostAnnotation>([=]() {
sycl::host_ptr<const int> input_ptr(in_ptr);
sycl::host_ptr<int> output_ptr(out_ptr);
sycl::ext::intel::host_ptr<const int> input_ptr(in_ptr);
sycl::ext::intel::host_ptr<int> output_ptr(out_ptr);
intelfpga::lsu_body<
int, sycl::access::address_space::ext_intel_global_host_space>(
input_ptr, output_ptr);
Expand Down
25 changes: 13 additions & 12 deletions sycl/test/multi_ptr/ext_addr_spaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ int main() {
Q.submit([&](handler &CGH) {
accessor Acc{Buf, CGH, read_write};
CGH.single_task([=]() {
device_ptr<int, access::decorated::yes> MPtr1{Acc};
device_ptr<int, access::decorated::no> MPtr2{Acc};
device_ptr<int, access::decorated::legacy> MPtr3{Acc};
device_ptr<const int, access::decorated::yes> MPtr4{Acc};
device_ptr<const int, access::decorated::no> MPtr5{Acc};
device_ptr<const int, access::decorated::legacy> MPtr6{Acc};
device_ptr<void, access::decorated::yes> MPtr7{Acc};
device_ptr<void, access::decorated::no> MPtr8{Acc};
device_ptr<void, access::decorated::legacy> MPtr9{Acc};
device_ptr<const void, access::decorated::yes> MPtr10{Acc};
device_ptr<const void, access::decorated::no> MPtr11{Acc};
device_ptr<const void, access::decorated::legacy> MPtr12{Acc};
ext::intel::device_ptr<int, access::decorated::yes> MPtr1{Acc};
ext::intel::device_ptr<int, access::decorated::no> MPtr2{Acc};
ext::intel::device_ptr<int, access::decorated::legacy> MPtr3{Acc};
ext::intel::device_ptr<const int, access::decorated::yes> MPtr4{Acc};
ext::intel::device_ptr<const int, access::decorated::no> MPtr5{Acc};
ext::intel::device_ptr<const int, access::decorated::legacy> MPtr6{Acc};
ext::intel::device_ptr<void, access::decorated::yes> MPtr7{Acc};
ext::intel::device_ptr<void, access::decorated::no> MPtr8{Acc};
ext::intel::device_ptr<void, access::decorated::legacy> MPtr9{Acc};
ext::intel::device_ptr<const void, access::decorated::yes> MPtr10{Acc};
ext::intel::device_ptr<const void, access::decorated::no> MPtr11{Acc};
ext::intel::device_ptr<const void, access::decorated::legacy> MPtr12{
Acc};
});
}).wait_and_throw();
return 0;
Expand Down

0 comments on commit ec3d9ee

Please sign in to comment.