-
Notifications
You must be signed in to change notification settings - Fork 19
/
float3Overloads.cuh
45 lines (30 loc) · 1.72 KB
/
float3Overloads.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
#ifndef __FLOAT3OVERLOADS_CUH__
#define __FLOAT3OVERLOADS_CUH__
#include <cuda.h>
// --- Sum between two real three dimensional vectors
__host__ __device__ float3 operator+(const float3 &a, const float3 &b);
// --- Difference between two real three dimensional vectors
__host__ __device__ float3 operator-(const float3 &a, const float3 &b);
// --- Identity
__host__ __device__ float3 operator+(const float3 &a);
// --- Opposite of a real three dimensional vector
__host__ __device__ float3 operator-(const float3 &a);
// --- Elementwise multiplication between two real three dimensional vectors
__host__ __device__ float3 operator*(const float3 &a, const float3 &b);
// --- Multiplication between a real scalar and a real three dimensional vector
__host__ __device__ float3 operator*(const float a, const float3 &b);
// --- Multiplication between a real three dimensional vector and a scalar
__host__ __device__ float3 operator*(const float3 &a, const float b);
// --- Elementwise division between two real three dimensional vectors
__host__ __device__ float3 operator/(const float3 &a, const float3 &b);
// --- Scalar product between two real three dimensional vectors
__host__ __device__ float dot(const float3 &a, const float3 &b);
// --- Vector product between two real three dimensional vectors
__host__ __device__ float3 cross(const float3 &a, const float3 &b);
// --- Normalize a real three dimensional vector
__host__ __device__ float3 normalize(const float3 &a);
// --- Norm of a real three dimensional vector
__host__ __device__ float norm(const float3 &a);
// --- Distance between two real three dimensional vectors
__host__ __device__ float dist(const float3 &a, const float3 &b);
#endif