Skip to content
Closed
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
15 changes: 15 additions & 0 deletions libclc/clc/lib/amdgcn/SOURCES
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
math/clc_cos.cl
math/clc_exp10.cl
math/clc_exp2.cl
math/clc_exp.cl
math/clc_fmax.cl
math/clc_fmin.cl
math/clc_ldexp_override.cl
math/clc_lgamma.cl
math/clc_log10.cl
math/clc_log2.cl
math/clc_log.cl
math/clc_sin.cl
math/clc_sqrt.cl
math/clc_sqrt.cl
math/clc_sqrt_fp64.cl
math/clc_tan.cl
mem_fence/clc_mem_fence.cl
synchronization/clc_work_group_barrier.cl
workitem/clc_get_global_offset.cl
Expand Down
29 changes: 29 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_cos.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_cos.h>

float __ocml_cos_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_cos(float x) { return __ocml_cos_f32(x); }

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_cos_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_cos(double x) { return __ocml_cos_f64(x); }
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_cos_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_cos(half x) { return __ocml_cos_f16(x); }
#endif

#define FUNCTION __clc_cos
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
29 changes: 29 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_exp.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_exp.h>

float __ocml_exp_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_exp(float x) { return __ocml_exp_f32(x); }

Comment on lines +12 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_exp_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_exp(double x) { return __ocml_exp_f64(x); }
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_exp_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_exp(half x) { return __ocml_exp_f16(x); }
#endif
Comment on lines +21 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic


#define FUNCTION __clc_exp
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
33 changes: 33 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_exp10.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_exp10.h>

float __ocml_exp10_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_exp10(float x) {
return __ocml_exp10_f32(x);
}
Comment on lines +12 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic


#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_exp10_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_exp10(double x) {
return __ocml_exp10_f64(x);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_exp10_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_exp10(half x) { return __ocml_exp10_f16(x); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic

#endif

#define FUNCTION __clc_exp10
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
31 changes: 31 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_exp2.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_exp2.h>

float __ocml_exp2_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_exp2(float x) { return __ocml_exp2_f32(x); }
Comment on lines +12 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic


#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_exp2_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_exp2(double x) {
return __ocml_exp2_f64(x);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_exp2_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_exp2(half x) { return __ocml_exp2_f16(x); }
#endif
Comment on lines +23 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is identical to the llvm intrinsic


#define FUNCTION __clc_exp2
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
35 changes: 35 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_fmax.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_fmax.h>

float __ocml_fmax_f32(float, float);
_CLC_OVERLOAD _CLC_DEF float __clc_fmax(float x, float y) {
return __ocml_fmax_f32(x, y);
}

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_fmax_f64(double, double);
_CLC_OVERLOAD _CLC_DEF double __clc_fmax(double x, double y) {
return __ocml_fmax_f64(x, y);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_fmax_f16(half, half);
_CLC_OVERLOAD _CLC_DEF half __clc_fmax(half x, half y) {
return __ocml_fmax_f16(x, y);
}
#endif
Comment on lines +12 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should directly use llvm intrinsics


#define FUNCTION __clc_fmax
#define __CLC_BODY <clc/shared/binary_def_scalarize.inc>
#include <clc/math/gentype.inc>
35 changes: 35 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_fmin.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_fmin.h>

float __ocml_fmin_f32(float, float);
_CLC_OVERLOAD _CLC_DEF float __clc_fmin(float x, float y) {
return __ocml_fmin_f32(x, y);
}

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_fmin_f64(double, double);
_CLC_OVERLOAD _CLC_DEF double __clc_fmin(double x, double y) {
return __ocml_fmin_f64(x, y);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_fmin_f16(half, half);
_CLC_OVERLOAD _CLC_DEF half __clc_fmin(half x, half y) {
return __ocml_fmin_f16(x, y);
}
#endif

#define FUNCTION __clc_fmin
#define __CLC_BODY <clc/shared/binary_def_scalarize.inc>
#include <clc/math/gentype.inc>
35 changes: 35 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_lgamma.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_lgamma.h>

float __ocml_lgamma_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_lgamma(float x) {
return __ocml_lgamma_f32(x);
}

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_lgamma_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_lgamma(double x) {
return __ocml_lgamma_f64(x);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_lgamma_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_lgamma(half x) {
return __ocml_lgamma_f16(x);
}
#endif

#define FUNCTION __clc_lgamma
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
29 changes: 29 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_log.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_log.h>

float __ocml_log_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_log(float x) { return __ocml_log_f32(x); }

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_log_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_log(double x) { return __ocml_log_f64(x); }
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_log_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_log(half x) { return __ocml_log_f16(x); }
#endif

#define FUNCTION __clc_log
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
33 changes: 33 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_log10.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_log10.h>

float __ocml_log10_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_log10(float x) {
return __ocml_log10_f32(x);
}

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_log10_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_log10(double x) {
return __ocml_log10_f64(x);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_log10_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_log10(half x) { return __ocml_log10_f16(x); }
#endif

#define FUNCTION __clc_log10
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
31 changes: 31 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_log2.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_log2.h>

float __ocml_log2_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_log2(float x) { return __ocml_log2_f32(x); }

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_log2_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_log2(double x) {
return __ocml_log2_f64(x);
}
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_log2_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_log2(half x) { return __ocml_log2_f16(x); }
#endif

#define FUNCTION __clc_log2
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
29 changes: 29 additions & 0 deletions libclc/clc/lib/amdgcn/math/clc_sin.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===----------------------------------------------------------------------===//
//
// 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/internal/clc.h>
#include <clc/math/clc_sin.h>

float __ocml_sin_f32(float);
_CLC_OVERLOAD _CLC_DEF float __clc_sin(float x) { return __ocml_sin_f32(x); }

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
double __ocml_sin_f64(double);
_CLC_OVERLOAD _CLC_DEF double __clc_sin(double x) { return __ocml_sin_f64(x); }
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half __ocml_sin_f16(half);
_CLC_OVERLOAD _CLC_DEF half __clc_sin(half x) { return __ocml_sin_f16(x); }
#endif

#define FUNCTION __clc_sin
#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
#include <clc/math/gentype.inc>
Loading
Loading