Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_math_int2.h
| Show All 21 Lines | |||||
| #endif | #endif | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /******************************************************************************* | /******************************************************************************* | ||||
| * Declaration. | * Declaration. | ||||
| */ | */ | ||||
| #ifndef __KERNEL_OPENCL__ | |||||
| ccl_device_inline bool operator==(const int2 a, const int2 b); | ccl_device_inline bool operator==(const int2 a, const int2 b); | ||||
| ccl_device_inline int2 operator+(const int2 &a, const int2 &b); | ccl_device_inline int2 operator+(const int2 &a, const int2 &b); | ||||
| ccl_device_inline int2 operator+=(int2 &a, const int2 &b); | ccl_device_inline int2 operator+=(int2 &a, const int2 &b); | ||||
| ccl_device_inline int2 operator-(const int2 &a, const int2 &b); | ccl_device_inline int2 operator-(const int2 &a, const int2 &b); | ||||
| ccl_device_inline int2 operator*(const int2 &a, const int2 &b); | ccl_device_inline int2 operator*(const int2 &a, const int2 &b); | ||||
| ccl_device_inline int2 operator/(const int2 &a, const int2 &b); | ccl_device_inline int2 operator/(const int2 &a, const int2 &b); | ||||
| #endif /* !__KERNEL_OPENCL__ */ | |||||
| /******************************************************************************* | /******************************************************************************* | ||||
| * Definition. | * Definition. | ||||
| */ | */ | ||||
| #ifndef __KERNEL_OPENCL__ | |||||
| ccl_device_inline bool operator==(const int2 a, const int2 b) | ccl_device_inline bool operator==(const int2 a, const int2 b) | ||||
| { | { | ||||
| return (a.x == b.x && a.y == b.y); | return (a.x == b.x && a.y == b.y); | ||||
| } | } | ||||
| ccl_device_inline int2 operator+(const int2 &a, const int2 &b) | ccl_device_inline 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); | ||||
| Show All 13 Lines | |||||
| { | { | ||||
| return make_int2(a.x * b.x, a.y * b.y); | return make_int2(a.x * b.x, a.y * b.y); | ||||
| } | } | ||||
| ccl_device_inline int2 operator/(const int2 &a, const int2 &b) | ccl_device_inline 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); | ||||
| } | } | ||||
| #endif /* !__KERNEL_OPENCL__ */ | |||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __UTIL_MATH_INT2_H__ */ | #endif /* __UTIL_MATH_INT2_H__ */ | ||||