Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions libclc/opencl/include/clc/opencl/clc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,7 @@

#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#endif

/* Function Attributes */
#include <clc/clcfunc.h>

/* 6.1 Supported Data Types */
#include <clc/clctypes.h>
#include <clc/opencl/opencl-base.h>

/* 6.2.3 Explicit Conversions */
#include <clc/opencl/convert.h>
Expand Down
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/abs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_ABS_H__
#define __CLC_OPENCL_INTEGER_ABS_H__

#include <clc/opencl/opencl-base.h>

#define __CLC_BODY <clc/opencl/integer/abs.inc>
#include <clc/integer/gentype.inc>

#endif // __CLC_OPENCL_INTEGER_ABS_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/abs_diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_ABS_DIFF_H__
#define __CLC_OPENCL_INTEGER_ABS_DIFF_H__

#include <clc/opencl/opencl-base.h>

#define __CLC_BODY <clc/opencl/integer/abs_diff.inc>
#include <clc/integer/gentype.inc>

#endif // __CLC_OPENCL_INTEGER_ABS_DIFF_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/add_sat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_ADD_SAT_H__
#define __CLC_OPENCL_INTEGER_ADD_SAT_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION add_sat
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_ADD_SAT_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/clz.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_CLZ_H__
#define __CLC_OPENCL_INTEGER_CLZ_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION clz
#define __CLC_BODY <clc/shared/unary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_CLZ_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/ctz.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_CTZ_H__
#define __CLC_OPENCL_INTEGER_CTZ_H__

#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0

#include <clc/opencl/opencl-base.h>

#define FUNCTION ctz
#define __CLC_BODY <clc/shared/unary_decl.inc>

Expand All @@ -16,3 +21,5 @@
#undef FUNCTION

#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0

#endif // __CLC_OPENCL_INTEGER_CTZ_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/hadd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_HADD_H__
#define __CLC_OPENCL_INTEGER_HADD_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION hadd
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_HADD_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/mad24.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_MAD24_H__
#define __CLC_OPENCL_INTEGER_MAD24_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION mad24
#define __CLC_BODY <clc/shared/ternary_decl.inc>

#include <clc/integer/gentype24.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_MAD24_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/mad_hi.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_MAD_HI_H__
#define __CLC_OPENCL_INTEGER_MAD_HI_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION mad_hi
#define __CLC_BODY <clc/shared/ternary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_MAD_HI_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/mad_sat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_MAD_SAT_H__
#define __CLC_OPENCL_INTEGER_MAD_SAT_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION mad_sat
#define __CLC_BODY <clc/shared/ternary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_MAD_SAT_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/mul24.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_MUL24_H__
#define __CLC_OPENCL_INTEGER_MUL24_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION mul24
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype24.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_MUL24_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/mul_hi.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_MUL_HI_H__
#define __CLC_OPENCL_INTEGER_MUL_HI_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION mul_hi
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_MUL_HI_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/popcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_POPCOUNT_H__
#define __CLC_OPENCL_INTEGER_POPCOUNT_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION popcount
#define __CLC_BODY <clc/shared/unary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_POPCOUNT_H__
5 changes: 5 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/rhadd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_RHADD_H__
#define __CLC_OPENCL_INTEGER_RHADD_H__

#define FUNCTION rhadd
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_RHADD_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/rotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_ROTATE_H__
#define __CLC_OPENCL_INTEGER_ROTATE_H__

#include <clc/opencl/opencl-base.h>

#define FUNCTION rotate
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_ROTATE_H__
5 changes: 5 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/sub_sat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_SUB_SAT_H__
#define __CLC_OPENCL_INTEGER_SUB_SAT_H__

#define FUNCTION sub_sat
#define __CLC_BODY <clc/shared/binary_decl.inc>

#include <clc/integer/gentype.inc>

#undef FUNCTION

#endif // __CLC_OPENCL_INTEGER_SUB_SAT_H__
7 changes: 7 additions & 0 deletions libclc/opencl/include/clc/opencl/integer/upsample.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_INTEGER_UPSAMPLE_H__
#define __CLC_OPENCL_INTEGER_UPSAMPLE_H__

#include <clc/opencl/opencl-base.h>

#define __CLC_UPSAMPLE_DECL(BGENTYPE, GENTYPE, UGENTYPE) \
_CLC_OVERLOAD _CLC_DECL BGENTYPE upsample(GENTYPE hi, UGENTYPE lo);

Expand All @@ -30,3 +35,5 @@ __CLC_UPSAMPLE_TYPES()
#undef __CLC_UPSAMPLE_TYPES
#undef __CLC_UPSAMPLE_DECL
#undef __CLC_UPSAMPLE_VEC

#endif // __CLC_OPENCL_INTEGER_UPSAMPLE_H__
26 changes: 26 additions & 0 deletions libclc/opencl/include/clc/opencl/opencl-base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_OPENCL_OPENCL_BASE_H__
#define __CLC_OPENCL_OPENCL_BASE_H__

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#endif

/* Function Attributes */
#include <clc/clcfunc.h>

/* 6.1 Supported Data Types */
#include <clc/clctypes.h>

#endif // __CLC_OPENCL_OPENCL_BASE_H__
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/abs.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_abs.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/abs.h>

#define __CLC_BODY <abs.inc>
#include <clc/integer/gentype.inc>
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/abs_diff.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_abs_diff.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/abs_diff.h>

#define __CLC_BODY <abs_diff.inc>
#include <clc/integer/gentype.inc>
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/add_sat.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_add_sat.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/add_sat.h>

#define FUNCTION add_sat
#define __CLC_BODY <clc/shared/binary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/clz.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_clz.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/clz.h>

#define FUNCTION clz
#define __CLC_BODY <clc/shared/unary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/ctz.cl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0

#include <clc/integer/clc_ctz.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/ctz.h>

#define FUNCTION ctz
#define __CLC_BODY <clc/shared/unary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/hadd.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_hadd.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/hadd.h>

#define FUNCTION hadd
#define __CLC_BODY <clc/shared/binary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/mad24.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_mad24.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/mad24.h>

#define FUNCTION mad24
#define __CLC_BODY <clc/shared/ternary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/mad_hi.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_mad_hi.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/mad_hi.h>

#define FUNCTION mad_hi
#define __CLC_BODY <clc/shared/ternary_def.inc>
Expand Down
2 changes: 1 addition & 1 deletion libclc/opencl/lib/generic/integer/mad_sat.cl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include <clc/integer/clc_mad_sat.h>
#include <clc/opencl/clc.h>
#include <clc/opencl/integer/mad_sat.h>

#define FUNCTION mad_sat
#define __CLC_BODY <clc/shared/ternary_def.inc>
Expand Down
Loading
Loading