Virtual Testbed
Ship dynamics simulator for extreme conditions
src
vtestbed
opencl
opencl/derivative.hh
1
#ifndef VTESTBED_OPENCL_DERIVATIVE_HH
2
#define VTESTBED_OPENCL_DERIVATIVE_HH
3
4
#include <fstream>
5
#include <sstream>
6
7
#include <vtestbed/base/blitz.hh>
8
#include <vtestbed/core/grid.hh>
9
#include <vtestbed/core/types.hh>
10
#include <vtestbed/opencl/opencl.hh>
11
#include <vtestbed/opencl/pipeline.hh>
12
13
namespace
vtb
{
14
15
namespace
opencl {
16
17
template
<
class
T,
int
N>
18
class
Derivative
:
public
Context_base
{
19
20
public
:
21
using
grid_type
=
vtb::core::Grid<T,N>
;
22
using
buffer_type
=
Buffer<T>
;
23
24
private
:
25
clx::kernel _derivative, _local_derivative;
26
27
public
:
28
using
Context_base::context;
29
30
void
context(
Context
* rhs)
override
;
31
32
void
solve(
const
buffer_type
& func,
33
const
grid_type
& grid,
34
int
dimension,
35
buffer_type
& result);
36
37
inline
void
operator()(
38
const
buffer_type
& func,
39
const
grid_type
& grid,
40
int
dimension,
41
buffer_type
& result
42
) { this->solve(func, grid, dimension, result); }
43
44
};
45
46
}
47
48
}
49
50
#endif // vim:filetype=cpp
vtb::opencl::Derivative
Definition:
opencl/derivative.hh:18
vtb::opencl::Buffer
Definition:
pipeline.hh:37
vtb::core::Grid
A region defined by start and end index and lower and upper bound for each dimension.
Definition:
core/grid.hh:25
vtb::opencl::Context_base
Definition:
opencl.hh:94
vtb
Main namespace.
Definition:
convert.hh:9
vtb::opencl::Context
Definition:
opencl.hh:30
Generated by
1.8.15