26 #include "cuda_runtime.h"
38 inline float fminf(
float a,
float b)
43 inline float fmaxf(
float a,
float b)
48 inline int max(
int a,
int b)
53 inline int min(
int a,
int b)
60 return 1.0f / sqrtf(x);
133 return make_float3(
float(a.x),
float(a.y),
float(a.z));
137 return make_float3(
float(a.x),
float(a.y),
float(a.z));
148 inline __host__ __device__ int3
make_int3(int2 a,
int s)
154 return make_int3(
int(a.x),
int(a.y),
int(a.z));
158 return make_int3(
int(a.x),
int(a.y),
int(a.z));
196 return make_float4(
float(a.x),
float(a.y),
float(a.z),
float(a.w));
200 return make_float4(
float(a.x),
float(a.y),
float(a.z),
float(a.w));
211 inline __host__ __device__ int4
make_int4(int3 a,
int w)
217 return make_int4(
int(a.x),
int(a.y),
int(a.z),
int(a.w));
221 return make_int4(
int(a.x),
int(a.y),
int(a.z),
int(a.w));
268 return make_int4(-a.x, -a.y, -a.z, -a.w);
275 inline __host__ __device__ float2
operator+(float2 a, float2 b)
279 inline __host__ __device__
void operator+=(float2 &a, float2 b)
281 a.x += b.x; a.y += b.y;
283 inline __host__ __device__ float2
operator+(float2 a,
float b)
287 inline __host__ __device__ float2
operator+(
float b, float2 a)
291 inline __host__ __device__
void operator+=(float2 &a,
float b)
296 inline __host__ __device__ int2
operator+(int2 a, int2 b)
302 a.x += b.x; a.y += b.y;
304 inline __host__ __device__ int2
operator+(int2 a,
int b)
308 inline __host__ __device__ int2
operator+(
int b, int2 a)
317 inline __host__ __device__ uint2
operator+(uint2 a, uint2 b)
321 inline __host__ __device__
void operator+=(uint2 &a, uint2 b)
323 a.x += b.x; a.y += b.y;
339 inline __host__ __device__ float3
operator+(float3 a, float3 b)
341 return make_float3(a.x + b.x, a.y + b.y, a.z + b.z);
343 inline __host__ __device__
void operator+=(float3 &a, float3 b)
345 a.x += b.x; a.y += b.y; a.z += b.z;
347 inline __host__ __device__ float3
operator+(float3 a,
float b)
351 inline __host__ __device__
void operator+=(float3 &a,
float b)
353 a.x += b; a.y += b; a.z += b;
356 inline __host__ __device__ int3
operator+(int3 a, int3 b)
358 return make_int3(a.x + b.x, a.y + b.y, a.z + b.z);
362 a.x += b.x; a.y += b.y; a.z += b.z;
364 inline __host__ __device__ int3
operator+(int3 a,
int b)
366 return make_int3(a.x + b, a.y + b, a.z + b);
370 a.x += b; a.y += b; a.z += b;
373 inline __host__ __device__ uint3
operator+(uint3 a, uint3 b)
375 return make_uint3(a.x + b.x, a.y + b.y, a.z + b.z);
377 inline __host__ __device__
void operator+=(uint3 &a, uint3 b)
379 a.x += b.x; a.y += b.y; a.z += b.z;
387 a.x += b; a.y += b; a.z += b;
390 inline __host__ __device__ int3
operator+(
int b, int3 a)
392 return make_int3(a.x + b, a.y + b, a.z + b);
398 inline __host__ __device__ float3
operator+(
float b, float3 a)
403 inline __host__ __device__ float4
operator+(float4 a, float4 b)
405 return make_float4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
407 inline __host__ __device__
void operator+=(float4 &a, float4 b)
409 a.x += b.x; a.y += b.y; a.z += b.z; a.w += b.w;
411 inline __host__ __device__ float4
operator+(float4 a,
float b)
413 return make_float4(a.x + b, a.y + b, a.z + b, a.w + b);
415 inline __host__ __device__ float4
operator+(
float b, float4 a)
417 return make_float4(a.x + b, a.y + b, a.z + b, a.w + b);
419 inline __host__ __device__
void operator+=(float4 &a,
float b)
421 a.x += b; a.y += b; a.z += b; a.w += b;
424 inline __host__ __device__ int4
operator+(int4 a, int4 b)
426 return make_int4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
430 a.x += b.x; a.y += b.y; a.z += b.z; a.w += b.w;
432 inline __host__ __device__ int4
operator+(int4 a,
int b)
434 return make_int4(a.x + b, a.y + b, a.z + b, a.w + b);
436 inline __host__ __device__ int4
operator+(
int b, int4 a)
438 return make_int4(a.x + b, a.y + b, a.z + b, a.w + b);
442 a.x += b; a.y += b; a.z += b; a.w += b;
445 inline __host__ __device__ uint4
operator+(uint4 a, uint4 b)
447 return make_uint4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
449 inline __host__ __device__
void operator+=(uint4 &a, uint4 b)
451 a.x += b.x; a.y += b.y; a.z += b.z; a.w += b.w;
455 return make_uint4(a.x + b, a.y + b, a.z + b, a.w + b);
459 return make_uint4(a.x + b, a.y + b, a.z + b, a.w + b);
463 a.x += b; a.y += b; a.z += b; a.w += b;
470 inline __host__ __device__ float2
operator-(float2 a, float2 b)
474 inline __host__ __device__
void operator-=(float2 &a, float2 b)
476 a.x -= b.x; a.y -= b.y;
478 inline __host__ __device__ float2
operator-(float2 a,
float b)
482 inline __host__ __device__ float2
operator-(
float b, float2 a)
486 inline __host__ __device__
void operator-=(float2 &a,
float b)
491 inline __host__ __device__ int2
operator-(int2 a, int2 b)
497 a.x -= b.x; a.y -= b.y;
499 inline __host__ __device__ int2
operator-(int2 a,
int b)
503 inline __host__ __device__ int2
operator-(
int b, int2 a)
512 inline __host__ __device__ uint2
operator-(uint2 a, uint2 b)
516 inline __host__ __device__
void operator-=(uint2 &a, uint2 b)
518 a.x -= b.x; a.y -= b.y;
533 inline __host__ __device__ float3
operator-(float3 a, float3 b)
535 return make_float3(a.x - b.x, a.y - b.y, a.z - b.z);
537 inline __host__ __device__
void operator-=(float3 &a, float3 b)
539 a.x -= b.x; a.y -= b.y; a.z -= b.z;
541 inline __host__ __device__ float3
operator-(float3 a,
float b)
545 inline __host__ __device__ float3
operator-(
float b, float3 a)
549 inline __host__ __device__
void operator-=(float3 &a,
float b)
551 a.x -= b; a.y -= b; a.z -= b;
554 inline __host__ __device__ int3
operator-(int3 a, int3 b)
556 return make_int3(a.x - b.x, a.y - b.y, a.z - b.z);
560 a.x -= b.x; a.y -= b.y; a.z -= b.z;
562 inline __host__ __device__ int3
operator-(int3 a,
int b)
564 return make_int3(a.x - b, a.y - b, a.z - b);
566 inline __host__ __device__ int3
operator-(
int b, int3 a)
568 return make_int3(b - a.x, b - a.y, b - a.z);
572 a.x -= b; a.y -= b; a.z -= b;
575 inline __host__ __device__ uint3
operator-(uint3 a, uint3 b)
577 return make_uint3(a.x - b.x, a.y - b.y, a.z - b.z);
579 inline __host__ __device__
void operator-=(uint3 &a, uint3 b)
581 a.x -= b.x; a.y -= b.y; a.z -= b.z;
593 a.x -= b; a.y -= b; a.z -= b;
596 inline __host__ __device__ float4
operator-(float4 a, float4 b)
598 return make_float4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
600 inline __host__ __device__
void operator-=(float4 &a, float4 b)
602 a.x -= b.x; a.y -= b.y; a.z -= b.z; a.w -= b.w;
604 inline __host__ __device__ float4
operator-(float4 a,
float b)
606 return make_float4(a.x - b, a.y - b, a.z - b, a.w - b);
608 inline __host__ __device__
void operator-=(float4 &a,
float b)
610 a.x -= b; a.y -= b; a.z -= b; a.w -= b;
613 inline __host__ __device__ int4
operator-(int4 a, int4 b)
615 return make_int4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
619 a.x -= b.x; a.y -= b.y; a.z -= b.z; a.w -= b.w;
621 inline __host__ __device__ int4
operator-(int4 a,
int b)
623 return make_int4(a.x - b, a.y - b, a.z - b, a.w - b);
625 inline __host__ __device__ int4
operator-(
int b, int4 a)
627 return make_int4(b - a.x, b - a.y, b - a.z, b - a.w);
631 a.x -= b; a.y -= b; a.z -= b; a.w -= b;
634 inline __host__ __device__ uint4
operator-(uint4 a, uint4 b)
636 return make_uint4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
638 inline __host__ __device__
void operator-=(uint4 &a, uint4 b)
640 a.x -= b.x; a.y -= b.y; a.z -= b.z; a.w -= b.w;
644 return make_uint4(a.x - b, a.y - b, a.z - b, a.w - b);
648 return make_uint4(b - a.x, b - a.y, b - a.z, b - a.w);
652 a.x -= b; a.y -= b; a.z -= b; a.w -= b;
659 inline __host__ __device__ float2
operator*(float2 a, float2 b)
663 inline __host__ __device__
void operator*=(float2 &a, float2 b)
665 a.x *= b.x; a.y *= b.y;
667 inline __host__ __device__ float2
operator*(float2 a,
float b)
671 inline __host__ __device__ float2
operator*(
float b, float2 a)
675 inline __host__ __device__
void operator*=(float2 &a,
float b)
680 inline __host__ __device__ int2
operator*(int2 a, int2 b)
686 a.x *= b.x; a.y *= b.y;
688 inline __host__ __device__ int2
operator*(int2 a,
int b)
692 inline __host__ __device__ int2
operator*(
int b, int2 a)
701 inline __host__ __device__ uint2
operator*(uint2 a, uint2 b)
705 inline __host__ __device__
void operator*=(uint2 &a, uint2 b)
707 a.x *= b.x; a.y *= b.y;
722 inline __host__ __device__ float3
operator*(float3 a, float3 b)
724 return make_float3(a.x * b.x, a.y * b.y, a.z * b.z);
726 inline __host__ __device__
void operator*=(float3 &a, float3 b)
728 a.x *= b.x; a.y *= b.y; a.z *= b.z;
730 inline __host__ __device__ float3
operator*(float3 a,
float b)
734 inline __host__ __device__ float3
operator*(
float b, float3 a)
738 inline __host__ __device__
void operator*=(float3 &a,
float b)
740 a.x *= b; a.y *= b; a.z *= b;
743 inline __host__ __device__ int3
operator*(int3 a, int3 b)
745 return make_int3(a.x * b.x, a.y * b.y, a.z * b.z);
749 a.x *= b.x; a.y *= b.y; a.z *= b.z;
751 inline __host__ __device__ int3
operator*(int3 a,
int b)
753 return make_int3(a.x * b, a.y * b, a.z * b);
755 inline __host__ __device__ int3
operator*(
int b, int3 a)
757 return make_int3(b * a.x, b * a.y, b * a.z);
761 a.x *= b; a.y *= b; a.z *= b;
764 inline __host__ __device__ uint3
operator*(uint3 a, uint3 b)
766 return make_uint3(a.x * b.x, a.y * b.y, a.z * b.z);
768 inline __host__ __device__
void operator*=(uint3 &a, uint3 b)
770 a.x *= b.x; a.y *= b.y; a.z *= b.z;
782 a.x *= b; a.y *= b; a.z *= b;
785 inline __host__ __device__ float4
operator*(float4 a, float4 b)
787 return make_float4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
789 inline __host__ __device__
void operator*=(float4 &a, float4 b)
791 a.x *= b.x; a.y *= b.y; a.z *= b.z; a.w *= b.w;
793 inline __host__ __device__ float4
operator*(float4 a,
float b)
795 return make_float4(a.x * b, a.y * b, a.z * b, a.w * b);
797 inline __host__ __device__ float4
operator*(
float b, float4 a)
799 return make_float4(b * a.x, b * a.y, b * a.z, b * a.w);
801 inline __host__ __device__
void operator*=(float4 &a,
float b)
803 a.x *= b; a.y *= b; a.z *= b; a.w *= b;
806 inline __host__ __device__ int4
operator*(int4 a, int4 b)
808 return make_int4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
812 a.x *= b.x; a.y *= b.y; a.z *= b.z; a.w *= b.w;
814 inline __host__ __device__ int4
operator*(int4 a,
int b)
816 return make_int4(a.x * b, a.y * b, a.z * b, a.w * b);
818 inline __host__ __device__ int4
operator*(
int b, int4 a)
820 return make_int4(b * a.x, b * a.y, b * a.z, b * a.w);
824 a.x *= b; a.y *= b; a.z *= b; a.w *= b;
827 inline __host__ __device__ uint4
operator*(uint4 a, uint4 b)
829 return make_uint4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
831 inline __host__ __device__
void operator*=(uint4 &a, uint4 b)
833 a.x *= b.x; a.y *= b.y; a.z *= b.z; a.w *= b.w;
837 return make_uint4(a.x * b, a.y * b, a.z * b, a.w * b);
841 return make_uint4(b * a.x, b * a.y, b * a.z, b * a.w);
845 a.x *= b; a.y *= b; a.z *= b; a.w *= b;
852 inline __host__ __device__ float2
operator/(float2 a, float2 b)
856 inline __host__ __device__
void operator/=(float2 &a, float2 b)
858 a.x /= b.x; a.y /= b.y;
860 inline __host__ __device__ float2
operator/(float2 a,
float b)
864 inline __host__ __device__
void operator/=(float2 &a,
float b)
868 inline __host__ __device__ float2
operator/(
float b, float2 a)
873 inline __host__ __device__ float3
operator/(float3 a, float3 b)
875 return make_float3(a.x / b.x, a.y / b.y, a.z / b.z);
877 inline __host__ __device__
void operator/=(float3 &a, float3 b)
879 a.x /= b.x; a.y /= b.y; a.z /= b.z;
881 inline __host__ __device__ float3
operator/(float3 a,
float b)
885 inline __host__ __device__
void operator/=(float3 &a,
float b)
887 a.x /= b; a.y /= b; a.z /= b;
889 inline __host__ __device__ float3
operator/(
float b, float3 a)
894 inline __host__ __device__ float4
operator/(float4 a, float4 b)
896 return make_float4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
898 inline __host__ __device__
void operator/=(float4 &a, float4 b)
900 a.x /= b.x; a.y /= b.y; a.z /= b.z; a.w /= b.w;
902 inline __host__ __device__ float4
operator/(float4 a,
float b)
904 return make_float4(a.x / b, a.y / b, a.z / b, a.w / b);
906 inline __host__ __device__
void operator/=(float4 &a,
float b)
908 a.x /= b; a.y /= b; a.z /= b; a.w /= b;
910 inline __host__ __device__ float4
operator/(
float b, float4 a){
911 return make_float4(b / a.x, b / a.y, b / a.z, b / a.w);
918 inline __host__ __device__ float2
fminf(float2 a, float2 b)
922 inline __host__ __device__ float3
fminf(float3 a, float3 b)
926 inline __host__ __device__ float4
fminf(float4 a, float4 b)
931 inline __host__ __device__ int2
min(int2 a, int2 b)
935 inline __host__ __device__ int3
min(int3 a, int3 b)
939 inline __host__ __device__ int4
min(int4 a, int4 b)
944 inline __host__ __device__ uint2
min(uint2 a, uint2 b)
948 inline __host__ __device__ uint3
min(uint3 a, uint3 b)
952 inline __host__ __device__ uint4
min(uint4 a, uint4 b)
961 inline __host__ __device__ float2
fmaxf(float2 a, float2 b)
965 inline __host__ __device__ float3
fmaxf(float3 a, float3 b)
969 inline __host__ __device__ float4
fmaxf(float4 a, float4 b)
974 inline __host__ __device__ int2
max(int2 a, int2 b)
978 inline __host__ __device__ int3
max(int3 a, int3 b)
982 inline __host__ __device__ int4
max(int4 a, int4 b)
987 inline __host__ __device__ uint2
max(uint2 a, uint2 b)
991 inline __host__ __device__ uint3
max(uint3 a, uint3 b)
995 inline __host__ __device__ uint4
max(uint4 a, uint4 b)
1005 inline __device__ __host__
float lerp(
float a,
float b,
float t)
1009 inline __device__ __host__ float2
lerp(float2 a, float2 b,
float t)
1013 inline __device__ __host__ float3
lerp(float3 a, float3 b,
float t)
1017 inline __device__ __host__ float4
lerp(float4 a, float4 b,
float t)
1027 inline __device__ __host__
float clamp(
float f,
float a,
float b)
1031 inline __device__ __host__
int clamp(
int f,
int a,
int b)
1033 return max(a,
min(f, b));
1037 return max(a,
min(f, b));
1040 inline __device__ __host__ float2
clamp(float2 v,
float a,
float b)
1044 inline __device__ __host__ float2
clamp(float2 v, float2 a, float2 b)
1048 inline __device__ __host__ float3
clamp(float3 v,
float a,
float b)
1052 inline __device__ __host__ float3
clamp(float3 v, float3 a, float3 b)
1056 inline __device__ __host__ float4
clamp(float4 v,
float a,
float b)
1058 return make_float4(
clamp(v.x, a, b),
clamp(v.y, a, b),
clamp(v.z, a, b),
clamp(v.w, a, b));
1060 inline __device__ __host__ float4
clamp(float4 v, float4 a, float4 b)
1062 return make_float4(
clamp(v.x, a.x, b.x),
clamp(v.y, a.y, b.y),
clamp(v.z, a.z, b.z),
clamp(v.w, a.w, b.w));
1065 inline __device__ __host__ int2
clamp(int2 v,
int a,
int b)
1069 inline __device__ __host__ int2
clamp(int2 v, int2 a, int2 b)
1073 inline __device__ __host__ int3
clamp(int3 v,
int a,
int b)
1077 inline __device__ __host__ int3
clamp(int3 v, int3 a, int3 b)
1081 inline __device__ __host__ int4
clamp(int4 v,
int a,
int b)
1083 return make_int4(
clamp(v.x, a, b),
clamp(v.y, a, b),
clamp(v.z, a, b),
clamp(v.w, a, b));
1085 inline __device__ __host__ int4
clamp(int4 v, int4 a, int4 b)
1087 return make_int4(
clamp(v.x, a.x, b.x),
clamp(v.y, a.y, b.y),
clamp(v.z, a.z, b.z),
clamp(v.w, a.w, b.w));
1094 inline __device__ __host__ uint2
clamp(uint2 v, uint2 a, uint2 b)
1102 inline __device__ __host__ uint3
clamp(uint3 v, uint3 a, uint3 b)
1108 return make_uint4(
clamp(v.x, a, b),
clamp(v.y, a, b),
clamp(v.z, a, b),
clamp(v.w, a, b));
1110 inline __device__ __host__ uint4
clamp(uint4 v, uint4 a, uint4 b)
1112 return make_uint4(
clamp(v.x, a.x, b.x),
clamp(v.y, a.y, b.y),
clamp(v.z, a.z, b.z),
clamp(v.w, a.w, b.w));
1119 inline __host__ __device__
float dot(float2 a, float2 b)
1121 return a.x * b.x + a.y * b.y;
1123 inline __host__ __device__
float dot(float3 a, float3 b)
1125 return a.x * b.x + a.y * b.y + a.z * b.z;
1127 inline __host__ __device__
float dot(float4 a, float4 b)
1129 return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
1132 inline __host__ __device__
int dot(int2 a, int2 b)
1134 return a.x * b.x + a.y * b.y;
1136 inline __host__ __device__
int dot(int3 a, int3 b)
1138 return a.x * b.x + a.y * b.y + a.z * b.z;
1140 inline __host__ __device__
int dot(int4 a, int4 b)
1142 return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
1145 inline __host__ __device__
uint dot(uint2 a, uint2 b)
1147 return a.x * b.x + a.y * b.y;
1149 inline __host__ __device__
uint dot(uint3 a, uint3 b)
1151 return a.x * b.x + a.y * b.y + a.z * b.z;
1153 inline __host__ __device__
uint dot(uint4 a, uint4 b)
1155 return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
1162 inline __host__ __device__
float length(float2 v)
1164 return sqrtf(
dot(v, v));
1166 inline __host__ __device__
float length(float3 v)
1168 return sqrtf(
dot(v, v));
1170 inline __host__ __device__
float length(float4 v)
1172 return sqrtf(
dot(v, v));
1199 inline __host__ __device__ float2
floorf(float2 v)
1203 inline __host__ __device__ float3
floorf(float3 v)
1207 inline __host__ __device__ float4
floorf(float4 v)
1216 inline __host__ __device__
float fracf(
float v)
1220 inline __host__ __device__ float2
fracf(float2 v)
1224 inline __host__ __device__ float3
fracf(float3 v)
1228 inline __host__ __device__ float4
fracf(float4 v)
1237 inline __host__ __device__ float2
fmodf(float2 a, float2 b)
1241 inline __host__ __device__ float3
fmodf(float3 a, float3 b)
1245 inline __host__ __device__ float4
fmodf(float4 a, float4 b)
1254 inline __host__ __device__ float2
fabs(float2 v)
1258 inline __host__ __device__ float3
fabs(float3 v)
1262 inline __host__ __device__ float4
fabs(float4 v)
1267 inline __host__ __device__ int2
abs(int2 v)
1271 inline __host__ __device__ int3
abs(int3 v)
1275 inline __host__ __device__ int4
abs(int4 v)
1286 inline __host__ __device__ float3
reflect(float3 i, float3 n)
1288 return i - 2.0f * n *
dot(n,i);
1295 inline __host__ __device__ float3
cross(float3 a, float3 b)
1297 return make_float3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x);
1307 inline __device__ __host__
float smoothstep(
float a,
float b,
float x)
1309 float y =
clamp((x - a) / (b - a), 0.0f, 1.0f);
1310 return (y*y*(3.0f - (2.0f*y)));
1312 inline __device__ __host__ float2
smoothstep(float2 a, float2 b, float2 x)
1314 float2 y =
clamp((x - a) / (b - a), 0.0f, 1.0f);
1317 inline __device__ __host__ float3
smoothstep(float3 a, float3 b, float3 x)
1319 float3 y =
clamp((x - a) / (b - a), 0.0f, 1.0f);
1322 inline __device__ __host__ float4
smoothstep(float4 a, float4 b, float4 x)
1324 float4 y =
clamp((x - a) / (b - a), 0.0f, 1.0f);
__host__ __device__ float2 normalize(float2 v)
__host__ __device__ int4 make_int4(int s)
__device__ __host__ float lerp(float a, float b, float t)
__host__ __device__ uint2 make_uint2(uint s)
__host__ __device__ float2 operator/(float2 a, float2 b)
float fmaxf(float a, float b)
__host__ __device__ float3 cross(float3 a, float3 b)
__host__ __device__ float length(float2 v)
__host__ __device__ void operator-=(float2 &a, float2 b)
__host__ __device__ int2 make_int2(int s)
__device__ __host__ float smoothstep(float a, float b, float x)
__host__ __device__ float2 fmodf(float2 a, float2 b)
__device__ __host__ float clamp(float f, float a, float b)
float fminf(float a, float b)
__host__ __device__ float2 operator*(float2 a, float2 b)
__host__ __device__ float4 make_float4(float s)
__host__ __device__ void operator/=(float2 &a, float2 b)
__host__ __device__ uint4 make_uint4(uint s)
__host__ __device__ float2 operator-(float2 &a)
__host__ __device__ int3 make_int3(int s)
__host__ __device__ float dot(float2 a, float2 b)
__host__ __device__ float fracf(float v)
__host__ __device__ float2 operator+(float2 a, float2 b)
__host__ __device__ float2 fabs(float2 v)
__host__ __device__ void operator*=(float2 &a, float2 b)
__host__ __device__ uint3 make_uint3(uint s)
__host__ __device__ float2 floorf(float2 v)
__host__ __device__ float2 make_float2(float s)
__host__ __device__ int2 abs(int2 v)
__host__ __device__ void operator+=(float2 &a, float2 b)
__host__ __device__ float3 reflect(float3 i, float3 n)
__host__ __device__ float3 make_float3(float s)