forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgradient.cpp
More file actions
35 lines (29 loc) · 982 Bytes
/
gradient.cpp
File metadata and controls
35 lines (29 loc) · 982 Bytes
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
/*******************************************************
* 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_cpu.hpp>
#include <gradient.hpp>
#include <kernel/gradient.hpp>
#include <math.hpp>
#include <platform.hpp>
#include <queue.hpp>
#include <stdexcept>
namespace cpu {
template<typename T>
void gradient(Array<T> &grad0, Array<T> &grad1, const Array<T> &in) {
getQueue().enqueue(kernel::gradient<T>, grad0, grad1, in);
}
#define INSTANTIATE(T) \
template void gradient<T>(Array<T> & grad0, Array<T> & grad1, \
const Array<T> &in);
INSTANTIATE(float)
INSTANTIATE(double)
INSTANTIATE(cfloat)
INSTANTIATE(cdouble)
} // namespace cpu