Files
clang-p2996/libclc/opencl/lib/generic/integer/upsample.cl
Fraser Cormack 32cf55aef3 [libclc] Reorganize OpenCL builtins (#140557)
This commits moves all OpenCL builtins under a top-level 'opencl'
directory, akin to how the CLC builtins are organized. This new
structure aims to better convey the separation of the two layers and
that 'CLC' is not a subset of OpenCL or a libclc target.

In doing so this commit moves the location of the 'lib' directory to
match CLC: libclc/generic/lib/ becomes libclc/opencl/lib/generic/. This
allows us to remove some special casing in CMake and ensure a common
directory structure.

It also tries to better communicate that the OpenCL headers are
libclc-specific OpenCL headers and should not be confused with or used
as standard OpenCL headers. It does so by ensuring includes are of the
form <clc/opencl/*>. It might be that we don't specifically need the
libclc OpenCL headers and we simply could use clang's built-in
declarations, but we can revisit that later.

Aside from the code move, there is some code formatting and updating a
couple of OpenCL builtin includes to use the readily available gentype
helpers. This allows us to remove some '.inc' files.
2025-05-20 09:51:30 +01:00

45 lines
2.5 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/integer/clc_upsample.h>
#include <clc/opencl/clc.h>
#define __CLC_UPSAMPLE_IMPL(BGENTYPE, GENTYPE, UGENTYPE) \
_CLC_OVERLOAD _CLC_DEF BGENTYPE upsample(GENTYPE hi, UGENTYPE lo) { \
return __clc_upsample(hi, lo); \
} \
_CLC_OVERLOAD _CLC_DEF BGENTYPE##2 upsample(GENTYPE##2 hi, UGENTYPE##2 lo) { \
return __clc_upsample(hi, lo); \
} \
_CLC_OVERLOAD _CLC_DEF BGENTYPE##3 upsample(GENTYPE##3 hi, UGENTYPE##3 lo) { \
return __clc_upsample(hi, lo); \
} \
_CLC_OVERLOAD _CLC_DEF BGENTYPE##4 upsample(GENTYPE##4 hi, UGENTYPE##4 lo) { \
return __clc_upsample(hi, lo); \
} \
_CLC_OVERLOAD _CLC_DEF BGENTYPE##8 upsample(GENTYPE##8 hi, UGENTYPE##8 lo) { \
return __clc_upsample(hi, lo); \
} \
_CLC_OVERLOAD _CLC_DEF BGENTYPE##16 upsample(GENTYPE##16 hi, \
UGENTYPE##16 lo) { \
return __clc_upsample(hi, lo); \
}
#define __CLC_UPSAMPLE_TYPES() \
__CLC_UPSAMPLE_IMPL(short, char, uchar) \
__CLC_UPSAMPLE_IMPL(ushort, uchar, uchar) \
__CLC_UPSAMPLE_IMPL(int, short, ushort) \
__CLC_UPSAMPLE_IMPL(uint, ushort, ushort) \
__CLC_UPSAMPLE_IMPL(long, int, uint) \
__CLC_UPSAMPLE_IMPL(ulong, uint, uint)
__CLC_UPSAMPLE_TYPES()
#undef __CLC_UPSAMPLE_TYPES
#undef __CLC_UPSAMPLE_IMPL