3 _CLC_OVERLOAD _CLC_DEF float3 cross
(float3 p0
, float3 p1
) {
4 return
(float3)(p0.y
*p1.z - p0.z
*p1.y
, p0.z
*p1.x - p0.x
*p1.z
,
5 p0.x
*p1.y - p0.y
*p1.x
);
8 _CLC_OVERLOAD _CLC_DEF float4 cross
(float4 p0
, float4 p1
) {
9 return
(float4)(p0.y
*p1.z - p0.z
*p1.y
, p0.z
*p1.x - p0.x
*p1.z
,
10 p0.x
*p1.y - p0.y
*p1.x
, 0.f
);
14 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
16 _CLC_OVERLOAD _CLC_DEF double3 cross
(double3 p0
, double3 p1
) {
17 return
(double3)(p0.y
*p1.z - p0.z
*p1.y
, p0.z
*p1.x - p0.x
*p1.z
,
18 p0.x
*p1.y - p0.y
*p1.x
);
21 _CLC_OVERLOAD _CLC_DEF double4 cross
(double4 p0
, double4 p1
) {
22 return
(double4)(p0.y
*p1.z - p0.z
*p1.y
, p0.z
*p1.x - p0.x
*p1.z
,
23 p0.x
*p1.y - p0.y
*p1.x
, 0.f
);