Skip to content

Commit 7a227be

Browse files
cjdbDuncanMcBain
authored andcommitted
Update SDK to ComputeCpp v0.9.1
The change to the Windows debug library has been reverted. It was fixed in the 0.9.1 release. Additionally, there have been some minor API updates from the SYCL working group in Khronos, resulting in some small changes to the samples. For details, see the blogpost on the Codeplay website: https://www.codeplay.com/portal/07-20-18-computecpp-ce-0-9-1-release
1 parent 8c4b221 commit 7a227be

File tree

9 files changed

+13
-28
lines changed

9 files changed

+13
-28
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ script:
4545
###########################
4646
- mkdir build
4747
- cd build
48-
- LD_LIBRARY_PATH=/tmp/OpenCL-ICD-Loader/build/lib cmake ../ -DComputeCpp_DIR=/tmp/computecpp -DCOMPUTECPP_SDK_BUILD_TESTS=1 -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
48+
- cmake ../ -DComputeCpp_DIR=/tmp/computecpp -DCOMPUTECPP_SDK_BUILD_TESTS=1 -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
4949
- make -j2
5050
- COMPUTECPP_TARGET="host" ctest -V

.travis/before_install.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,3 @@ sudo apt-get update -q
66
sudo apt-get install ocl-icd-libopencl1 ocl-icd-dev opencl-headers -y
77
# Use gcc 5 as default
88
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
9-
cd /tmp
10-
git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
11-
cd OpenCL-ICD-Loader
12-
rm inc/README.txt
13-
git clone https://github.com/KhronosGroup/OpenCL-Headers inc
14-
mkdir -p build && cd build
15-
cmake ../ -DCMAKE_BUILD_TYPE=Release
16-
make -j2

.travis/build_computecpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -ev
44

55
# Get ComputeCpp
6-
wget --no-check-certificate https://computecpp.codeplay.com/downloads/computecpp-ce/0.9.0/ubuntu-14.04-64bit.tar.gz
6+
wget --no-check-certificate https://computecpp.codeplay.com/downloads/computecpp-ce/0.9.1/ubuntu-14.04-64bit.tar.gz
77
mkdir -p /tmp/computecpp
88
tar -xzf ubuntu-14.04-64bit.tar.gz -C /tmp/computecpp --strip-components=1
99
# Workaround for C99 definition conflict

cmake/Modules/FindComputeCpp.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ find_library(COMPUTECPP_RUNTIME_LIBRARY
8484
DOC "ComputeCpp Runtime Library")
8585

8686
find_library(COMPUTECPP_RUNTIME_LIBRARY_DEBUG
87-
NAMES ComputeCpp ComputeCpp_vs2015
87+
NAMES ComputeCpp ComputeCpp_vs2015_d
8888
PATHS ${ComputeCpp_ROOT_DIR}
8989
PATH_SUFFIXES lib
9090
DOC "ComputeCpp Debug Runtime Library")
@@ -148,13 +148,6 @@ if(NOT ComputeCpp_FOUND)
148148
return()
149149
endif()
150150

151-
if(MSVC)
152-
message(WARNING " The Debug ComputeCpp library is missing! You might
153-
experience linker errors or crashes when building a Debug
154-
configuration. Please file an issue on Github if you do.
155-
This will be fixed in a subsequent release.")
156-
endif()
157-
158151
if(CMAKE_CROSSCOMPILING)
159152
if(NOT SDK_DONT_USE_TOOLCHAIN)
160153
list(APPEND COMPUTECPP_DEVICE_COMPILER_FLAGS --gcc-toolchain=${SDK_TOOLCHAIN_DIR})

samples/gaussian-blur/gaussian-blur.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ int main(int argc, char* argv[]) {
162162
for (int x = - offset; x < offset; x++) {
163163
for (int y = - offset; y < offset; y++) {
164164
auto inputCoords =
165-
int2(itemID.get_global(0) + x, itemID.get_global(1) + y);
165+
int2(itemID.get_global_id(0) + x, itemID.get_global_id(1) + y);
166166
newPixel += inPtr.read(inputCoords, smpl) *
167167
globalGaussian[x + offset][y + offset];
168168
}
169169
}
170170

171-
auto outputCoords = int2(itemID.get_global(0), itemID.get_global(1));
171+
auto outputCoords = int2(itemID.get_global_id(0), itemID.get_global_id(1));
172172
newPixel.w() = 1.f;
173173
outPtr.write(outputCoords, newPixel);
174174
});

samples/matrix-multiply/matrix-multiply.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ bool local_mxm(cl::sycl::queue& q, T* MA, T* MB, T* MC, int matSize) {
171171
int blockY = it.get_group(1);
172172

173173
// Current local item
174-
int localX = it.get_local(0);
175-
int localY = it.get_local(1);
174+
int localX = it.get_local_id(0);
175+
int localY = it.get_local_id(1);
176176

177177
// Start in the A matrix
178178
int a_start = matSize * blockSize * blockY;
@@ -203,7 +203,7 @@ bool local_mxm(cl::sycl::queue& q, T* MA, T* MB, T* MC, int matSize) {
203203
it.barrier(access::fence_space::local_space);
204204
}
205205
auto elemIndex =
206-
it.get_global(1) * it.get_global_range()[0] + it.get_global(0);
206+
it.get_global_id(1) * it.get_global_range()[0] + it.get_global_id(0);
207207
// Each thread updates its position
208208
pC[elemIndex] = tmp;
209209
});

samples/parallel-for/parallel-for.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main() {
7676
* item::get_global() to retrieve the global id as an id<1>.
7777
* This particular kernel will set the ith element to the value
7878
* of i. */
79-
ptr[item.get_global()] = item.get_global()[0];
79+
ptr[item.get_global_id()] = item.get_global_id()[0];
8080
});
8181

8282
/* We call the parallel_for() API with two parameters; the nd_range

samples/reduction/reduction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ T sycl_reduce(const std::vector<T>& v) {
9191
* parameter, since the code requires barriers for correctness. */
9292
h.parallel_for<class sycl_reduction>(
9393
r, [aI, scratch, local, length](cl::sycl::nd_item<1> id) {
94-
size_t globalid = id.get_global(0);
95-
size_t localid = id.get_local(0);
94+
size_t globalid = id.get_global_id(0);
95+
size_t localid = id.get_local_id(0);
9696

9797
/* All threads collectively read from global memory into local.
9898
* The barrier ensures all threads' IO is resolved before

samples/tiled-convolution/tiled-convolution.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class conv {
7676
total_size(total_size_),
7777
fil_size(fil_size_) {}
7878
void inline operator()(cl::sycl::nd_item<2> item_id) {
79-
index_t id_m = item_id.get_global(0); // global id with offset m
80-
index_t id_n = item_id.get_global(1); // global id with offser n
79+
index_t id_m = item_id.get_global_id(0); // global id with offset m
80+
index_t id_n = item_id.get_global_id(1); // global id with offser n
8181
// input index m , filter index fil_m , input index n, filter index fil_n
8282
index_t m, fil_m, n, fil_n;
8383
typename write_accessor_t::value_type val = 0.0;

0 commit comments

Comments
 (0)