uvm_array_op.h 660 Bytes
Newer Older
1
/*!
2
3
 *  Copyright (c) 2019-2022 by Contributors
 * \file array/uvm_array_op.h
4
5
6
7
8
9
 * \brief Array operator templates
 */
#ifndef DGL_ARRAY_UVM_ARRAY_OP_H_
#define DGL_ARRAY_UVM_ARRAY_OP_H_

#include <dgl/array.h>
10

11
12
13
14
15
16
17
18
19
20
#include <utility>

namespace dgl {
namespace aten {
namespace impl {

// Take CPU array and GPU index, and then index with GPU.
template <typename DType, typename IdType>
NDArray IndexSelectCPUFromGPU(NDArray array, IdArray index);

21
22
23
template <typename DType, typename IdType>
void IndexScatterGPUToCPU(NDArray dest, IdArray index, NDArray source);

24
25
26
27
28
}  // namespace impl
}  // namespace aten
}  // namespace dgl

#endif  // DGL_ARRAY_UVM_ARRAY_OP_H_