[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libclc / generic / lib / geometric / cross.cl
blob3b4ca6cafae9a8fa4959da9be4ebe2a78d67c4fd
1 #include <clc/clc.h>
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);
13 #ifdef cl_khr_fp64
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);
25 #endif