Skip to content

Commit 16dbb8d

Browse files
committed
Merge branch 'sycl' into oneapins
Signed-off-by: James Brodman <[email protected]>
2 parents 56bbbfa + 91a9796 commit 16dbb8d

Some content is hidden

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

42 files changed

+1516
-1077
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ sycl/plugins/cuda/ @intel/llvm-reviewers-cuda
8282

8383
sycl/doc/ @pvchupin @kbobrovs
8484

85-
sycl/doc/extensions/ @mkinsner @jbrodman
85+
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers
8686

8787
xpti/ @tovinkere @andykaylor
8888
xptifw/ @tovinkere @andykaylor

.github/workflows/clang-format.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12+
- name: Get clang-format first
13+
run: sudo apt-get install -yqq clang-format-9
14+
1215
- uses: actions/checkout@v2
1316
with:
1417
fetch-depth: 2
1518

16-
- name: Get clang-format first
17-
run: sudo apt-get install -yqq clang-format-10
18-
1919
- name: Run clang-format for the patch
2020
run: |
21-
git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-10 > ./clang-format.patch
21+
git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
2222
2323
# Add patch with formatting fixes to CI job artifacts
2424
- uses: actions/upload-artifact@v1

buildbot/dependency.conf

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
[VERSIONS]
2-
# https://github.com/intel/llvm/releases/download/2020-WW20/oclcpuexp-2020.10.6.0.4_rel.tar.gz
3-
ocl_cpu_rt_ver=2020.10.6.0.04
4-
# https://github.com/intel/llvm/releases/download/2020-WW20/win-oclcpuexp-2020.10.6.0.4_rel.zip
5-
ocl_cpu_rt_ver_win=2020.10.6.0.04
2+
# https://github.com/intel/llvm/releases/download/2020-WW31/oclcpuexp-2020.10.7.0.15_rel.tar.gz
3+
ocl_cpu_rt_ver=2020.10.7.0.15
4+
# https://github.com/intel/llvm/releases/download/2020-WW31/win-oclcpuexp-2020.10.7.0.15_rel.zip
5+
ocl_cpu_rt_ver_win=2020.10.7.0.15
66
# Same GPU driver supports Level Zero and OpenCL:
7-
# https://github.com/intel/compute-runtime/releases/tag/20.21.16886
8-
ocl_gpu_rt_ver=20.21.16886
7+
# https://github.com/intel/compute-runtime/releases/tag/20.25.17111
8+
ocl_gpu_rt_ver=20.29.17408
99
# Same GPU driver supports Level Zero and OpenCL:
10-
# https://downloadmirror.intel.com/29616/a08/igfx_win10_100.8280.zip
11-
ocl_gpu_rt_ver_win=27.20.100.8280
10+
# https://downloadmirror.intel.com/29674/a08/igfx_win10_100.8336.zip
11+
ocl_gpu_rt_ver_win=27.20.100.8336
1212
intel_sycl_ver=build
1313
# https://github.com/oneapi-src/oneTBB/releases/download/v2020.2/tbb-2020.2-lin.tgz
14-
tbb_ver=20200121_111047
14+
tbb_ver=2021.1.8.515
1515
# https://github.com/oneapi-src/oneTBB/releases/download/v2020.2/tbb-2020.2-win.zip
16-
tbb_ver_win=20200124_000000
17-
# TODO: provide URL for Linux OpenCL emulator of FPGA device
18-
fpga_ver=20200216_000000
19-
# TODO: provide URL for Windows OpenCL emulator of FPGA device
20-
fpga_ver_win=20200216_000000
16+
tbb_ver_win=2021.1.8.514
17+
# https://github.com/intel/llvm/releases/download/2020-WW31/fpgaemu-2020.10.7.0.15_rel.tar.gz
18+
ocl_fpga_emu_ver=2020.10.7.0.15
19+
# https://github.com/intel/llvm/releases/download/2020-WW31/win-fpgaemu-2020.10.7.0.15_rel.zip
20+
ocl_fpga_emu_ver_win=2020.10.7.0.15
21+
fpga_ver=20200701_000002
22+
fpga_ver_win=20200701_000002
2123

2224
[DRIVER VERSIONS]
23-
cpu_driver_lin=2020.10.6.0.04
24-
cpu_driver_win=2020.10.6.0.04
25-
gpu_driver_lin=20.21.16886
26-
gpu_driver_win=27.20.100.8280
27-
fpga_driver_lin=2020.9.2.0
28-
fpga_driver_win=2020.9.2.0
25+
cpu_driver_lin=2020.10.7.0.15
26+
cpu_driver_win=2020.10.7.0.15
27+
gpu_driver_lin=20.29.17408
28+
gpu_driver_win=27.20.100.8336
29+
fpga_driver_lin=2020.10.7.0.15
30+
fpga_driver_win=2020.10.7.0.15
2931
# NVidia CUDA driver
30-
# http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-drivers_450.36.06-1_amd64.deb
31-
nvidia_gpu_driver_lin=450.36.06
32+
# TODO provide URL for CUDA driver
33+
nvidia_gpu_driver_lin=435.21

