Skip to content

Commit ecccd89

Browse files
Merge remote-tracking branch 'origin/sycl' into HEAD
2 parents 45c2e52 + bb3498a commit ecccd89

File tree

111 files changed

+445
-4825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+445
-4825
lines changed

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,8 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
12971297
CmdArgs.push_back("-asan-stack-dynamic-alloca=0");
12981298
CmdArgs.push_back("-mllvm");
12991299
CmdArgs.push_back("-asan-use-after-return=never");
1300+
CmdArgs.push_back("-mllvm");
1301+
CmdArgs.push_back("-asan-instrument-dynamic-allocas=0");
13001302

13011303
if (!RecoverableSanitizers.empty())
13021304
CmdArgs.push_back(Args.MakeArgString("-fsanitize-recover=" +

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ SYCLInstallationDetector::SYCLInstallationDetector(const Driver &D)
147147
SYCLInstallationDetector::SYCLInstallationDetector(
148148
const Driver &D, const llvm::Triple &HostTriple,
149149
const llvm::opt::ArgList &Args)
150-
: D(D) {}
150+
: SYCLInstallationDetector(D) {}
151151

152152
static llvm::SmallString<64>
153153
getLibSpirvBasename(const llvm::Triple &DeviceTriple,

clang/test/Driver/sycl-device-sanitizer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// SYCL-ASAN-SAME: "-mllvm" "-asan-globals=0"
1919
// SYCL-ASAN-SAME: "-mllvm" "-asan-stack-dynamic-alloca=0"
2020
// SYCL-ASAN-SAME: "-mllvm" "-asan-use-after-return=never"
21+
// SYCL-ASAN-SAME: "-mllvm" "-asan-instrument-dynamic-allocas=0"
2122
// SYCL-ASAN-SAME: "-mllvm" "-asan-mapping-scale=4"
2223

2324
// RUN: %clangxx -fsycl -Xarch_device -fsanitize=address -c %s -### 2>&1 \

libclc/clc/include/clc/math/unary_builtin_scalarize.inc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,26 @@
1717
#define __CLC_BUILTIN_H __CLC_BUILTIN_F
1818
#endif
1919

20+
#if (!defined(__HALF_ONLY) && !defined(__DOUBLE_ONLY))
2021
_CLC_DEFINE_UNARY_BUILTIN_SCALARIZE(float, __CLC_FUNCTION, __CLC_BUILTIN_F, float)
22+
#endif
2123

22-
#ifndef __FLOAT_ONLY
23-
24+
#if (!defined(__HALF_ONLY) && !defined(__FLOAT_ONLY))
2425
#ifdef cl_khr_fp64
2526

2627
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
2728

2829
_CLC_DEFINE_UNARY_BUILTIN_SCALARIZE(double, __CLC_FUNCTION, __CLC_BUILTIN_D, double)
2930

3031
#endif
32+
#endif // (!defined(__HALF_ONLY) && !defined(__FLOAT_ONLY))
3133

34+
#if (!defined(__FLOAT_ONLY) && !defined(__DOUBLE_ONLY))
3235
#ifdef cl_khr_fp16
3336

3437
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
3538

3639
_CLC_DEFINE_UNARY_BUILTIN_SCALARIZE(half, __CLC_FUNCTION, __CLC_BUILTIN_H, half)
3740

3841
#endif
39-
40-
#endif // !__FLOAT_ONLY
42+
#endif // (!defined(__FLOAT_ONLY) && !defined(__DOUBLE_ONLY))

libclc/clc/lib/amdgcn/SOURCES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
math/clc_exp.cl
12
math/clc_fmax.cl
23
math/clc_fmin.cl
34
math/clc_ldexp_override.cl
5+
math/clc_lgamma.cl
6+
math/clc_log.cl
7+
math/clc_sinpi.cl
8+
math/clc_sqrt.cl
9+
math/clc_sqrt_fp64.cl

libclc/libspirv/lib/amdgcn-amdhsa/math/exp.cl renamed to libclc/clc/lib/amdgcn/math/clc_exp.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clcmacro.h>
10-
#include <libspirv/spirv.h>
9+
#include <clc/internal/clc.h>
10+
#include <clc/math/clc_exp.h>
1111

12-
#define __CLC_FUNCTION __spirv_ocl_exp
12+
#define __CLC_FUNCTION __clc_exp
1313
#define __CLC_BUILTIN __ocml_exp
1414

1515
float __ocml_exp_f32(float);

libclc/clc/lib/amdgcn/math/clc_fmax.cl

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,25 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clcmacro.h>
109
#include <clc/internal/clc.h>
11-
#include <clc/relational/clc_isnan.h>
10+
#include <clc/math/clc_fmax.h>
1211

13-
_CLC_DEF _CLC_OVERLOAD float __clc_fmax(float x, float y) {
14-
// fcanonicalize removes sNaNs and flushes denormals if not enabled. Otherwise
15-
// fmax instruction flushes the values for comparison, but outputs original
16-
// denormal
17-
x = __builtin_canonicalizef(x);
18-
y = __builtin_canonicalizef(y);
19-
return __builtin_fmaxf(x, y);
20-
}
21-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, __clc_fmax, float, float)
12+
#define __CLC_FUNCTION __clc_fmax
13+
#define __CLC_BUILTIN __ocml_fmax
2214

23-
#ifdef cl_khr_fp64
15+
float __ocml_fmax_f32(float, float);
16+
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32)
2417

18+
#ifdef cl_khr_fp64
2519
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
20+
double __ocml_fmax_f64(double, double);
21+
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64)
22+
#endif // cl_khr_fp64
2623

