forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.cpp
More file actions
68 lines (56 loc) · 2.27 KB
/
index.cpp
File metadata and controls
68 lines (56 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************
* Copyright (c) 2015, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/array.h>
#include <af/index.h>
#include "symbol_manager.hpp"
af_err af_index(af_array* out, const af_array in, const unsigned ndims,
const af_seq* const index) {
CHECK_ARRAYS(in);
return CALL(out, in, ndims, index);
}
af_err af_lookup(af_array* out, const af_array in, const af_array indices,
const unsigned dim) {
CHECK_ARRAYS(in, indices);
return CALL(out, in, indices, dim);
}
af_err af_assign_seq(af_array* out, const af_array lhs, const unsigned ndims,
const af_seq* const indices, const af_array rhs) {
CHECK_ARRAYS(lhs, rhs);
return CALL(out, lhs, ndims, indices, rhs);
}
af_err af_index_gen(af_array* out, const af_array in, const dim_t ndims,
const af_index_t* indices) {
CHECK_ARRAYS(in);
return CALL(out, in, ndims, indices);
}
af_err af_assign_gen(af_array* out, const af_array lhs, const dim_t ndims,
const af_index_t* indices, const af_array rhs) {
CHECK_ARRAYS(lhs, rhs);
return CALL(out, lhs, ndims, indices, rhs);
}
af_seq af_make_seq(double begin, double end, double step) {
af_seq seq = {begin, end, step};
return seq;
}
af_err af_create_indexers(af_index_t** indexers) { return CALL(indexers); }
af_err af_set_array_indexer(af_index_t* indexer, const af_array idx,
const dim_t dim) {
CHECK_ARRAYS(idx);
return CALL(indexer, idx, dim);
}
af_err af_set_seq_indexer(af_index_t* indexer, const af_seq* idx,
const dim_t dim, const bool is_batch) {
return CALL(indexer, idx, dim, is_batch);
}
af_err af_set_seq_param_indexer(af_index_t* indexer, const double begin,
const double end, const double step,
const dim_t dim, const bool is_batch) {
return CALL(indexer, begin, end, step, dim, is_batch);
}
af_err af_release_indexers(af_index_t* indexers) { return CALL(indexers); }