-
Notifications
You must be signed in to change notification settings - Fork 555
Expand file tree
/
Copy pathfast.cpp
More file actions
62 lines (51 loc) · 1.78 KB
/
Copy pathfast.cpp
File metadata and controls
62 lines (51 loc) · 1.78 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
/*******************************************************
* Copyright (c) 2014, 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 <Array.hpp>
#include <err_opencl.hpp>
#include <kernel/fast.hpp>
#include <af/dim4.hpp>
#include <af/features.h>
using af::dim4;
using af::features;
namespace arrayfire {
namespace opencl {
template<typename T>
unsigned fast(Array<float> &x_out, Array<float> &y_out, Array<float> &score_out,
const Array<T> &in, const float thr, const unsigned arc_length,
const bool non_max, const float feature_ratio,
const unsigned edge) {
unsigned nfeat;
Param x;
Param y;
Param score;
kernel::fast<T>(arc_length, &nfeat, x, y, score, in, thr, feature_ratio,
edge, non_max);
if (nfeat > 0) {
x_out = createParamArray<float>(x, true);
y_out = createParamArray<float>(y, true);
score_out = createParamArray<float>(score, true);
}
return nfeat;
}
#define INSTANTIATE(T) \
template unsigned fast<T>( \
Array<float> & x_out, Array<float> & y_out, Array<float> & score_out, \
const Array<T> &in, const float thr, const unsigned arc_length, \
const bool nonmax, const float feature_ratio, const unsigned edge);
INSTANTIATE(float)
INSTANTIATE(double)
INSTANTIATE(char)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(schar)
INSTANTIATE(uchar)
INSTANTIATE(short)
INSTANTIATE(ushort)
} // namespace opencl
} // namespace arrayfire