clang/lib/Driver/Driver.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5740,6 +5740,7 @@ InputInfo Driver::BuildJobsForActionNoCache(
57405740

57415741
// Only use pipes when there is exactly one input.
57425742
InputInfoList InputInfos;
5743+
bool JobForPreprocessToStdout = false;
57435744
for (const Action *Input : Inputs) {
57445745
// Treat dsymutil and verify sub-jobs as being at the top-level too, they
57455746
// shouldn't get temporary output names.
@@ -5750,6 +5751,11 @@ InputInfo Driver::BuildJobsForActionNoCache(
57505751
C, Input, TC, BoundArch, SubJobAtTopLevel, MultipleArchs, LinkingOutput,
57515752
CachedResults, A->getOffloadingDeviceKind()));
57525753
}
5754+
// Check if we are in sub-work for preprocessing for host side. If so we will
5755+
// add another job to print information to terminal later.
5756+
if (!AtTopLevel && A->getKind() == Action::PreprocessJobClass &&
5757+
C.getJobs().size() == 1)
5758+
JobForPreprocessToStdout = true;
57535759

57545760
// Always use the first input as the base input.
57555761
const char *BaseInput = InputInfos[0].getBaseInput();
@@ -5784,6 +5790,7 @@ InputInfo Driver::BuildJobsForActionNoCache(
57845790

57855791
// Determine the place to write output to, if any.
57865792
InputInfo Result;
5793+
InputInfo ResultForPreprocessToStdout;
57875794
InputInfoList UnbundlingResults;
57885795
if (auto *UA = dyn_cast<OffloadUnbundlingJobAction>(JA)) {
57895796
// If we have an unbundling job, we need to create results for all the
@@ -5945,6 +5952,8 @@ InputInfo Driver::BuildJobsForActionNoCache(
59455952
AtTopLevel, MultipleArchs,
59465953
OffloadingPrefix),
59475954
BaseInput);
5955+
if (JobForPreprocessToStdout)
5956+
ResultForPreprocessToStdout = InputInfo(A, "-", BaseInput);
59485957
}
59495958

