alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
MemcpyKind.hpp
Go to the documentation of this file.
1/* Copyright 2024 René Widera
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
11
12#include <cstdint>
13
14namespace alpaka::onHost
15{
17 {
18 template<typename T_ApiInterface, typename T_Dest, typename T_Source>
20 {
21 static_assert(sizeof(T_Dest) && false, "Not supported memcpy kind.");
22 };
23
24 template<typename T_ApiInterface, alpaka::concepts::UnifiedCudaHipApi T_Source>
25 struct MemcpyKind<T_ApiInterface, api::Host, T_Source>
26 {
27 static constexpr auto kind = T_ApiInterface::memcpyDeviceToHost;
28 };
29
30 template<typename T_ApiInterface, alpaka::concepts::UnifiedCudaHipApi T_SourceDestApi>
31 struct MemcpyKind<T_ApiInterface, T_SourceDestApi, T_SourceDestApi>
32 {
33 static constexpr auto kind = T_ApiInterface::memcpyDeviceToDevice;
34 };
35
36 template<typename T_ApiInterface>
37 struct MemcpyKind<T_ApiInterface, api::Host, api::Host>
38 {
39 static constexpr auto kind = T_ApiInterface::memcpyHostToHost;
40 };
41
42 template<typename T_ApiInterface, alpaka::concepts::UnifiedCudaHipApi T_Dest>
43 struct MemcpyKind<T_ApiInterface, T_Dest, api::Host>
44 {
45 static constexpr auto kind = T_ApiInterface::memcpyHostToDevice;
46 };
47 } // namespace unifiedCudaHip
48} // namespace alpaka::onHost
Functionality which is usable on the host CPU controller thread.
Definition api.hpp:40