-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathInterpolate.cuh
54 lines (47 loc) · 1.07 KB
/
Interpolate.cuh
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
#pragma once
#include "Utils.cuh"
struct Interpolate1DEOp_t
{
_devonly float operator() (float a0) const
{
float idx0 = (a0 - minArg0) / resolution0 + offset;
return tex1D<float>(tbl, idx0);
}
cudaTextureObject_t tbl;
float minArg0;
float resolution0;
float offset;
};
struct Interpolate2DEOp_t
{
_devonly float operator() (float a0, float a1) const
{
float idx0 = (a0 - minArg0) / resolution0 + offset;
float idx1 = (a1 - minArg1) / resolution1 + offset;
return tex2D<float>(tbl, idx1, idx0);
}
cudaTextureObject_t tbl;
float minArg0;
float resolution0;
float minArg1;
float resolution1;
float offset;
};
struct Interpolate3DEOp_t
{
_devonly float operator() (float a0, float a1, float a2) const
{
float idx0 = (a0 - minArg0) / resolution0 + offset;
float idx1 = (a1 - minArg1) / resolution1 + offset;
float idx2 = (a2 - minArg2) / resolution2 + offset;
return tex3D<float>(tbl, idx2, idx1, idx0);
}
cudaTextureObject_t tbl;
float minArg0;
float resolution0;
float minArg1;
float resolution1;
float minArg2;
float resolution2;
float offset;
};