59505959
if (CCCPrintBindings && !CCGenDiagnostics) {
@@ -5967,12 +5976,19 @@ InputInfo Driver::BuildJobsForActionNoCache(
59675976
llvm::errs() << "] \n";
59685977
}
59695978
} else {
5970-
if (UnbundlingResults.empty())
5979+
if (UnbundlingResults.empty()) {
59715980
T->ConstructJob(
59725981
C, *JA, Result, InputInfos,
59735982
C.getArgsForToolChain(TC, BoundArch, JA->getOffloadingDeviceKind()),
59745983
LinkingOutput);
5975-
else
5984+
// Add another job to print information to terminal for host side.
5985+
if (JobForPreprocessToStdout) {
5986+
T->ConstructJob(
5987+
C, *JA, ResultForPreprocessToStdout, InputInfos,
5988+
C.getArgsForToolChain(TC, BoundArch, JA->getOffloadingDeviceKind()),
5989+
LinkingOutput);
5990+
}
5991+
} else
59765992
T->ConstructJobMultipleOutputs(
59775993
C, *JA, UnbundlingResults, InputInfos,
59785994
C.getArgsForToolChain(TC, BoundArch, JA->getOffloadingDeviceKind()),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Test if clang is able to print internal defines in SYCL mode
2+
//
3+
// RUN: %clangxx -fsycl -dM -E -x c++ %s 2>&1 \
4+
// RUN: | FileCheck --check-prefix CHECK-PRINT-INTERNAL-DEFINES %s
5+
// CHECK-PRINT-INTERNAL-DEFINES: #define

sycl/include/CL/sycl.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
#include <CL/sycl/platform.hpp>
3838
#include <CL/sycl/pointers.hpp>
3939
#include <CL/sycl/program.hpp>
40+
#include <CL/sycl/properties/accessor_properties.hpp>
41+
#include <CL/sycl/properties/buffer_properties.hpp>
42+
#include <CL/sycl/properties/context_properties.hpp>
43+
#include <CL/sycl/properties/image_properties.hpp>
44+
#include <CL/sycl/properties/queue_properties.hpp>
4045
#include <CL/sycl/queue.hpp>
4146
#include <CL/sycl/range.hpp>
4247
#include <CL/sycl/sampler.hpp>

sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ template <typename Ptr, typename T>
138138
using EnableIfIsPointer =
139139
cl::sycl::detail::enable_if_t<cl::sycl::detail::is_pointer<Ptr>::value, T>;
140140

141+
template <typename T>
142+
using EnableIfIsTriviallyCopyable = cl::sycl::detail::enable_if_t<
143+
std::is_trivially_copyable<T>::value &&
144+
!cl::sycl::detail::is_vector_arithmetic<T>::value,
145+
T>;
146+
141147
// EnableIf shorthands for algorithms that depend on type and an operator
142148
template <typename T, typename BinaryOperation>
143149
using EnableIfIsScalarArithmeticNativeOp = cl::sycl::detail::enable_if_t<
@@ -286,8 +292,8 @@ EnableIfIsPointer<Ptr, bool> none_of(Group g, Ptr first, Ptr last,
286292
}
287293

288294
template <typename Group, typename T>
289-
EnableIfIsScalarArithmetic<T> broadcast(Group, T x,
290-
typename Group::id_type local_id) {
295+
EnableIfIsTriviallyCopyable<T> broadcast(Group, T x,
296+
typename Group::id_type local_id) {
291297
static_assert(sycl::detail::is_generic_group<Group>::value,
292298
"Group algorithms only support the sycl::group and "
293299
"ONEAPI::sub_group class.");
@@ -323,7 +329,7 @@ EnableIfIsVectorArithmetic<T> broadcast(Group g, T x,
323329
}
324330

325331
template <typename Group, typename T>
326-
EnableIfIsScalarArithmetic<T>
332+
EnableIfIsTriviallyCopyable<T>
327333
broadcast(Group g, T x, typename Group::linear_id_type linear_local_id) {
328334
static_assert(sycl::detail::is_generic_group<Group>::value,
329335
"Group algorithms only support the sycl::group and "
@@ -363,7 +369,7 @@ broadcast(Group g, T x, typename Group::linear_id_type linear_local_id) {
363369
}
364370

365371
template <typename Group, typename T>
366-
EnableIfIsScalarArithmetic<T> broadcast(Group g, T x) {
372+
EnableIfIsTriviallyCopyable<T> broadcast(Group g, T x) {
367373
static_assert(sycl::detail::is_generic_group<Group>::value,
368374
"Group algorithms only support the sycl::group and "
369375
"ONEAPI::sub_group class.");

sycl/include/CL/sycl/accessor.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <CL/sycl/id.hpp>
2323
#include <CL/sycl/image.hpp>
2424
#include <CL/sycl/pointers.hpp>
25+
#include <CL/sycl/properties/accessor_properties.hpp>
26+
#include <CL/sycl/property_list.hpp>
2527
#include <CL/sycl/sampler.hpp>
2628

2729
/// \file accessor.hpp
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//==--------- property_helper.hpp --- SYCL property helper -----------------==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#pragma once
10+
11+
#include <CL/sycl/detail/common.hpp>
12+
13+
__SYCL_INLINE_NAMESPACE(cl) {
14+
namespace sycl {
15+
16+
namespace detail {
17+
18+
// All properties are split here to dataless properties and properties with
19+
// data. A dataless property is one which has no data stored in it. A property
20+
// with data is one which has data stored in it and usually provides and access
21+
// to it. For dataless property we just store a bool which indicates if a
22+
// property is set or not. For properties with data we store a pointer to the
23+
// base class because we do not know the size of such properties beforehand.
24+
25+
// List of all dataless properties' IDs
26+
enum DataLessPropKind {
27+
BufferUseHostPtr = 0,
28+
ImageUseHostPtr,
29+
QueueEnableProfiling,
30+
InOrder,
31+
NoInit,
32+
BufferUsePinnedHostMemory,
33+
UsePrimaryContext,
34+
DataLessPropKindSize
35+
};
36+
37+
// List of all properties with data IDs
38+
enum PropWithDataKind {
39+
BufferUseMutex = 0,
40+
BufferContextBound,
41+
ImageUseMutex,
42+
ImageContextBound,
43+
PropWithDataKindSize
44+
};
45+
46+
// Base class for dataless properties, needed to check that the type of an
47+
// object passed to the property_list is a property.
48+
class DataLessPropertyBase {};
49+
50+
// Helper class for the dataless properties. Every such property is supposed
51+
// to inherit from it. The ID template parameter should be one from
52+
// DataLessPropKind.
53+
template <int ID> class DataLessProperty : DataLessPropertyBase {
54+
public:
55+
static constexpr int getKind() { return ID; }
56+
};
57+
58+
// Base class for properties with data, needed to check that the type of an
59+
// object passed to the property_list is a property and for checking if two
60+
// properties with data are of the same type.
61+
class PropertyWithDataBase {
62+
public:
63+
PropertyWithDataBase(int ID) : MID(ID) {}
64+
bool isSame(int ID) const { return ID == MID; }
65+
virtual ~PropertyWithDataBase() = default;
66+
67+
private:
68+
int MID = -1;
69+
};
70+
71+
// Helper class for the properties with data. Every such property is supposed
72+
// to inherit from it. The ID template parameter should be one from
73+
// PropWithDataKind.
74+
template <int ID> class PropertyWithData : public PropertyWithDataBase {
75+
public:
76+
PropertyWithData() : PropertyWithDataBase(ID) {}
77+
static int getKind() { return ID; }
78+
};
79+
80+
} // namespace detail
81+
82+
} // namespace sycl
83+
} // __SYCL_INLINE_NAMESPACE(cl)

0 commit comments

Comments
 (0)