21 #ifndef BT_GPU_DEFINES_H
22 #define BT_GPU_DEFINES_H
57 #define BT_GPU___device__ inline
58 #define BT_GPU___devdata__
59 #define BT_GPU___constant__
60 #define BT_GPU_max(a, b) ((a) > (b) ? (a) : (b))
61 #define BT_GPU_min(a, b) ((a) < (b) ? (a) : (b))
62 #define BT_GPU_params s3DGridBroadphaseParams
63 #define BT_GPU___mul24(a, b) ((a)*(b))
64 #define BT_GPU___global__ inline
65 #define BT_GPU___shared__ static
66 #define BT_GPU___syncthreads()
67 #define CUDART_PI_F SIMD_PI
71 uint2 t; t.
x = x; t.
y = y;
return t;
73 #define BT_GPU_make_uint2(x, y) bt3dGrid_make_uint2(x, y)
77 int3 t; t.
x = x; t.
y = y; t.
z = z;
return t;
79 #define BT_GPU_make_int3(x, y, z) bt3dGrid_make_int3(x, y, z)
83 float3 t; t.
x = x; t.
y = y; t.
z = z;
return t;
85 #define BT_GPU_make_float3(x, y, z) bt3dGrid_make_float3(x, y, z)
91 #define BT_GPU_make_float34(f) bt3dGrid_make_float34(f)
97 #define BT_GPU_make_float31(x) bt3dGrid_make_float31(x)
101 float4 t; t.
x = v.
x; t.
y = v.
y; t.
z = v.
z; t.
w = f;
return t;
103 #define BT_GPU_make_float42(a, b) bt3dGrid_make_float42(a, b)
107 float4 t; t.
x = a; t.
y = b; t.
z = c; t.
w = d;
return t;
109 #define BT_GPU_make_float44(a, b, c, d) bt3dGrid_make_float44(a, b, c, d)
122 float4 r; r.
x = a.
x*fact; r.
y = a.
y*fact; r.
z = a.
z*fact; r.
w = a.
w*fact;
return r;
149 return a.
x*b.
x+a.
y*b.
y+a.
z*b.
z;
151 #define BT_GPU_dot(a,b) bt3dGrid_dot(a,b)
155 return a.
x*b.
x+a.
y*b.
y+a.
z*b.
z+a.
w*b.
w;
157 #define BT_GPU_dot4(a,b) bt3dGrid_dot4(a,b)
163 #define BT_GPU_cross(a,b) bt3dGrid_cross(a,b)
168 float3 r; r.
x = a.
x*fact; r.
y = a.
y*fact; r.
z = a.
z*fact;
return r;
193 #define BT_GPU_FETCH(a, b) a[b]
194 #define BT_GPU_FETCH4(a, b) a[b]
195 #define BT_GPU_PREF(func) btGpu_##func
196 #define BT_GPU_SAFE_CALL(func) func
197 #define BT_GPU_Memset memset
198 #define BT_GPU_MemcpyToSymbol(a, b, c) memcpy(&a, b, c)
199 #define BT_GPU_BindTexture(a, b, c, d)
200 #define BT_GPU_UnbindTexture(a)
203 #define BT_GPU_blockIdx s_blockIdx
204 #define BT_GPU_blockDim s_blockDim
205 #define BT_GPU_threadIdx s_threadIdx
206 #define BT_GPU_EXECKERNEL(numb, numt, kfunc, args) {s_blockDim.x=numt;for(int nb=0;nb<numb;nb++){s_blockIdx.x=nb;for(int nt=0;nt<numt;nt++){s_threadIdx.x=nt;kfunc args;}}}
208 #define BT_GPU_CHECK_ERROR(s)
211 #endif //BT_GPU_DEFINES_H
float4 operator*(const float4 &a, float fact)
static float3 bt3dGrid_make_float3(float x, float y, float z)
static uint2 bt3dGrid_make_uint2(unsigned int x, unsigned int y)
static float3 bt3dGrid_make_float31(float f)
float3 & operator-=(float3 &a, const float3 &b)
static int3 bt3dGrid_make_int3(int x, int y, int z)
static float3 bt3dGrid_cross(const float3 &a, const float3 &b)
int3 operator+(int3 a, int3 b)
float4 & operator+=(float4 &a, const float4 &b)
static float4 bt3dGrid_make_float44(float a, float b, float c, float d)
static float4 bt3dGrid_make_float42(float3 v, float f)
float4 & operator*=(float4 &a, float fact)
static float bt3dGrid_dot4(float4 &a, float4 &b)
static float bt3dGrid_dot(float3 &a, float3 &b)
float3 operator-(const float3 &a, const float3 &b)
static float3 bt3dGrid_make_float34(float4 f)