DPC++ Runtime
Runtime libraries for oneAPI DPC++
pi_hip.hpp
Go to the documentation of this file.
1 //===-- pi_hip.hpp - HIP Plugin -------------------------------------------===//
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 
11 
17 
18 #ifndef PI_HIP_HPP
19 #define PI_HIP_HPP
20 
21 // This version should be incremented for any change made to this file or its
22 // corresponding .cpp file.
23 #define _PI_HIP_PLUGIN_VERSION 1
24 
25 #define _PI_HIP_PLUGIN_VERSION_STRING \
26  _PI_PLUGIN_VERSION_STRING(_PI_HIP_PLUGIN_VERSION)
27 
28 #include "sycl/detail/pi.h"
29 #include <array>
30 #include <atomic>
31 #include <cassert>
32 #include <cstring>
33 #include <functional>
34 #include <hip/hip_runtime.h>
35 #include <limits>
36 #include <mutex>
37 #include <numeric>
38 #include <stdint.h>
39 #include <string>
40 #include <vector>
41 
42 #include <adapters/hip/command_buffer.hpp>
43 #include <adapters/hip/context.hpp>
44 #include <adapters/hip/device.hpp>
45 #include <adapters/hip/event.hpp>
46 #include <adapters/hip/kernel.hpp>
47 #include <adapters/hip/memory.hpp>
48 #include <adapters/hip/platform.hpp>
49 #include <adapters/hip/program.hpp>
50 #include <adapters/hip/queue.hpp>
51 #include <adapters/hip/sampler.hpp>
52 
53 #include "pi2ur.hpp"
54 
55 using _pi_stream_guard = std::unique_lock<std::mutex>;
56 
58  using ur_platform_handle_t_::ur_platform_handle_t_;
59 };
60 
62  using ur_device_handle_t_::ur_device_handle_t_;
63 };
64 
66  using ur_context_handle_t_::ur_context_handle_t_;
67 };
68 
69 struct _pi_mem : ur_mem_handle_t_ {
70  using ur_mem_handle_t_::ur_mem_handle_t_;
71 };
72 
74  using ur_queue_handle_t_::ur_queue_handle_t_;
75 };
76 
78  using ur_event_handle_t_::ur_event_handle_t_;
79 };
80 
82  using ur_program_handle_t_::ur_program_handle_t_;
83 };
84 
86  using ur_kernel_handle_t_::ur_kernel_handle_t_;
87 };
88 
90  using ur_sampler_handle_t_::ur_sampler_handle_t_;
91 };
92 
94  using ur_exp_command_buffer_handle_t_::ur_exp_command_buffer_handle_t_;
95 };
96 
97 #endif // PI_HIP_HPP
std::unique_lock< std::mutex > _pi_stream_guard
Definition: pi_cuda.hpp:42