- 
                Notifications
    
You must be signed in to change notification settings  - Fork 794
 
[UR][SYCL] Implement USM prefetch from device to host in SYCL runtime and UR #19437
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
Changes from 25 commits
9ae0c55
              59ae777
              6e6fe08
              fb827be
              c42c233
              a5ed168
              41d9a6f
              742a636
              c160e42
              6654b6e
              7141dea
              96059fc
              b427472
              4f09c40
              e3b9e9e
              ba1f9f6
              294702c
              6dbf10a
              a2263f6
              1d16e60
              64bec80
              c3cfc1f
              0a45ea3
              0f4ed1f
              236f70b
              6de51cc
              16d40d9
              160af9d
              ddb53e5
              8de6a9a
              e601af9
              ebc89db
              b9e9fed
              514474d
              b074aa7
              2451609
              09e9a92
              152c1f5
              b81a531
              0fe0edf
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -12,6 +12,7 @@ | |
| 
     | 
||
| #include <sycl/detail/common.hpp> | ||
| #include <sycl/event.hpp> | ||
| #include <sycl/ext/oneapi/experimental/enqueue_types.hpp> | ||
| #include <sycl/ext/oneapi/experimental/graph.hpp> | ||
| #include <sycl/ext/oneapi/properties/properties.hpp> | ||
| #include <sycl/handler.hpp> | ||
| 
          
            
          
           | 
    @@ -369,15 +370,25 @@ void fill(sycl::queue Q, T *Ptr, const T &Pattern, size_t Count, | |
| CodeLoc); | ||
| } | ||
| 
     | 
||
| inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes) { | ||
| CGH.prefetch(Ptr, NumBytes); | ||
| inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes, | ||
| prefetch_type Type = prefetch_type::device) { | ||
| #ifdef __INTEL_PREVIEW_BREAKING_CHANGES | ||
                
       | 
||
| CGH.ext_oneapi_prefetch_exp(Ptr, NumBytes, Type); | ||
| #else | ||
| if (Type == prefetch_type::device) { | ||
| CGH.prefetch(Ptr, NumBytes); | ||
| } else { | ||
| CGH.ext_oneapi_prefetch_d2h(Ptr, NumBytes); | ||
| } | ||
| #endif | ||
| } | ||
| 
     | 
||
| inline void prefetch(queue Q, void *Ptr, size_t NumBytes, | ||
| prefetch_type Type = prefetch_type::device, | ||
| const sycl::detail::code_location &CodeLoc = | ||
| sycl::detail::code_location::current()) { | ||
| submit( | ||
| std::move(Q), [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes); }, | ||
| std::move(Q), [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes, Type); }, | ||
| CodeLoc); | ||
| } | ||
| 
     | 
||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //==--------------- enqueue_types.hpp ---- SYCL enqueue types --------------==// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| 
     | 
||
| #pragma once | ||
| 
     | 
||
| #include <string> | ||
| 
     | 
||
| namespace sycl { | ||
| inline namespace _V1 { | ||
| namespace ext::oneapi::experimental { | ||
| 
     | 
||
| /// @brief Indicates the destination device for USM data to be prefetched to. | ||
| enum class prefetch_type { device, host }; | ||
| 
     | 
||
| inline std::string prefetchTypeToString(prefetch_type value) { | ||
| switch (value) { | ||
| case sycl::ext::oneapi::experimental::prefetch_type::device: | ||
| return "prefetch_type::device"; | ||
| case sycl::ext::oneapi::experimental::prefetch_type::host: | ||
| return "prefetch_type::host"; | ||
| default: | ||
| return "prefetch_type::unknown"; | ||
| } | ||
| } | ||
| 
     | 
||
| } // namespace ext::oneapi::experimental | ||
| } // namespace _V1 | ||
| } // namespace sycl | 
Uh oh!
There was an error while loading. Please reload this page.