Files
clang-p2996/libclc/generic/lib/geometric/cross.cl
Fraser Cormack 7a4af40896 [libclc] Move cross to CLC library; add missing half overloads (#139713)
The half overloads are trivially identical to the float and double ones.

It didn't seem worth using 'gentype' for the OpenCL layer or CLC
declarations so they're just written out explicitly. It does help avoid
less trivial repetition in the CLC implementation, though.
2025-05-13 17:07:07 +01:00

45 lines
1.1 KiB
Common Lisp

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#include <clc/geometric/clc_cross.h>
_CLC_OVERLOAD _CLC_DEF float3 cross(float3 p0, float3 p1) {
return __clc_cross(p0, p1);
}
_CLC_OVERLOAD _CLC_DEF float4 cross(float4 p0, float4 p1) {
return __clc_cross(p0, p1);
}
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
_CLC_OVERLOAD _CLC_DEF double3 cross(double3 p0, double3 p1) {
return __clc_cross(p0, p1);
}
_CLC_OVERLOAD _CLC_DEF double4 cross(double4 p0, double4 p1) {
return __clc_cross(p0, p1);
}
#endif
#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
_CLC_OVERLOAD _CLC_DEF half3 cross(half3 p0, half3 p1) {
return __clc_cross(p0, p1);
}
_CLC_OVERLOAD _CLC_DEF half4 cross(half4 p0, half4 p1) {
return __clc_cross(p0, p1);
}
#endif