diff --git a/include/OptiXToolkit/ShaderUtil/color.h b/include/OptiXToolkit/ShaderUtil/color.h index 8970b48..96d373c 100644 --- a/include/OptiXToolkit/ShaderUtil/color.h +++ b/include/OptiXToolkit/ShaderUtil/color.h @@ -49,7 +49,8 @@ __forceinline__ __device__ float3 toSRGB( const float3& c ) //} __forceinline__ __device__ unsigned char quantizeUnsigned8Bits( float x ) { - x = clamp( x, 0.0f, 1.0f ); + using namespace otk; + x = otk::clamp( x, 0.0f, 1.0f ); enum { N = (1 << 8) - 1, Np1 = (1 << 8) }; return (unsigned char)min((unsigned int)(x * (float)Np1), (unsigned int)N); } @@ -57,7 +58,7 @@ __forceinline__ __device__ unsigned char quantizeUnsigned8Bits( float x ) __forceinline__ __device__ uchar4 make_color( const float3& c ) { // first apply gamma, then convert to unsigned char - float3 srgb = toSRGB( clamp( c, 0.0f, 1.0f ) ); + float3 srgb = toSRGB( otk::clamp( c, 0.0f, 1.0f ) ); return make_uchar4( quantizeUnsigned8Bits( srgb.x ), quantizeUnsigned8Bits( srgb.y ), quantizeUnsigned8Bits( srgb.z ), 255u ); } __forceinline__ __device__ uchar4 make_color( const float4& c ) diff --git a/include/OptiXToolkit/ShaderUtil/ray_cone.h b/include/OptiXToolkit/ShaderUtil/ray_cone.h index ab91bba..c24ba68 100644 --- a/include/OptiXToolkit/ShaderUtil/ray_cone.h +++ b/include/OptiXToolkit/ShaderUtil/ray_cone.h @@ -44,6 +44,7 @@ struct RayCone // U and V are the semi-axes of the view rectangle, image_dim is the image dimensions in pixels. OTK_INLINE OTK_HOSTDEVICE RayCone initRayConeOrthoCamera( float3 U, float3 V, uint2 image_dim ) { + using namespace otk; return RayCone{0.0f, 2.0f * fminf( length( U ) / image_dim.x, length( V ) / image_dim.y )}; } @@ -52,6 +53,7 @@ OTK_INLINE OTK_HOSTDEVICE RayCone initRayConeOrthoCamera( float3 U, float3 V, ui // image_dim is the image dimensions in pixels, D is the normalized ray direction. OTK_INLINE OTK_HOSTDEVICE RayCone initRayConePinholeCamera( float3 U, float3 V, float3 W, uint2 image_dim, float3 D ) { + using namespace otk; const float invDist = dot( D, W ) / dot( W, W ); return RayCone{2.0f * fminf( invDist * length( U ) / image_dim.x, invDist * length( V ) / image_dim.y ), 0.0f}; } @@ -60,6 +62,7 @@ OTK_INLINE OTK_HOSTDEVICE RayCone initRayConePinholeCamera( float3 U, float3 V, // W is the vector from the eye to the view center, D is the normalized ray direction. OTK_INLINE OTK_HOSTDEVICE RayCone initRayConeThinLensCamera( float3 W, float lens_width, float3 D ) { + using namespace otk; return RayCone{-lens_width * dot( D, W ) / dot( W, W ), lens_width}; } @@ -125,6 +128,7 @@ OTK_INLINE OTK_HOSTDEVICE float texFootprintWidth( float rayConeWidth, float dPd // given the normalized ray direction D and surface normal N. OTK_INLINE OTK_HOSTDEVICE void projectToRayDifferentialsOnSurface( float rayConeWidth, float3 D, float3 N, float3& dPdx, float3& dPdy ) { + using namespace otk; float DdotN = dot(D, N); dPdx = normalize( D - DdotN * N ) * ( rayConeWidth / fmaxf( fabsf( DdotN ), INV_MAX_ANISOTROPY ) ); dPdy = normalize( cross( D, N ) ) * rayConeWidth; @@ -150,6 +154,7 @@ OTK_INLINE OTK_HOSTDEVICE RayCone unpackRayCone( unsigned int p ) // Get the curvature of a triangle edge OTK_INLINE OTK_HOSTDEVICE float edgeCurvature( float3 A, float3 B, float3 Na, float3 Nb ) { + using namespace otk; return dot( Nb - Na, B - A ) / dot( B - A, B - A ); } @@ -177,6 +182,7 @@ OTK_INLINE OTK_HOSTDEVICE float minTriangleCurvature( float3 A, float3 B, float3 OTK_INLINE OTK_HOSTDEVICE void computeTexGradientsFromDerivatives( float3 dPds, float3 dPdt, float3 dPdx, float3 dPdy, float2& ddx, float2& ddy ) { + using namespace otk; const float dPds2 = dot(dPds, dPds); const float dPdt2 = dot(dPdt, dPdt); ddx = float2{dot(dPdx, dPds) / dPds2, dot(dPdx, dPdt) / dPdt2}; @@ -203,6 +209,8 @@ OTK_INLINE OTK_HOSTDEVICE void computeTexGradientsForTriangle( float3 A, float3 B, float3 C, float2 Ta, float2 Tb, float2 Tc, float3 dPdx, float3 dPdy, float2& ddx, float2& ddy ) { + using namespace otk; + // Scaled normal and inverse squared area of the triangle const float3 ABC = cross( (B - A), (C - A) ); const float abc2 = 1.0f / dot( ABC, ABC ); diff --git a/include/OptiXToolkit/ShaderUtil/vec_math.h b/include/OptiXToolkit/ShaderUtil/vec_math.h index 63ae2e4..a7ebf26 100644 --- a/include/OptiXToolkit/ShaderUtil/vec_math.h +++ b/include/OptiXToolkit/ShaderUtil/vec_math.h @@ -50,9 +50,12 @@ #define M_1_PIf 0.318309886183790671538f #endif +namespace otk { -#if !defined(__CUDACC__) - +#if defined( __CUDACC__ ) +using ::max; +using ::min; +#else OTK_INLINE OTK_HOSTDEVICE int max(int a, int b) { return a > b ? a : b; @@ -118,7 +121,7 @@ OTK_INLINE OTK_HOSTDEVICE IntegerType roundUp(IntegerType x, IntegerType y) /** clamp */ OTK_INLINE OTK_HOSTDEVICE float clamp( const float f, const float a, const float b ) { - return fmaxf( a, fminf( f, b ) ); + return ::fmaxf( a, fminf( f, b ) ); } @@ -128,49 +131,56 @@ OTK_INLINE OTK_HOSTDEVICE float clamp( const float f, const float a, const float /** additional constructors * @{ */ +using ::make_float2; + + OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const float s) { - return make_float2(s, s); + return ::make_float2(s, s); } OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const int2& a) { - return make_float2(float(a.x), float(a.y)); + return ::make_float2(float(a.x), float(a.y)); } OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const uint2& a) { - return make_float2(float(a.x), float(a.y)); + return ::make_float2(float(a.x), float(a.y)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE float2 operator-(const float2& a) { - return make_float2(-a.x, -a.y); + return ::make_float2(-a.x, -a.y); } /** min * @{ */ +using ::fminf; + OTK_INLINE OTK_HOSTDEVICE float2 fminf(const float2& a, const float2& b) { - return make_float2(fminf(a.x,b.x), fminf(a.y,b.y)); + return ::make_float2(::fminf(a.x,b.x), ::fminf(a.y,b.y)); } OTK_INLINE OTK_HOSTDEVICE float fminf(const float2& a) { - return fminf(a.x, a.y); + return ::fminf(a.x, a.y); } /** @} */ /** max * @{ */ +using ::fmaxf; + OTK_INLINE OTK_HOSTDEVICE float2 fmaxf(const float2& a, const float2& b) { - return make_float2(fmaxf(a.x,b.x), fmaxf(a.y,b.y)); + return ::make_float2(::fmaxf(a.x,b.x), ::fmaxf(a.y,b.y)); } OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float2& a) { - return fmaxf(a.x, a.y); + return ::fmaxf(a.x, a.y); } /** @} */ @@ -179,15 +189,15 @@ OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float2& a) */ OTK_INLINE OTK_HOSTDEVICE float2 operator+(const float2& a, const float2& b) { - return make_float2(a.x + b.x, a.y + b.y); + return ::make_float2(a.x + b.x, a.y + b.y); } OTK_INLINE OTK_HOSTDEVICE float2 operator+(const float2& a, const float b) { - return make_float2(a.x + b, a.y + b); + return ::make_float2(a.x + b, a.y + b); } OTK_INLINE OTK_HOSTDEVICE float2 operator+(const float a, const float2& b) { - return make_float2(a + b.x, a + b.y); + return ::make_float2(a + b.x, a + b.y); } OTK_INLINE OTK_HOSTDEVICE void operator+=(float2& a, const float2& b) { @@ -200,15 +210,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(float2& a, const float2& b) */ OTK_INLINE OTK_HOSTDEVICE float2 operator-(const float2& a, const float2& b) { - return make_float2(a.x - b.x, a.y - b.y); + return ::make_float2(a.x - b.x, a.y - b.y); } OTK_INLINE OTK_HOSTDEVICE float2 operator-(const float2& a, const float b) { - return make_float2(a.x - b, a.y - b); + return ::make_float2(a.x - b, a.y - b); } OTK_INLINE OTK_HOSTDEVICE float2 operator-(const float a, const float2& b) { - return make_float2(a - b.x, a - b.y); + return ::make_float2(a - b.x, a - b.y); } OTK_INLINE OTK_HOSTDEVICE void operator-=(float2& a, const float2& b) { @@ -221,15 +231,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(float2& a, const float2& b) */ OTK_INLINE OTK_HOSTDEVICE float2 operator*(const float2& a, const float2& b) { - return make_float2(a.x * b.x, a.y * b.y); + return ::make_float2(a.x * b.x, a.y * b.y); } OTK_INLINE OTK_HOSTDEVICE float2 operator*(const float2& a, const float s) { - return make_float2(a.x * s, a.y * s); + return ::make_float2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE float2 operator*(const float s, const float2& a) { - return make_float2(a.x * s, a.y * s); + return ::make_float2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(float2& a, const float2& s) { @@ -246,7 +256,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(float2& a, const float s) */ OTK_INLINE OTK_HOSTDEVICE float2 operator/(const float2& a, const float2& b) { - return make_float2(a.x / b.x, a.y / b.y); + return ::make_float2(a.x / b.x, a.y / b.y); } OTK_INLINE OTK_HOSTDEVICE float2 operator/(const float2& a, const float s) { @@ -255,7 +265,7 @@ OTK_INLINE OTK_HOSTDEVICE float2 operator/(const float2& a, const float s) } OTK_INLINE OTK_HOSTDEVICE float2 operator/(const float s, const float2& a) { - return make_float2( s/a.x, s/a.y ); + return ::make_float2( s/a.x, s/a.y ); } OTK_INLINE OTK_HOSTDEVICE void operator/=(float2& a, const float s) { @@ -282,12 +292,12 @@ OTK_INLINE OTK_HOSTDEVICE float2 bilerp(const float2& x00, const float2& x10, co */ OTK_INLINE OTK_HOSTDEVICE float2 clamp(const float2& v, const float a, const float b) { - return make_float2(clamp(v.x, a, b), clamp(v.y, a, b)); + return ::make_float2(clamp(v.x, a, b), clamp(v.y, a, b)); } OTK_INLINE OTK_HOSTDEVICE float2 clamp(const float2& v, const float2& a, const float2& b) { - return make_float2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); + return ::make_float2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); } /** @} */ @@ -310,12 +320,18 @@ OTK_INLINE OTK_HOSTDEVICE float2 normalize(const float2& v) return v * invLen; } -/** floor */ +/** floor +* @{ +*/ +using ::floor; + OTK_INLINE OTK_HOSTDEVICE float2 floor(const float2& v) { - return make_float2(::floorf(v.x), ::floorf(v.y)); + return ::make_float2(::floorf(v.x), ::floorf(v.y)); } +/** @} */ + /** reflect */ OTK_INLINE OTK_HOSTDEVICE float2 reflect(const float2& i, const float2& n) { @@ -331,11 +347,16 @@ OTK_INLINE OTK_HOSTDEVICE float2 faceforward(const float2& n, const float2& i, c return n * copysignf( 1.0f, dot(i, nref) ); } -/** exp */ +/** exp +* @{ +*/ +using ::expf; + OTK_INLINE OTK_HOSTDEVICE float2 expf(const float2& v) { - return make_float2(::expf(v.x), ::expf(v.y)); + return ::make_float2(::expf(v.x), ::expf(v.y)); } +/** @} */ /** If used on the device, this could place the the 'v' in local memory */ OTK_INLINE OTK_HOSTDEVICE float getByIndex(const float2& v, int i) @@ -356,28 +377,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(float2& v, int i, float x) /** additional constructors * @{ */ +using ::make_float3; + OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float s) { - return make_float3(s, s, s); + return ::make_float3(s, s, s); } OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float2& a) { - return make_float3(a.x, a.y, 0.0f); + return ::make_float3(a.x, a.y, 0.0f); } OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const int3& a) { - return make_float3(float(a.x), float(a.y), float(a.z)); + return ::make_float3(float(a.x), float(a.y), float(a.z)); } OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const uint3& a) { - return make_float3(float(a.x), float(a.y), float(a.z)); + return ::make_float3(float(a.x), float(a.y), float(a.z)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE float3 operator-(const float3& a) { - return make_float3(-a.x, -a.y, -a.z); + return ::make_float3(-a.x, -a.y, -a.z); } /** min @@ -385,11 +408,11 @@ OTK_INLINE OTK_HOSTDEVICE float3 operator-(const float3& a) */ OTK_INLINE OTK_HOSTDEVICE float3 fminf(const float3& a, const float3& b) { - return make_float3(fminf(a.x,b.x), fminf(a.y,b.y), fminf(a.z,b.z)); + return ::make_float3(::fminf(a.x,b.x), ::fminf(a.y,b.y), ::fminf(a.z,b.z)); } OTK_INLINE OTK_HOSTDEVICE float fminf(const float3& a) { - return fminf(fminf(a.x, a.y), a.z); + return ::fminf(::fminf(a.x, a.y), a.z); } /** @} */ @@ -398,11 +421,11 @@ OTK_INLINE OTK_HOSTDEVICE float fminf(const float3& a) */ OTK_INLINE OTK_HOSTDEVICE float3 fmaxf(const float3& a, const float3& b) { - return make_float3(fmaxf(a.x,b.x), fmaxf(a.y,b.y), fmaxf(a.z,b.z)); + return ::make_float3(::fmaxf(a.x,b.x), ::fmaxf(a.y,b.y), ::fmaxf(a.z,b.z)); } OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float3& a) { - return fmaxf(fmaxf(a.x, a.y), a.z); + return ::fmaxf(::fmaxf(a.x, a.y), a.z); } /** @} */ @@ -411,15 +434,15 @@ OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float3& a) */ OTK_INLINE OTK_HOSTDEVICE float3 operator+(const float3& a, const float3& b) { - return make_float3(a.x + b.x, a.y + b.y, a.z + b.z); + return ::make_float3(a.x + b.x, a.y + b.y, a.z + b.z); } OTK_INLINE OTK_HOSTDEVICE float3 operator+(const float3& a, const float b) { - return make_float3(a.x + b, a.y + b, a.z + b); + return ::make_float3(a.x + b, a.y + b, a.z + b); } OTK_INLINE OTK_HOSTDEVICE float3 operator+(const float a, const float3& b) { - return make_float3(a + b.x, a + b.y, a + b.z); + return ::make_float3(a + b.x, a + b.y, a + b.z); } OTK_INLINE OTK_HOSTDEVICE void operator+=(float3& a, const float3& b) { @@ -432,15 +455,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(float3& a, const float3& b) */ OTK_INLINE OTK_HOSTDEVICE float3 operator-(const float3& a, const float3& b) { - return make_float3(a.x - b.x, a.y - b.y, a.z - b.z); + return ::make_float3(a.x - b.x, a.y - b.y, a.z - b.z); } OTK_INLINE OTK_HOSTDEVICE float3 operator-(const float3& a, const float b) { - return make_float3(a.x - b, a.y - b, a.z - b); + return ::make_float3(a.x - b, a.y - b, a.z - b); } OTK_INLINE OTK_HOSTDEVICE float3 operator-(const float a, const float3& b) { - return make_float3(a - b.x, a - b.y, a - b.z); + return ::make_float3(a - b.x, a - b.y, a - b.z); } OTK_INLINE OTK_HOSTDEVICE void operator-=(float3& a, const float3& b) { @@ -453,15 +476,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(float3& a, const float3& b) */ OTK_INLINE OTK_HOSTDEVICE float3 operator*(const float3& a, const float3& b) { - return make_float3(a.x * b.x, a.y * b.y, a.z * b.z); + return ::make_float3(a.x * b.x, a.y * b.y, a.z * b.z); } OTK_INLINE OTK_HOSTDEVICE float3 operator*(const float3& a, const float s) { - return make_float3(a.x * s, a.y * s, a.z * s); + return ::make_float3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE float3 operator*(const float s, const float3& a) { - return make_float3(a.x * s, a.y * s, a.z * s); + return ::make_float3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(float3& a, const float3& s) { @@ -478,7 +501,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(float3& a, const float s) */ OTK_INLINE OTK_HOSTDEVICE float3 operator/(const float3& a, const float3& b) { - return make_float3(a.x / b.x, a.y / b.y, a.z / b.z); + return ::make_float3(a.x / b.x, a.y / b.y, a.z / b.z); } OTK_INLINE OTK_HOSTDEVICE float3 operator/(const float3& a, const float s) { @@ -487,7 +510,7 @@ OTK_INLINE OTK_HOSTDEVICE float3 operator/(const float3& a, const float s) } OTK_INLINE OTK_HOSTDEVICE float3 operator/(const float s, const float3& a) { - return make_float3( s/a.x, s/a.y, s/a.z ); + return ::make_float3( s/a.x, s/a.y, s/a.z ); } OTK_INLINE OTK_HOSTDEVICE void operator/=(float3& a, const float s) { @@ -514,12 +537,12 @@ OTK_INLINE OTK_HOSTDEVICE float3 bilerp(const float3& x00, const float3& x10, co */ OTK_INLINE OTK_HOSTDEVICE float3 clamp(const float3& v, const float a, const float b) { - return make_float3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); + return ::make_float3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); } OTK_INLINE OTK_HOSTDEVICE float3 clamp(const float3& v, const float3& a, const float3& b) { - return make_float3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); + return ::make_float3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); } /** @} */ @@ -532,7 +555,7 @@ OTK_INLINE OTK_HOSTDEVICE float dot(const float3& a, const float3& b) /** cross product */ OTK_INLINE OTK_HOSTDEVICE float3 cross(const float3& a, const float3& b) { - 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); + 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); } /** length */ @@ -551,7 +574,7 @@ OTK_INLINE OTK_HOSTDEVICE float3 normalize(const float3& v) /** floor */ OTK_INLINE OTK_HOSTDEVICE float3 floor(const float3& v) { - return make_float3(::floorf(v.x), ::floorf(v.y), ::floorf(v.z)); + return ::make_float3(::floorf(v.x), ::floorf(v.y), ::floorf(v.z)); } /** reflect */ @@ -572,7 +595,7 @@ OTK_INLINE OTK_HOSTDEVICE float3 faceforward(const float3& n, const float3& i, c /** exp */ OTK_INLINE OTK_HOSTDEVICE float3 expf(const float3& v) { - return make_float3(::expf(v.x), ::expf(v.y), ::expf(v.z)); + return ::make_float3(::expf(v.x), ::expf(v.y), ::expf(v.z)); } /** If used on the device, this could place the the 'v' in local memory */ @@ -593,28 +616,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(float3& v, int i, float x) /** additional constructors * @{ */ +using ::make_float4; + OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float s) { - return make_float4(s, s, s, s); + return ::make_float4(s, s, s, s); } OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float3& a) { - return make_float4(a.x, a.y, a.z, 0.0f); + return ::make_float4(a.x, a.y, a.z, 0.0f); } OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const int4& a) { - return make_float4(float(a.x), float(a.y), float(a.z), float(a.w)); + return ::make_float4(float(a.x), float(a.y), float(a.z), float(a.w)); } OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const uint4& a) { - return make_float4(float(a.x), float(a.y), float(a.z), float(a.w)); + return ::make_float4(float(a.x), float(a.y), float(a.z), float(a.w)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE float4 operator-(const float4& a) { - return make_float4(-a.x, -a.y, -a.z, -a.w); + return ::make_float4(-a.x, -a.y, -a.z, -a.w); } /** min @@ -622,11 +647,11 @@ OTK_INLINE OTK_HOSTDEVICE float4 operator-(const float4& a) */ OTK_INLINE OTK_HOSTDEVICE float4 fminf(const float4& a, const float4& b) { - return make_float4(fminf(a.x,b.x), fminf(a.y,b.y), fminf(a.z,b.z), fminf(a.w,b.w)); + return ::make_float4(::fminf(a.x,b.x), ::fminf(a.y,b.y), ::fminf(a.z,b.z), ::fminf(a.w,b.w)); } OTK_INLINE OTK_HOSTDEVICE float fminf(const float4& a) { - return fminf(fminf(a.x, a.y), fminf(a.z, a.w)); + return ::fminf(::fminf(a.x, a.y), ::fminf(a.z, a.w)); } /** @} */ @@ -635,11 +660,11 @@ OTK_INLINE OTK_HOSTDEVICE float fminf(const float4& a) */ OTK_INLINE OTK_HOSTDEVICE float4 fmaxf(const float4& a, const float4& b) { - return make_float4(fmaxf(a.x,b.x), fmaxf(a.y,b.y), fmaxf(a.z,b.z), fmaxf(a.w,b.w)); + return ::make_float4(::fmaxf(a.x,b.x), ::fmaxf(a.y,b.y), ::fmaxf(a.z,b.z), ::fmaxf(a.w,b.w)); } OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float4& a) { - return fmaxf(fmaxf(a.x, a.y), fmaxf(a.z, a.w)); + return ::fmaxf(::fmaxf(a.x, a.y), ::fmaxf(a.z, a.w)); } /** @} */ @@ -648,15 +673,15 @@ OTK_INLINE OTK_HOSTDEVICE float fmaxf(const float4& a) */ OTK_INLINE OTK_HOSTDEVICE float4 operator+(const float4& a, const float4& b) { - return make_float4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return ::make_float4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } OTK_INLINE OTK_HOSTDEVICE float4 operator+(const float4& a, const float b) { - return make_float4(a.x + b, a.y + b, a.z + b, a.w + b); + return ::make_float4(a.x + b, a.y + b, a.z + b, a.w + b); } OTK_INLINE OTK_HOSTDEVICE float4 operator+(const float a, const float4& b) { - return make_float4(a + b.x, a + b.y, a + b.z, a + b.w); + return ::make_float4(a + b.x, a + b.y, a + b.z, a + b.w); } OTK_INLINE OTK_HOSTDEVICE void operator+=(float4& a, const float4& b) { @@ -669,15 +694,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(float4& a, const float4& b) */ OTK_INLINE OTK_HOSTDEVICE float4 operator-(const float4& a, const float4& b) { - return make_float4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return ::make_float4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } OTK_INLINE OTK_HOSTDEVICE float4 operator-(const float4& a, const float b) { - return make_float4(a.x - b, a.y - b, a.z - b, a.w - b); + return ::make_float4(a.x - b, a.y - b, a.z - b, a.w - b); } OTK_INLINE OTK_HOSTDEVICE float4 operator-(const float a, const float4& b) { - return make_float4(a - b.x, a - b.y, a - b.z, a - b.w); + return ::make_float4(a - b.x, a - b.y, a - b.z, a - b.w); } OTK_INLINE OTK_HOSTDEVICE void operator-=(float4& a, const float4& b) { @@ -690,15 +715,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(float4& a, const float4& b) */ OTK_INLINE OTK_HOSTDEVICE float4 operator*(const float4& a, const float4& s) { - return make_float4(a.x * s.x, a.y * s.y, a.z * s.z, a.w * s.w); + return ::make_float4(a.x * s.x, a.y * s.y, a.z * s.z, a.w * s.w); } OTK_INLINE OTK_HOSTDEVICE float4 operator*(const float4& a, const float s) { - return make_float4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_float4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE float4 operator*(const float s, const float4& a) { - return make_float4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_float4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(float4& a, const float4& s) { @@ -715,7 +740,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(float4& a, const float s) */ OTK_INLINE OTK_HOSTDEVICE float4 operator/(const float4& a, const float4& b) { - return make_float4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return ::make_float4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } OTK_INLINE OTK_HOSTDEVICE float4 operator/(const float4& a, const float s) { @@ -724,7 +749,7 @@ OTK_INLINE OTK_HOSTDEVICE float4 operator/(const float4& a, const float s) } OTK_INLINE OTK_HOSTDEVICE float4 operator/(const float s, const float4& a) { - return make_float4( s/a.x, s/a.y, s/a.z, s/a.w ); + return ::make_float4( s/a.x, s/a.y, s/a.z, s/a.w ); } OTK_INLINE OTK_HOSTDEVICE void operator/=(float4& a, const float s) { @@ -751,12 +776,12 @@ OTK_INLINE OTK_HOSTDEVICE float4 bilerp(const float4& x00, const float4& x10, co */ OTK_INLINE OTK_HOSTDEVICE float4 clamp(const float4& v, const float a, const float b) { - return make_float4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); + return ::make_float4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); } OTK_INLINE OTK_HOSTDEVICE float4 clamp(const float4& v, const float4& a, const float4& b) { - 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)); + 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)); } /** @} */ @@ -782,7 +807,7 @@ OTK_INLINE OTK_HOSTDEVICE float4 normalize(const float4& v) /** floor */ OTK_INLINE OTK_HOSTDEVICE float4 floor(const float4& v) { - return make_float4(::floorf(v.x), ::floorf(v.y), ::floorf(v.z), ::floorf(v.w)); + return ::make_float4(::floorf(v.x), ::floorf(v.y), ::floorf(v.z), ::floorf(v.w)); } /** reflect */ @@ -805,7 +830,7 @@ OTK_INLINE OTK_HOSTDEVICE float4 faceforward(const float4& n, const float4& i, c /** exp */ OTK_INLINE OTK_HOSTDEVICE float4 expf(const float4& v) { - return make_float4(::expf(v.x), ::expf(v.y), ::expf(v.z), ::expf(v.w)); + return ::make_float4(::expf(v.x), ::expf(v.y), ::expf(v.z), ::expf(v.w)); } /** If used on the device, this could place the the 'v' in local memory */ @@ -849,32 +874,34 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(int1& v, int i, int x) /** additional constructors * @{ */ +using ::make_int2; + OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const int s) { - return make_int2(s, s); + return ::make_int2(s, s); } OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const float2& a) { - return make_int2(int(a.x), int(a.y)); + return ::make_int2(int(a.x), int(a.y)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE int2 operator-(const int2& a) { - return make_int2(-a.x, -a.y); + return ::make_int2(-a.x, -a.y); } /** min */ OTK_INLINE OTK_HOSTDEVICE int2 min(const int2& a, const int2& b) { - return make_int2(min(a.x,b.x), min(a.y,b.y)); + return ::make_int2(min(a.x,b.x), min(a.y,b.y)); } /** max */ OTK_INLINE OTK_HOSTDEVICE int2 max(const int2& a, const int2& b) { - return make_int2(max(a.x,b.x), max(a.y,b.y)); + return ::make_int2(max(a.x,b.x), max(a.y,b.y)); } /** add @@ -882,7 +909,7 @@ OTK_INLINE OTK_HOSTDEVICE int2 max(const int2& a, const int2& b) */ OTK_INLINE OTK_HOSTDEVICE int2 operator+(const int2& a, const int2& b) { - return make_int2(a.x + b.x, a.y + b.y); + return ::make_int2(a.x + b.x, a.y + b.y); } OTK_INLINE OTK_HOSTDEVICE void operator+=(int2& a, const int2& b) { @@ -895,11 +922,11 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(int2& a, const int2& b) */ OTK_INLINE OTK_HOSTDEVICE int2 operator-(const int2& a, const int2& b) { - return make_int2(a.x - b.x, a.y - b.y); + return ::make_int2(a.x - b.x, a.y - b.y); } OTK_INLINE OTK_HOSTDEVICE int2 operator-(const int2& a, const int b) { - return make_int2(a.x - b, a.y - b); + return ::make_int2(a.x - b, a.y - b); } OTK_INLINE OTK_HOSTDEVICE void operator-=(int2& a, const int2& b) { @@ -912,15 +939,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(int2& a, const int2& b) */ OTK_INLINE OTK_HOSTDEVICE int2 operator*(const int2& a, const int2& b) { - return make_int2(a.x * b.x, a.y * b.y); + return ::make_int2(a.x * b.x, a.y * b.y); } OTK_INLINE OTK_HOSTDEVICE int2 operator*(const int2& a, const int s) { - return make_int2(a.x * s, a.y * s); + return ::make_int2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE int2 operator*(const int s, const int2& a) { - return make_int2(a.x * s, a.y * s); + return ::make_int2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(int2& a, const int s) { @@ -933,12 +960,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(int2& a, const int s) */ OTK_INLINE OTK_HOSTDEVICE int2 clamp(const int2& v, const int a, const int b) { - return make_int2(clamp(v.x, a, b), clamp(v.y, a, b)); + return ::make_int2(clamp(v.x, a, b), clamp(v.y, a, b)); } OTK_INLINE OTK_HOSTDEVICE int2 clamp(const int2& v, const int2& a, const int2& b) { - return make_int2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); + return ::make_int2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); } /** @} */ @@ -975,32 +1002,33 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(int2& v, int i, int x) /** additional constructors * @{ */ +using ::make_int3; OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int s) { - return make_int3(s, s, s); + return ::make_int3(s, s, s); } OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const float3& a) { - return make_int3(int(a.x), int(a.y), int(a.z)); + return ::make_int3(int(a.x), int(a.y), int(a.z)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE int3 operator-(const int3& a) { - return make_int3(-a.x, -a.y, -a.z); + return ::make_int3(-a.x, -a.y, -a.z); } /** min */ OTK_INLINE OTK_HOSTDEVICE int3 min(const int3& a, const int3& b) { - return make_int3(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z)); + return ::make_int3(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z)); } /** max */ OTK_INLINE OTK_HOSTDEVICE int3 max(const int3& a, const int3& b) { - return make_int3(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z)); + return ::make_int3(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z)); } /** add @@ -1008,7 +1036,7 @@ OTK_INLINE OTK_HOSTDEVICE int3 max(const int3& a, const int3& b) */ OTK_INLINE OTK_HOSTDEVICE int3 operator+(const int3& a, const int3& b) { - return make_int3(a.x + b.x, a.y + b.y, a.z + b.z); + return ::make_int3(a.x + b.x, a.y + b.y, a.z + b.z); } OTK_INLINE OTK_HOSTDEVICE void operator+=(int3& a, const int3& b) { @@ -1021,7 +1049,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(int3& a, const int3& b) */ OTK_INLINE OTK_HOSTDEVICE int3 operator-(const int3& a, const int3& b) { - return make_int3(a.x - b.x, a.y - b.y, a.z - b.z); + return ::make_int3(a.x - b.x, a.y - b.y, a.z - b.z); } OTK_INLINE OTK_HOSTDEVICE void operator-=(int3& a, const int3& b) @@ -1035,15 +1063,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(int3& a, const int3& b) */ OTK_INLINE OTK_HOSTDEVICE int3 operator*(const int3& a, const int3& b) { - return make_int3(a.x * b.x, a.y * b.y, a.z * b.z); + return ::make_int3(a.x * b.x, a.y * b.y, a.z * b.z); } OTK_INLINE OTK_HOSTDEVICE int3 operator*(const int3& a, const int s) { - return make_int3(a.x * s, a.y * s, a.z * s); + return ::make_int3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE int3 operator*(const int s, const int3& a) { - return make_int3(a.x * s, a.y * s, a.z * s); + return ::make_int3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(int3& a, const int s) { @@ -1056,15 +1084,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(int3& a, const int s) */ OTK_INLINE OTK_HOSTDEVICE int3 operator/(const int3& a, const int3& b) { - return make_int3(a.x / b.x, a.y / b.y, a.z / b.z); + return ::make_int3(a.x / b.x, a.y / b.y, a.z / b.z); } OTK_INLINE OTK_HOSTDEVICE int3 operator/(const int3& a, const int s) { - return make_int3(a.x / s, a.y / s, a.z / s); + return ::make_int3(a.x / s, a.y / s, a.z / s); } OTK_INLINE OTK_HOSTDEVICE int3 operator/(const int s, const int3& a) { - return make_int3(s /a.x, s / a.y, s / a.z); + return ::make_int3(s /a.x, s / a.y, s / a.z); } OTK_INLINE OTK_HOSTDEVICE void operator/=(int3& a, const int s) { @@ -1077,12 +1105,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(int3& a, const int s) */ OTK_INLINE OTK_HOSTDEVICE int3 clamp(const int3& v, const int a, const int b) { - return make_int3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); + return ::make_int3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); } OTK_INLINE OTK_HOSTDEVICE int3 clamp(const int3& v, const int3& a, const int3& b) { - return make_int3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); + return ::make_int3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); } /** @} */ @@ -1121,30 +1149,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(int3& v, int i, int x) */ OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int s) { - return make_int4(s, s, s, s); + return ::make_int4(s, s, s, s); } OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const float4& a) { - return make_int4((int)a.x, (int)a.y, (int)a.z, (int)a.w); + return ::make_int4((int)a.x, (int)a.y, (int)a.z, (int)a.w); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE int4 operator-(const int4& a) { - return make_int4(-a.x, -a.y, -a.z, -a.w); + return ::make_int4(-a.x, -a.y, -a.z, -a.w); } /** min */ OTK_INLINE OTK_HOSTDEVICE int4 min(const int4& a, const int4& b) { - return make_int4(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z), min(a.w,b.w)); + return ::make_int4(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z), min(a.w,b.w)); } /** max */ OTK_INLINE OTK_HOSTDEVICE int4 max(const int4& a, const int4& b) { - return make_int4(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z), max(a.w,b.w)); + return ::make_int4(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z), max(a.w,b.w)); } /** add @@ -1152,7 +1180,7 @@ OTK_INLINE OTK_HOSTDEVICE int4 max(const int4& a, const int4& b) */ OTK_INLINE OTK_HOSTDEVICE int4 operator+(const int4& a, const int4& b) { - return make_int4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return ::make_int4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } OTK_INLINE OTK_HOSTDEVICE void operator+=(int4& a, const int4& b) { @@ -1165,7 +1193,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(int4& a, const int4& b) */ OTK_INLINE OTK_HOSTDEVICE int4 operator-(const int4& a, const int4& b) { - return make_int4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return ::make_int4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } OTK_INLINE OTK_HOSTDEVICE void operator-=(int4& a, const int4& b) @@ -1179,15 +1207,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(int4& a, const int4& b) */ OTK_INLINE OTK_HOSTDEVICE int4 operator*(const int4& a, const int4& b) { - return make_int4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + return ::make_int4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } OTK_INLINE OTK_HOSTDEVICE int4 operator*(const int4& a, const int s) { - return make_int4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_int4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE int4 operator*(const int s, const int4& a) { - return make_int4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_int4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(int4& a, const int s) { @@ -1200,15 +1228,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(int4& a, const int s) */ OTK_INLINE OTK_HOSTDEVICE int4 operator/(const int4& a, const int4& b) { - return make_int4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return ::make_int4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } OTK_INLINE OTK_HOSTDEVICE int4 operator/(const int4& a, const int s) { - return make_int4(a.x / s, a.y / s, a.z / s, a.w / s); + return ::make_int4(a.x / s, a.y / s, a.z / s, a.w / s); } OTK_INLINE OTK_HOSTDEVICE int4 operator/(const int s, const int4& a) { - return make_int4(s / a.x, s / a.y, s / a.z, s / a.w); + return ::make_int4(s / a.x, s / a.y, s / a.z, s / a.w); } OTK_INLINE OTK_HOSTDEVICE void operator/=(int4& a, const int s) { @@ -1221,12 +1249,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(int4& a, const int s) */ OTK_INLINE OTK_HOSTDEVICE int4 clamp(const int4& v, const int a, const int b) { - return make_int4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); + return ::make_int4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); } OTK_INLINE OTK_HOSTDEVICE int4 clamp(const int4& v, const int4& a, const int4& b) { - 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)); + 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)); } /** @} */ @@ -1287,24 +1315,24 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(uint1& v, int i, unsigned int x) */ OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const unsigned int s) { - return make_uint2(s, s); + return ::make_uint2(s, s); } OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const float2& a) { - return make_uint2((unsigned int)a.x, (unsigned int)a.y); + return ::make_uint2((unsigned int)a.x, (unsigned int)a.y); } /** @} */ /** min */ OTK_INLINE OTK_HOSTDEVICE uint2 min(const uint2& a, const uint2& b) { - return make_uint2(min(a.x,b.x), min(a.y,b.y)); + return ::make_uint2(min(a.x,b.x), min(a.y,b.y)); } /** max */ OTK_INLINE OTK_HOSTDEVICE uint2 max(const uint2& a, const uint2& b) { - return make_uint2(max(a.x,b.x), max(a.y,b.y)); + return ::make_uint2(max(a.x,b.x), max(a.y,b.y)); } /** add @@ -1312,7 +1340,7 @@ OTK_INLINE OTK_HOSTDEVICE uint2 max(const uint2& a, const uint2& b) */ OTK_INLINE OTK_HOSTDEVICE uint2 operator+(const uint2& a, const uint2& b) { - return make_uint2(a.x + b.x, a.y + b.y); + return ::make_uint2(a.x + b.x, a.y + b.y); } OTK_INLINE OTK_HOSTDEVICE void operator+=(uint2& a, const uint2& b) { @@ -1325,11 +1353,11 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(uint2& a, const uint2& b) */ OTK_INLINE OTK_HOSTDEVICE uint2 operator-(const uint2& a, const uint2& b) { - return make_uint2(a.x - b.x, a.y - b.y); + return ::make_uint2(a.x - b.x, a.y - b.y); } OTK_INLINE OTK_HOSTDEVICE uint2 operator-(const uint2& a, const unsigned int b) { - return make_uint2(a.x - b, a.y - b); + return ::make_uint2(a.x - b, a.y - b); } OTK_INLINE OTK_HOSTDEVICE void operator-=(uint2& a, const uint2& b) { @@ -1342,15 +1370,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(uint2& a, const uint2& b) */ OTK_INLINE OTK_HOSTDEVICE uint2 operator*(const uint2& a, const uint2& b) { - return make_uint2(a.x * b.x, a.y * b.y); + return ::make_uint2(a.x * b.x, a.y * b.y); } OTK_INLINE OTK_HOSTDEVICE uint2 operator*(const uint2& a, const unsigned int s) { - return make_uint2(a.x * s, a.y * s); + return ::make_uint2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE uint2 operator*(const unsigned int s, const uint2& a) { - return make_uint2(a.x * s, a.y * s); + return ::make_uint2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(uint2& a, const unsigned int s) { @@ -1363,12 +1391,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(uint2& a, const unsigned int s) */ OTK_INLINE OTK_HOSTDEVICE uint2 clamp(const uint2& v, const unsigned int a, const unsigned int b) { - return make_uint2(clamp(v.x, a, b), clamp(v.y, a, b)); + return ::make_uint2(clamp(v.x, a, b), clamp(v.y, a, b)); } OTK_INLINE OTK_HOSTDEVICE uint2 clamp(const uint2& v, const uint2& a, const uint2& b) { - return make_uint2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); + return ::make_uint2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); } /** @} */ @@ -1407,24 +1435,24 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(uint2& v, int i, unsigned int x) */ OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const unsigned int s) { - return make_uint3(s, s, s); + return ::make_uint3(s, s, s); } OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const float3& a) { - return make_uint3((unsigned int)a.x, (unsigned int)a.y, (unsigned int)a.z); + return ::make_uint3((unsigned int)a.x, (unsigned int)a.y, (unsigned int)a.z); } /** @} */ /** min */ OTK_INLINE OTK_HOSTDEVICE uint3 min(const uint3& a, const uint3& b) { - return make_uint3(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z)); + return ::make_uint3(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z)); } /** max */ OTK_INLINE OTK_HOSTDEVICE uint3 max(const uint3& a, const uint3& b) { - return make_uint3(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z)); + return ::make_uint3(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z)); } /** add @@ -1432,7 +1460,7 @@ OTK_INLINE OTK_HOSTDEVICE uint3 max(const uint3& a, const uint3& b) */ OTK_INLINE OTK_HOSTDEVICE uint3 operator+(const uint3& a, const uint3& b) { - return make_uint3(a.x + b.x, a.y + b.y, a.z + b.z); + return ::make_uint3(a.x + b.x, a.y + b.y, a.z + b.z); } OTK_INLINE OTK_HOSTDEVICE void operator+=(uint3& a, const uint3& b) { @@ -1445,7 +1473,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(uint3& a, const uint3& b) */ OTK_INLINE OTK_HOSTDEVICE uint3 operator-(const uint3& a, const uint3& b) { - return make_uint3(a.x - b.x, a.y - b.y, a.z - b.z); + return ::make_uint3(a.x - b.x, a.y - b.y, a.z - b.z); } OTK_INLINE OTK_HOSTDEVICE void operator-=(uint3& a, const uint3& b) @@ -1459,15 +1487,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(uint3& a, const uint3& b) */ OTK_INLINE OTK_HOSTDEVICE uint3 operator*(const uint3& a, const uint3& b) { - return make_uint3(a.x * b.x, a.y * b.y, a.z * b.z); + return ::make_uint3(a.x * b.x, a.y * b.y, a.z * b.z); } OTK_INLINE OTK_HOSTDEVICE uint3 operator*(const uint3& a, const unsigned int s) { - return make_uint3(a.x * s, a.y * s, a.z * s); + return ::make_uint3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE uint3 operator*(const unsigned int s, const uint3& a) { - return make_uint3(a.x * s, a.y * s, a.z * s); + return ::make_uint3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(uint3& a, const unsigned int s) { @@ -1480,15 +1508,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(uint3& a, const unsigned int s) */ OTK_INLINE OTK_HOSTDEVICE uint3 operator/(const uint3& a, const uint3& b) { - return make_uint3(a.x / b.x, a.y / b.y, a.z / b.z); + return ::make_uint3(a.x / b.x, a.y / b.y, a.z / b.z); } OTK_INLINE OTK_HOSTDEVICE uint3 operator/(const uint3& a, const unsigned int s) { - return make_uint3(a.x / s, a.y / s, a.z / s); + return ::make_uint3(a.x / s, a.y / s, a.z / s); } OTK_INLINE OTK_HOSTDEVICE uint3 operator/(const unsigned int s, const uint3& a) { - return make_uint3(s / a.x, s / a.y, s / a.z); + return ::make_uint3(s / a.x, s / a.y, s / a.z); } OTK_INLINE OTK_HOSTDEVICE void operator/=(uint3& a, const unsigned int s) { @@ -1501,12 +1529,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(uint3& a, const unsigned int s) */ OTK_INLINE OTK_HOSTDEVICE uint3 clamp(const uint3& v, const unsigned int a, const unsigned int b) { - return make_uint3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); + return ::make_uint3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); } OTK_INLINE OTK_HOSTDEVICE uint3 clamp(const uint3& v, const uint3& a, const uint3& b) { - return make_uint3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); + return ::make_uint3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); } /** @} */ @@ -1547,11 +1575,11 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(uint3& v, int i, unsigned int x) */ OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int s) { - return make_uint4(s, s, s, s); + return ::make_uint4(s, s, s, s); } OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const float4& a) { - return make_uint4((unsigned int)a.x, (unsigned int)a.y, (unsigned int)a.z, (unsigned int)a.w); + return ::make_uint4((unsigned int)a.x, (unsigned int)a.y, (unsigned int)a.z, (unsigned int)a.w); } /** @} */ @@ -1560,7 +1588,7 @@ OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const float4& a) */ OTK_INLINE OTK_HOSTDEVICE uint4 min(const uint4& a, const uint4& b) { - return make_uint4(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z), min(a.w,b.w)); + return ::make_uint4(min(a.x,b.x), min(a.y,b.y), min(a.z,b.z), min(a.w,b.w)); } /** @} */ @@ -1569,7 +1597,7 @@ OTK_INLINE OTK_HOSTDEVICE uint4 min(const uint4& a, const uint4& b) */ OTK_INLINE OTK_HOSTDEVICE uint4 max(const uint4& a, const uint4& b) { - return make_uint4(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z), max(a.w,b.w)); + return ::make_uint4(max(a.x,b.x), max(a.y,b.y), max(a.z,b.z), max(a.w,b.w)); } /** @} */ @@ -1578,7 +1606,7 @@ OTK_INLINE OTK_HOSTDEVICE uint4 max(const uint4& a, const uint4& b) */ OTK_INLINE OTK_HOSTDEVICE uint4 operator+(const uint4& a, const uint4& b) { - return make_uint4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return ::make_uint4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } OTK_INLINE OTK_HOSTDEVICE void operator+=(uint4& a, const uint4& b) { @@ -1591,7 +1619,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(uint4& a, const uint4& b) */ OTK_INLINE OTK_HOSTDEVICE uint4 operator-(const uint4& a, const uint4& b) { - return make_uint4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return ::make_uint4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } OTK_INLINE OTK_HOSTDEVICE void operator-=(uint4& a, const uint4& b) @@ -1605,15 +1633,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(uint4& a, const uint4& b) */ OTK_INLINE OTK_HOSTDEVICE uint4 operator*(const uint4& a, const uint4& b) { - return make_uint4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + return ::make_uint4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } OTK_INLINE OTK_HOSTDEVICE uint4 operator*(const uint4& a, const unsigned int s) { - return make_uint4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_uint4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE uint4 operator*(const unsigned int s, const uint4& a) { - return make_uint4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_uint4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(uint4& a, const unsigned int s) { @@ -1626,15 +1654,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(uint4& a, const unsigned int s) */ OTK_INLINE OTK_HOSTDEVICE uint4 operator/(const uint4& a, const uint4& b) { - return make_uint4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return ::make_uint4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } OTK_INLINE OTK_HOSTDEVICE uint4 operator/(const uint4& a, const unsigned int s) { - return make_uint4(a.x / s, a.y / s, a.z / s, a.w / s); + return ::make_uint4(a.x / s, a.y / s, a.z / s, a.w / s); } OTK_INLINE OTK_HOSTDEVICE uint4 operator/(const unsigned int s, const uint4& a) { - return make_uint4(s / a.x, s / a.y, s / a.z, s / a.w); + return ::make_uint4(s / a.x, s / a.y, s / a.z, s / a.w); } OTK_INLINE OTK_HOSTDEVICE void operator/=(uint4& a, const unsigned int s) { @@ -1647,12 +1675,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(uint4& a, const unsigned int s) */ OTK_INLINE OTK_HOSTDEVICE uint4 clamp(const uint4& v, const unsigned int a, const unsigned int b) { - return make_uint4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); + return ::make_uint4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); } OTK_INLINE OTK_HOSTDEVICE uint4 clamp(const uint4& v, const uint4& a, const uint4& b) { - 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)); + 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)); } /** @} */ @@ -1714,30 +1742,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(longlong1& v, int i, long long x) */ OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const long long s) { - return make_longlong2(s, s); + return ::make_longlong2(s, s); } OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const float2& a) { - return make_longlong2(int(a.x), int(a.y)); + return ::make_longlong2(int(a.x), int(a.y)); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE longlong2 operator-(const longlong2& a) { - return make_longlong2(-a.x, -a.y); + return ::make_longlong2(-a.x, -a.y); } /** min */ OTK_INLINE OTK_HOSTDEVICE longlong2 min(const longlong2& a, const longlong2& b) { - return make_longlong2(min(a.x, b.x), min(a.y, b.y)); + return ::make_longlong2(min(a.x, b.x), min(a.y, b.y)); } /** max */ OTK_INLINE OTK_HOSTDEVICE longlong2 max(const longlong2& a, const longlong2& b) { - return make_longlong2(max(a.x, b.x), max(a.y, b.y)); + return ::make_longlong2(max(a.x, b.x), max(a.y, b.y)); } /** add @@ -1745,7 +1773,7 @@ OTK_INLINE OTK_HOSTDEVICE longlong2 max(const longlong2& a, const longlong2& b) */ OTK_INLINE OTK_HOSTDEVICE longlong2 operator+(const longlong2& a, const longlong2& b) { - return make_longlong2(a.x + b.x, a.y + b.y); + return ::make_longlong2(a.x + b.x, a.y + b.y); } OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong2& a, const longlong2& b) { @@ -1758,11 +1786,11 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong2& a, const longlong2& b) */ OTK_INLINE OTK_HOSTDEVICE longlong2 operator-(const longlong2& a, const longlong2& b) { - return make_longlong2(a.x - b.x, a.y - b.y); + return ::make_longlong2(a.x - b.x, a.y - b.y); } OTK_INLINE OTK_HOSTDEVICE longlong2 operator-(const longlong2& a, const long long b) { - return make_longlong2(a.x - b, a.y - b); + return ::make_longlong2(a.x - b, a.y - b); } OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong2& a, const longlong2& b) { @@ -1775,15 +1803,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong2& a, const longlong2& b) */ OTK_INLINE OTK_HOSTDEVICE longlong2 operator*(const longlong2& a, const longlong2& b) { - return make_longlong2(a.x * b.x, a.y * b.y); + return ::make_longlong2(a.x * b.x, a.y * b.y); } OTK_INLINE OTK_HOSTDEVICE longlong2 operator*(const longlong2& a, const long long s) { - return make_longlong2(a.x * s, a.y * s); + return ::make_longlong2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE longlong2 operator*(const long long s, const longlong2& a) { - return make_longlong2(a.x * s, a.y * s); + return ::make_longlong2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong2& a, const long long s) { @@ -1796,12 +1824,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong2& a, const long long s) */ OTK_INLINE OTK_HOSTDEVICE longlong2 clamp(const longlong2& v, const long long a, const long long b) { - return make_longlong2(clamp(v.x, a, b), clamp(v.y, a, b)); + return ::make_longlong2(clamp(v.x, a, b), clamp(v.y, a, b)); } OTK_INLINE OTK_HOSTDEVICE longlong2 clamp(const longlong2& v, const longlong2& a, const longlong2& b) { - return make_longlong2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); + return ::make_longlong2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); } /** @} */ @@ -1840,30 +1868,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(longlong2& v, int i, long long x) */ OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const long long s) { - return make_longlong3(s, s, s); + return ::make_longlong3(s, s, s); } OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const float3& a) { - return make_longlong3( (long long)a.x, (long long)a.y, (long long)a.z); + return ::make_longlong3( (long long)a.x, (long long)a.y, (long long)a.z); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE longlong3 operator-(const longlong3& a) { - return make_longlong3(-a.x, -a.y, -a.z); + return ::make_longlong3(-a.x, -a.y, -a.z); } /** min */ OTK_INLINE OTK_HOSTDEVICE longlong3 min(const longlong3& a, const longlong3& b) { - return make_longlong3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); + return ::make_longlong3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); } /** max */ OTK_INLINE OTK_HOSTDEVICE longlong3 max(const longlong3& a, const longlong3& b) { - return make_longlong3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); + return ::make_longlong3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); } /** add @@ -1871,7 +1899,7 @@ OTK_INLINE OTK_HOSTDEVICE longlong3 max(const longlong3& a, const longlong3& b) */ OTK_INLINE OTK_HOSTDEVICE longlong3 operator+(const longlong3& a, const longlong3& b) { - return make_longlong3(a.x + b.x, a.y + b.y, a.z + b.z); + return ::make_longlong3(a.x + b.x, a.y + b.y, a.z + b.z); } OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong3& a, const longlong3& b) { @@ -1884,7 +1912,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong3& a, const longlong3& b) */ OTK_INLINE OTK_HOSTDEVICE longlong3 operator-(const longlong3& a, const longlong3& b) { - return make_longlong3(a.x - b.x, a.y - b.y, a.z - b.z); + return ::make_longlong3(a.x - b.x, a.y - b.y, a.z - b.z); } OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong3& a, const longlong3& b) @@ -1898,15 +1926,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong3& a, const longlong3& b) */ OTK_INLINE OTK_HOSTDEVICE longlong3 operator*(const longlong3& a, const longlong3& b) { - return make_longlong3(a.x * b.x, a.y * b.y, a.z * b.z); + return ::make_longlong3(a.x * b.x, a.y * b.y, a.z * b.z); } OTK_INLINE OTK_HOSTDEVICE longlong3 operator*(const longlong3& a, const long long s) { - return make_longlong3(a.x * s, a.y * s, a.z * s); + return ::make_longlong3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE longlong3 operator*(const long long s, const longlong3& a) { - return make_longlong3(a.x * s, a.y * s, a.z * s); + return ::make_longlong3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong3& a, const long long s) { @@ -1919,15 +1947,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong3& a, const long long s) */ OTK_INLINE OTK_HOSTDEVICE longlong3 operator/(const longlong3& a, const longlong3& b) { - return make_longlong3(a.x / b.x, a.y / b.y, a.z / b.z); + return ::make_longlong3(a.x / b.x, a.y / b.y, a.z / b.z); } OTK_INLINE OTK_HOSTDEVICE longlong3 operator/(const longlong3& a, const long long s) { - return make_longlong3(a.x / s, a.y / s, a.z / s); + return ::make_longlong3(a.x / s, a.y / s, a.z / s); } OTK_INLINE OTK_HOSTDEVICE longlong3 operator/(const long long s, const longlong3& a) { - return make_longlong3(s /a.x, s / a.y, s / a.z); + return ::make_longlong3(s /a.x, s / a.y, s / a.z); } OTK_INLINE OTK_HOSTDEVICE void operator/=(longlong3& a, const long long s) { @@ -1940,12 +1968,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(longlong3& a, const long long s) */ OTK_INLINE OTK_HOSTDEVICE longlong3 clamp(const longlong3& v, const long long a, const long long b) { - return make_longlong3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); + return ::make_longlong3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); } OTK_INLINE OTK_HOSTDEVICE longlong3 clamp(const longlong3& v, const longlong3& a, const longlong3& b) { - return make_longlong3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); + return ::make_longlong3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); } /** @} */ @@ -1984,30 +2012,30 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(longlong3& v, int i, int x) */ OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long s) { - return make_longlong4(s, s, s, s); + return ::make_longlong4(s, s, s, s); } OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const float4& a) { - return make_longlong4((long long)a.x, (long long)a.y, (long long)a.z, (long long)a.w); + return ::make_longlong4((long long)a.x, (long long)a.y, (long long)a.z, (long long)a.w); } /** @} */ /** negate */ OTK_INLINE OTK_HOSTDEVICE longlong4 operator-(const longlong4& a) { - return make_longlong4(-a.x, -a.y, -a.z, -a.w); + return ::make_longlong4(-a.x, -a.y, -a.z, -a.w); } /** min */ OTK_INLINE OTK_HOSTDEVICE longlong4 min(const longlong4& a, const longlong4& b) { - return make_longlong4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); + return ::make_longlong4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); } /** max */ OTK_INLINE OTK_HOSTDEVICE longlong4 max(const longlong4& a, const longlong4& b) { - return make_longlong4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); + return ::make_longlong4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); } /** add @@ -2015,7 +2043,7 @@ OTK_INLINE OTK_HOSTDEVICE longlong4 max(const longlong4& a, const longlong4& b) */ OTK_INLINE OTK_HOSTDEVICE longlong4 operator+(const longlong4& a, const longlong4& b) { - return make_longlong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return ::make_longlong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong4& a, const longlong4& b) { @@ -2028,7 +2056,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(longlong4& a, const longlong4& b) */ OTK_INLINE OTK_HOSTDEVICE longlong4 operator-(const longlong4& a, const longlong4& b) { - return make_longlong4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return ::make_longlong4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong4& a, const longlong4& b) @@ -2042,15 +2070,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(longlong4& a, const longlong4& b) */ OTK_INLINE OTK_HOSTDEVICE longlong4 operator*(const longlong4& a, const longlong4& b) { - return make_longlong4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + return ::make_longlong4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } OTK_INLINE OTK_HOSTDEVICE longlong4 operator*(const longlong4& a, const long long s) { - return make_longlong4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_longlong4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE longlong4 operator*(const long long s, const longlong4& a) { - return make_longlong4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_longlong4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong4& a, const long long s) { @@ -2063,15 +2091,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(longlong4& a, const long long s) */ OTK_INLINE OTK_HOSTDEVICE longlong4 operator/(const longlong4& a, const longlong4& b) { - return make_longlong4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return ::make_longlong4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } OTK_INLINE OTK_HOSTDEVICE longlong4 operator/(const longlong4& a, const long long s) { - return make_longlong4(a.x / s, a.y / s, a.z / s, a.w / s); + return ::make_longlong4(a.x / s, a.y / s, a.z / s, a.w / s); } OTK_INLINE OTK_HOSTDEVICE longlong4 operator/(const long long s, const longlong4& a) { - return make_longlong4(s / a.x, s / a.y, s / a.z, s / a.w); + return ::make_longlong4(s / a.x, s / a.y, s / a.z, s / a.w); } OTK_INLINE OTK_HOSTDEVICE void operator/=(longlong4& a, const long long s) { @@ -2084,12 +2112,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(longlong4& a, const long long s) */ OTK_INLINE OTK_HOSTDEVICE longlong4 clamp(const longlong4& v, const long long a, const long long b) { - return make_longlong4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); + return ::make_longlong4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); } OTK_INLINE OTK_HOSTDEVICE longlong4 clamp(const longlong4& v, const longlong4& a, const longlong4& b) { - return make_longlong4(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)); + return ::make_longlong4(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)); } /** @} */ @@ -2149,24 +2177,24 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(ulonglong1& v, int i, unsigned long lo */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const unsigned long long s) { - return make_ulonglong2(s, s); + return ::make_ulonglong2(s, s); } OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const float2& a) { - return make_ulonglong2((unsigned long long)a.x, (unsigned long long)a.y); + return ::make_ulonglong2((unsigned long long)a.x, (unsigned long long)a.y); } /** @} */ /** min */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 min(const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(min(a.x, b.x), min(a.y, b.y)); + return ::make_ulonglong2(min(a.x, b.x), min(a.y, b.y)); } /** max */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 max(const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(max(a.x, b.x), max(a.y, b.y)); + return ::make_ulonglong2(max(a.x, b.x), max(a.y, b.y)); } /** add @@ -2174,7 +2202,7 @@ OTK_INLINE OTK_HOSTDEVICE ulonglong2 max(const ulonglong2& a, const ulonglong2& */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator+(const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(a.x + b.x, a.y + b.y); + return ::make_ulonglong2(a.x + b.x, a.y + b.y); } OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong2& a, const ulonglong2& b) { @@ -2187,11 +2215,11 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong2& a, const ulonglong2& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator-(const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(a.x - b.x, a.y - b.y); + return ::make_ulonglong2(a.x - b.x, a.y - b.y); } OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator-(const ulonglong2& a, const unsigned long long b) { - return make_ulonglong2(a.x - b, a.y - b); + return ::make_ulonglong2(a.x - b, a.y - b); } OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong2& a, const ulonglong2& b) { @@ -2204,15 +2232,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong2& a, const ulonglong2& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator*(const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(a.x * b.x, a.y * b.y); + return ::make_ulonglong2(a.x * b.x, a.y * b.y); } OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator*(const ulonglong2& a, const unsigned long long s) { - return make_ulonglong2(a.x * s, a.y * s); + return ::make_ulonglong2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE ulonglong2 operator*(const unsigned long long s, const ulonglong2& a) { - return make_ulonglong2(a.x * s, a.y * s); + return ::make_ulonglong2(a.x * s, a.y * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong2& a, const unsigned long long s) { @@ -2225,12 +2253,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong2& a, const unsigned long lon */ OTK_INLINE OTK_HOSTDEVICE ulonglong2 clamp(const ulonglong2& v, const unsigned long long a, const unsigned long long b) { - return make_ulonglong2(clamp(v.x, a, b), clamp(v.y, a, b)); + return ::make_ulonglong2(clamp(v.x, a, b), clamp(v.y, a, b)); } OTK_INLINE OTK_HOSTDEVICE ulonglong2 clamp(const ulonglong2& v, const ulonglong2& a, const ulonglong2& b) { - return make_ulonglong2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); + return ::make_ulonglong2(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y)); } /** @} */ @@ -2269,24 +2297,24 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(ulonglong2& v, int i, unsigned long lo */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const unsigned long long s) { - return make_ulonglong3(s, s, s); + return ::make_ulonglong3(s, s, s); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const float3& a) { - return make_ulonglong3((unsigned long long)a.x, (unsigned long long)a.y, (unsigned long long)a.z); + return ::make_ulonglong3((unsigned long long)a.x, (unsigned long long)a.y, (unsigned long long)a.z); } /** @} */ /** min */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 min(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); + return ::make_ulonglong3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); } /** max */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 max(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); + return ::make_ulonglong3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); } /** add @@ -2294,7 +2322,7 @@ OTK_INLINE OTK_HOSTDEVICE ulonglong3 max(const ulonglong3& a, const ulonglong3& */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator+(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(a.x + b.x, a.y + b.y, a.z + b.z); + return ::make_ulonglong3(a.x + b.x, a.y + b.y, a.z + b.z); } OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong3& a, const ulonglong3& b) { @@ -2307,7 +2335,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong3& a, const ulonglong3& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator-(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(a.x - b.x, a.y - b.y, a.z - b.z); + return ::make_ulonglong3(a.x - b.x, a.y - b.y, a.z - b.z); } OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong3& a, const ulonglong3& b) @@ -2321,15 +2349,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong3& a, const ulonglong3& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator*(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(a.x * b.x, a.y * b.y, a.z * b.z); + return ::make_ulonglong3(a.x * b.x, a.y * b.y, a.z * b.z); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator*(const ulonglong3& a, const unsigned long long s) { - return make_ulonglong3(a.x * s, a.y * s, a.z * s); + return ::make_ulonglong3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator*(const unsigned long long s, const ulonglong3& a) { - return make_ulonglong3(a.x * s, a.y * s, a.z * s); + return ::make_ulonglong3(a.x * s, a.y * s, a.z * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong3& a, const unsigned long long s) { @@ -2342,15 +2370,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong3& a, const unsigned long lon */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator/(const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(a.x / b.x, a.y / b.y, a.z / b.z); + return ::make_ulonglong3(a.x / b.x, a.y / b.y, a.z / b.z); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator/(const ulonglong3& a, const unsigned long long s) { - return make_ulonglong3(a.x / s, a.y / s, a.z / s); + return ::make_ulonglong3(a.x / s, a.y / s, a.z / s); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 operator/(const unsigned long long s, const ulonglong3& a) { - return make_ulonglong3(s / a.x, s / a.y, s / a.z); + return ::make_ulonglong3(s / a.x, s / a.y, s / a.z); } OTK_INLINE OTK_HOSTDEVICE void operator/=(ulonglong3& a, const unsigned long long s) { @@ -2363,12 +2391,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(ulonglong3& a, const unsigned long lon */ OTK_INLINE OTK_HOSTDEVICE ulonglong3 clamp(const ulonglong3& v, const unsigned long long a, const unsigned long long b) { - return make_ulonglong3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); + return ::make_ulonglong3(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b)); } OTK_INLINE OTK_HOSTDEVICE ulonglong3 clamp(const ulonglong3& v, const ulonglong3& a, const ulonglong3& b) { - return make_ulonglong3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); + return ::make_ulonglong3(clamp(v.x, a.x, b.x), clamp(v.y, a.y, b.y), clamp(v.z, a.z, b.z)); } /** @} */ @@ -2409,11 +2437,11 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(ulonglong3& v, int i, unsigned long lo */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long s) { - return make_ulonglong4(s, s, s, s); + return ::make_ulonglong4(s, s, s, s); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const float4& a) { - return make_ulonglong4((unsigned long long)a.x, (unsigned long long)a.y, (unsigned long long)a.z, (unsigned long long)a.w); + return ::make_ulonglong4((unsigned long long)a.x, (unsigned long long)a.y, (unsigned long long)a.z, (unsigned long long)a.w); } /** @} */ @@ -2422,7 +2450,7 @@ OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const float4& a) */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 min(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); + return ::make_ulonglong4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); } /** @} */ @@ -2431,7 +2459,7 @@ OTK_INLINE OTK_HOSTDEVICE ulonglong4 min(const ulonglong4& a, const ulonglong4& */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 max(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); + return ::make_ulonglong4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); } /** @} */ @@ -2440,7 +2468,7 @@ OTK_INLINE OTK_HOSTDEVICE ulonglong4 max(const ulonglong4& a, const ulonglong4& */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator+(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + return ::make_ulonglong4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong4& a, const ulonglong4& b) { @@ -2453,7 +2481,7 @@ OTK_INLINE OTK_HOSTDEVICE void operator+=(ulonglong4& a, const ulonglong4& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator-(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + return ::make_ulonglong4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong4& a, const ulonglong4& b) @@ -2467,15 +2495,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator-=(ulonglong4& a, const ulonglong4& b) */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator*(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + return ::make_ulonglong4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator*(const ulonglong4& a, const unsigned long long s) { - return make_ulonglong4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_ulonglong4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator*(const unsigned long long s, const ulonglong4& a) { - return make_ulonglong4(a.x * s, a.y * s, a.z * s, a.w * s); + return ::make_ulonglong4(a.x * s, a.y * s, a.z * s, a.w * s); } OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong4& a, const unsigned long long s) { @@ -2488,15 +2516,15 @@ OTK_INLINE OTK_HOSTDEVICE void operator*=(ulonglong4& a, const unsigned long lon */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator/(const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + return ::make_ulonglong4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator/(const ulonglong4& a, const unsigned long long s) { - return make_ulonglong4(a.x / s, a.y / s, a.z / s, a.w / s); + return ::make_ulonglong4(a.x / s, a.y / s, a.z / s, a.w / s); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 operator/(const unsigned long long s, const ulonglong4& a) { - return make_ulonglong4(s / a.x, s / a.y, s / a.z, s / a.w); + return ::make_ulonglong4(s / a.x, s / a.y, s / a.z, s / a.w); } OTK_INLINE OTK_HOSTDEVICE void operator/=(ulonglong4& a, const unsigned long long s) { @@ -2509,12 +2537,12 @@ OTK_INLINE OTK_HOSTDEVICE void operator/=(ulonglong4& a, const unsigned long lon */ OTK_INLINE OTK_HOSTDEVICE ulonglong4 clamp(const ulonglong4& v, const unsigned long long a, const unsigned long long b) { - return make_ulonglong4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); + return ::make_ulonglong4(clamp(v.x, a, b), clamp(v.y, a, b), clamp(v.z, a, b), clamp(v.w, a, b)); } OTK_INLINE OTK_HOSTDEVICE ulonglong4 clamp(const ulonglong4& v, const ulonglong4& a, const ulonglong4& b) { - return make_ulonglong4(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)); + return ::make_ulonglong4(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)); } /** @} */ @@ -2552,66 +2580,66 @@ OTK_INLINE OTK_HOSTDEVICE void setByIndex(ulonglong4& v, int i, unsigned long lo /** Narrowing functions * @{ */ -OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const int3& v0) { return make_int2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const int4& v0) { return make_int2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int4& v0) { return make_int3( v0.x, v0.y, v0.z ); } -OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const uint3& v0) { return make_uint2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const uint4& v0) { return make_uint2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const uint4& v0) { return make_uint3( v0.x, v0.y, v0.z ); } -OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const longlong3& v0) { return make_longlong2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const longlong4& v0) { return make_longlong2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const longlong4& v0) { return make_longlong3( v0.x, v0.y, v0.z ); } -OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const ulonglong3& v0) { return make_ulonglong2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const ulonglong4& v0) { return make_ulonglong2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const ulonglong4& v0) { return make_ulonglong3( v0.x, v0.y, v0.z ); } -OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const float3& v0) { return make_float2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const float4& v0) { return make_float2( v0.x, v0.y ); } -OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float4& v0) { return make_float3( v0.x, v0.y, v0.z ); } +OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const int3& v0) { return ::make_int2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE int2 make_int2(const int4& v0) { return ::make_int2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int4& v0) { return ::make_int3( v0.x, v0.y, v0.z ); } +OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const uint3& v0) { return ::make_uint2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE uint2 make_uint2(const uint4& v0) { return ::make_uint2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const uint4& v0) { return ::make_uint3( v0.x, v0.y, v0.z ); } +OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const longlong3& v0) { return ::make_longlong2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE longlong2 make_longlong2(const longlong4& v0) { return ::make_longlong2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const longlong4& v0) { return ::make_longlong3( v0.x, v0.y, v0.z ); } +OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const ulonglong3& v0) { return ::make_ulonglong2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE ulonglong2 make_ulonglong2(const ulonglong4& v0) { return ::make_ulonglong2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const ulonglong4& v0) { return ::make_ulonglong3( v0.x, v0.y, v0.z ); } +OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const float3& v0) { return ::make_float2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE float2 make_float2(const float4& v0) { return ::make_float2( v0.x, v0.y ); } +OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float4& v0) { return ::make_float3( v0.x, v0.y, v0.z ); } /** @} */ /** Assemble functions from smaller vectors * @{ */ -OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int v0, const int2& v1) { return make_int3( v0, v1.x, v1.y ); } -OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int2& v0, const int v1) { return make_int3( v0.x, v0.y, v1 ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int v1, const int2& v2) { return make_int4( v0, v1, v2.x, v2.y ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int2& v1, const int v2) { return make_int4( v0, v1.x, v1.y, v2 ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int2& v0, const int v1, const int v2) { return make_int4( v0.x, v0.y, v1, v2 ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int3& v1) { return make_int4( v0, v1.x, v1.y, v1.z ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int3& v0, const int v1) { return make_int4( v0.x, v0.y, v0.z, v1 ); } -OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int2& v0, const int2& v1) { return make_int4( v0.x, v0.y, v1.x, v1.y ); } -OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const unsigned int v0, const uint2& v1) { return make_uint3( v0, v1.x, v1.y ); } -OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const uint2& v0, const unsigned int v1) { return make_uint3( v0.x, v0.y, v1 ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const unsigned int v1, const uint2& v2) { return make_uint4( v0, v1, v2.x, v2.y ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const uint2& v1, const unsigned int v2) { return make_uint4( v0, v1.x, v1.y, v2 ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint2& v0, const unsigned int v1, const unsigned int v2) { return make_uint4( v0.x, v0.y, v1, v2 ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const uint3& v1) { return make_uint4( v0, v1.x, v1.y, v1.z ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint3& v0, const unsigned int v1) { return make_uint4( v0.x, v0.y, v0.z, v1 ); } -OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint2& v0, const uint2& v1) { return make_uint4( v0.x, v0.y, v1.x, v1.y ); } -OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const long long v0, const longlong2& v1) { return make_longlong3(v0, v1.x, v1.y); } -OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const longlong2& v0, const long long v1) { return make_longlong3(v0.x, v0.y, v1); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const long long v1, const longlong2& v2) { return make_longlong4(v0, v1, v2.x, v2.y); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const longlong2& v1, const long long v2) { return make_longlong4(v0, v1.x, v1.y, v2); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong2& v0, const long long v1, const long long v2) { return make_longlong4(v0.x, v0.y, v1, v2); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const longlong3& v1) { return make_longlong4(v0, v1.x, v1.y, v1.z); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong3& v0, const long long v1) { return make_longlong4(v0.x, v0.y, v0.z, v1); } -OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong2& v0, const longlong2& v1) { return make_longlong4(v0.x, v0.y, v1.x, v1.y); } -OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const unsigned long long v0, const ulonglong2& v1) { return make_ulonglong3(v0, v1.x, v1.y); } -OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const ulonglong2& v0, const unsigned long long v1) { return make_ulonglong3(v0.x, v0.y, v1); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const unsigned long long v1, const ulonglong2& v2) { return make_ulonglong4(v0, v1, v2.x, v2.y); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const ulonglong2& v1, const unsigned long long v2) { return make_ulonglong4(v0, v1.x, v1.y, v2); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong2& v0, const unsigned long long v1, const unsigned long long v2) { return make_ulonglong4(v0.x, v0.y, v1, v2); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const ulonglong3& v1) { return make_ulonglong4(v0, v1.x, v1.y, v1.z); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong3& v0, const unsigned long long v1) { return make_ulonglong4(v0.x, v0.y, v0.z, v1); } -OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong2& v0, const ulonglong2& v1) { return make_ulonglong4(v0.x, v0.y, v1.x, v1.y); } -OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float2& v0, const float v1) { return make_float3(v0.x, v0.y, v1); } -OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float v0, const float2& v1) { return make_float3( v0, v1.x, v1.y ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float v1, const float2& v2) { return make_float4( v0, v1, v2.x, v2.y ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float2& v1, const float v2) { return make_float4( v0, v1.x, v1.y, v2 ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float2& v0, const float v1, const float v2) { return make_float4( v0.x, v0.y, v1, v2 ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float3& v1) { return make_float4( v0, v1.x, v1.y, v1.z ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float3& v0, const float v1) { return make_float4( v0.x, v0.y, v0.z, v1 ); } -OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float2& v0, const float2& v1) { return make_float4( v0.x, v0.y, v1.x, v1.y ); } -/** @} */ - - +OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int v0, const int2& v1) { return ::make_int3( v0, v1.x, v1.y ); } +OTK_INLINE OTK_HOSTDEVICE int3 make_int3(const int2& v0, const int v1) { return ::make_int3( v0.x, v0.y, v1 ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int v1, const int2& v2) { return ::make_int4( v0, v1, v2.x, v2.y ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int2& v1, const int v2) { return ::make_int4( v0, v1.x, v1.y, v2 ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int2& v0, const int v1, const int v2) { return ::make_int4( v0.x, v0.y, v1, v2 ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int v0, const int3& v1) { return ::make_int4( v0, v1.x, v1.y, v1.z ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int3& v0, const int v1) { return ::make_int4( v0.x, v0.y, v0.z, v1 ); } +OTK_INLINE OTK_HOSTDEVICE int4 make_int4(const int2& v0, const int2& v1) { return ::make_int4( v0.x, v0.y, v1.x, v1.y ); } +OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const unsigned int v0, const uint2& v1) { return ::make_uint3( v0, v1.x, v1.y ); } +OTK_INLINE OTK_HOSTDEVICE uint3 make_uint3(const uint2& v0, const unsigned int v1) { return ::make_uint3( v0.x, v0.y, v1 ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const unsigned int v1, const uint2& v2) { return ::make_uint4( v0, v1, v2.x, v2.y ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const uint2& v1, const unsigned int v2) { return ::make_uint4( v0, v1.x, v1.y, v2 ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint2& v0, const unsigned int v1, const unsigned int v2) { return ::make_uint4( v0.x, v0.y, v1, v2 ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const unsigned int v0, const uint3& v1) { return ::make_uint4( v0, v1.x, v1.y, v1.z ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint3& v0, const unsigned int v1) { return ::make_uint4( v0.x, v0.y, v0.z, v1 ); } +OTK_INLINE OTK_HOSTDEVICE uint4 make_uint4(const uint2& v0, const uint2& v1) { return ::make_uint4( v0.x, v0.y, v1.x, v1.y ); } +OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const long long v0, const longlong2& v1) { return ::make_longlong3(v0, v1.x, v1.y); } +OTK_INLINE OTK_HOSTDEVICE longlong3 make_longlong3(const longlong2& v0, const long long v1) { return ::make_longlong3(v0.x, v0.y, v1); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const long long v1, const longlong2& v2) { return ::make_longlong4(v0, v1, v2.x, v2.y); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const longlong2& v1, const long long v2) { return ::make_longlong4(v0, v1.x, v1.y, v2); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong2& v0, const long long v1, const long long v2) { return ::make_longlong4(v0.x, v0.y, v1, v2); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const long long v0, const longlong3& v1) { return ::make_longlong4(v0, v1.x, v1.y, v1.z); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong3& v0, const long long v1) { return ::make_longlong4(v0.x, v0.y, v0.z, v1); } +OTK_INLINE OTK_HOSTDEVICE longlong4 make_longlong4(const longlong2& v0, const longlong2& v1) { return ::make_longlong4(v0.x, v0.y, v1.x, v1.y); } +OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const unsigned long long v0, const ulonglong2& v1) { return ::make_ulonglong3(v0, v1.x, v1.y); } +OTK_INLINE OTK_HOSTDEVICE ulonglong3 make_ulonglong3(const ulonglong2& v0, const unsigned long long v1) { return ::make_ulonglong3(v0.x, v0.y, v1); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const unsigned long long v1, const ulonglong2& v2) { return ::make_ulonglong4(v0, v1, v2.x, v2.y); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const ulonglong2& v1, const unsigned long long v2) { return ::make_ulonglong4(v0, v1.x, v1.y, v2); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong2& v0, const unsigned long long v1, const unsigned long long v2) { return ::make_ulonglong4(v0.x, v0.y, v1, v2); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const unsigned long long v0, const ulonglong3& v1) { return ::make_ulonglong4(v0, v1.x, v1.y, v1.z); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong3& v0, const unsigned long long v1) { return ::make_ulonglong4(v0.x, v0.y, v0.z, v1); } +OTK_INLINE OTK_HOSTDEVICE ulonglong4 make_ulonglong4(const ulonglong2& v0, const ulonglong2& v1) { return ::make_ulonglong4(v0.x, v0.y, v1.x, v1.y); } +OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float2& v0, const float v1) { return ::make_float3(v0.x, v0.y, v1); } +OTK_INLINE OTK_HOSTDEVICE float3 make_float3(const float v0, const float2& v1) { return ::make_float3( v0, v1.x, v1.y ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float v1, const float2& v2) { return ::make_float4( v0, v1, v2.x, v2.y ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float2& v1, const float v2) { return ::make_float4( v0, v1.x, v1.y, v2 ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float2& v0, const float v1, const float v2) { return ::make_float4( v0.x, v0.y, v1, v2 ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float v0, const float3& v1) { return ::make_float4( v0, v1.x, v1.y, v1.z ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float3& v0, const float v1) { return ::make_float4( v0.x, v0.y, v0.z, v1 ); } +OTK_INLINE OTK_HOSTDEVICE float4 make_float4(const float2& v0, const float2& v1) { return ::make_float4( v0.x, v0.y, v1.x, v1.y ); } +/** @} */ + +} // namespace otk diff --git a/tests/testSiaCuda.cu b/tests/testSiaCuda.cu index ae0fb1e..083e31d 100644 --- a/tests/testSiaCuda.cu +++ b/tests/testSiaCuda.cu @@ -32,6 +32,8 @@ #include +using namespace otk; // for vec_math operators + __forceinline__ __device__ unsigned lane_id() { unsigned ret; diff --git a/tests/testSiaOptix.cu b/tests/testSiaOptix.cu index f19a758..44db362 100644 --- a/tests/testSiaOptix.cu +++ b/tests/testSiaOptix.cu @@ -35,6 +35,8 @@ #include #include +using namespace otk; // for vec_math operators + extern "C" { __constant__ Params params; }