DPC++ Runtime
Runtime libraries for oneAPI DPC++
utils.hpp
Go to the documentation of this file.
1 //===------- utils.hpp - SYCL matrix extension ----*- C++ -*------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 // ===--------------------------------------------------------------------=== //
8 
9 #pragma once
10 
11 #include <sycl/access/access.hpp>
12 #include <sycl/multi_ptr.hpp>
13 
14 namespace sycl {
15 inline namespace _V1 {
16 namespace detail {
17 
18 // Helper to return decorated pointer for different values
19 // of access::decorated parameter.
20 // If access::decorated::legacy is removed in the future
21 // this helper usage can be replaced with ptr.get_decorated().
22 template <typename DecorT, typename T, access::address_space Space,
23  access::decorated IsDecorated>
25  if constexpr (IsDecorated == access::decorated::legacy)
26  return ptr.get();
27  else
28  return ptr.get_decorated();
29 }
30 
31 } // namespace detail
32 } // namespace _V1
33 } // namespace sycl
DecorT * getDecorated(multi_ptr< T, Space, IsDecorated > ptr)
Definition: utils.hpp:24
Definition: access.hpp:18