27-
_CLC_DEF _CLC_OVERLOAD double __clc_fmax(double x, double y) {
28-
x = __builtin_canonicalize(x);
29-
y = __builtin_canonicalize(y);
30-
return __builtin_fmax(x, y);
31-
}
32-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, __clc_fmax, double,
33-
double)
34-
35-
#endif
3624
#ifdef cl_khr_fp16
37-
3825
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
26+
half __ocml_fmax_f16(half, half);
27+
#define __CLC_BUILTIN_H __CLC_XCONCAT(__CLC_BUILTIN, _f16)
28+
#endif // cl_khr_fp16
3929

40-
_CLC_DEF _CLC_OVERLOAD half __clc_fmax(half x, half y) {
41-
if (__clc_isnan(x))
42-
return y;
43-
if (__clc_isnan(y))
44-
return x;
45-
return (y < x) ? x : y;
46-
}
47-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, __clc_fmax, half, half)
48-
49-
#endif
30+
#include <clc/math/binary_builtin.inc>

libclc/clc/lib/amdgcn/math/clc_fmin.cl

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,25 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clcmacro.h>
109
#include <clc/internal/clc.h>
11-
#include <clc/relational/clc_isnan.h>
10+
#include <clc/math/clc_fmin.h>
1211

13-
_CLC_DEF _CLC_OVERLOAD float __clc_fmin(float x, float y) {
14-
// fcanonicalize removes sNaNs and flushes denormals if not enabled. Otherwise
15-
// fmin instruction flushes the values for comparison, but outputs original
16-
// denormal
17-
x = __builtin_canonicalizef(x);
18-
y = __builtin_canonicalizef(y);
19-
return __builtin_fminf(x, y);
20-
}
21-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, __clc_fmin, float, float)
12+
#define __CLC_FUNCTION __clc_fmin
13+
#define __CLC_BUILTIN __ocml_fmin
2214

23-
#ifdef cl_khr_fp64
15+
float __ocml_fmin_f32(float, float);
16+
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32)
2417

18+
#ifdef cl_khr_fp64
2519
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
26-
27-
_CLC_DEF _CLC_OVERLOAD double __clc_fmin(double x, double y) {
28-
x = __builtin_canonicalize(x);
29-
y = __builtin_canonicalize(y);
30-
return __builtin_fmin(x, y);
31-
}
32-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, __clc_fmin, double,
33-
double)
34-
35-
#endif
20+
double __ocml_fmin_f64(double, double);
21+
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64)
22+
#endif // cl_khr_fp64
3623

3724
#ifdef cl_khr_fp16
38-
3925
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
26+
half __ocml_fmin_f16(half, half);
27+
#define __CLC_BUILTIN_H __CLC_XCONCAT(__CLC_BUILTIN, _f16)
28+
#endif // cl_khr_fp16
4029

41-
_CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) {
42-
if (__clc_isnan(x))
43-
return y;
44-
if (__clc_isnan(y))
45-
return x;
46-
return (y < x) ? y : x;
47-
}
48-
_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, __clc_fmin, half, half)
49-
50-
#endif
30+
#include <clc/math/binary_builtin.inc>

libclc/libspirv/lib/amdgcn-amdhsa/math/lgamma.cl renamed to libclc/clc/lib/amdgcn/math/clc_lgamma.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clcmacro.h>
10-
#include <libspirv/spirv.h>
9+
#include <clc/internal/clc.h>
10+
#include <clc/math/clc_lgamma.h>
1111

12-
#define __CLC_FUNCTION __spirv_ocl_lgamma
12+
#define __CLC_FUNCTION __clc_lgamma
1313
#define __CLC_BUILTIN __ocml_lgamma
1414

1515
float __ocml_lgamma_f32(float);

libclc/libspirv/lib/amdgcn-amdhsa/math/log.cl renamed to libclc/clc/lib/amdgcn/math/clc_log.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clcmacro.h>
10-
#include <libspirv/spirv.h>
9+
#include <clc/internal/clc.h>
10+
#include <clc/math/clc_log.h>
1111

12-
#define __CLC_FUNCTION __spirv_ocl_log
12+
#define __CLC_FUNCTION __clc_log
1313
#define __CLC_BUILTIN __ocml_log
1414

1515
float __ocml_log_f32(float);

0 commit comments

Comments
 (0)