Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jrprice/Oclgrind
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v19.10
Choose a base ref
...
head repository: jrprice/Oclgrind
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 17,178 additions and 13,296 deletions.
  1. +7 −0 .clang-format
  2. +13 −0 .github/workflows/check-format.sh
  3. +303 −0 .github/workflows/ci.yml
  4. +2 −0 .github/workflows/cts-xfail/api
  5. +1 −0 .github/workflows/cts-xfail/compiler
  6. +1 −0 .github/workflows/cts-xfail/conversions
  7. +1 −0 .github/workflows/cts-xfail/printf
  8. +69 −0 .github/workflows/install-deps.sh
  9. +87 −0 .github/workflows/run-cts-suite.sh
  10. +0 −27 .travis-deps.sh
  11. +0 −26 .travis.yml
  12. +62 −17 CMakeLists.txt
  13. +12 −0 NEWS
  14. +7 −9 README.md
  15. +2 −0 src/CL/.clang-format
  16. +1,234 −689 src/CL/cl.h
  17. +23 −26 src/CL/cl_d3d10.h
  18. +24 −26 src/CL/cl_d3d11.h
  19. +12 −26 src/CL/cl_dx9_media_sharing.h
  20. +170 −0 src/CL/cl_dx9_media_sharing_intel.h
  21. +54 −70 src/CL/cl_egl.h
  22. +600 −357 src/CL/cl_ext.h
  23. +731 −0 src/CL/cl_ext_intel.h
  24. +82 −90 src/CL/cl_gl.h
  25. +17 −51 src/CL/cl_gl_ext.h
  26. +440 −0 src/CL/cl_half.h
  27. +1,294 −0 src/CL/cl_icd.h
  28. +164 −199 src/CL/cl_platform.h
  29. +160 −0 src/CL/cl_va_api_media_sharing_intel.h
  30. +81 −0 src/CL/cl_version.h
  31. +10 −36 src/CL/opencl.h
  32. +93 −95 src/core/Context.cpp
  33. +96 −101 src/core/Context.h
  34. +59 −62 src/core/Kernel.cpp
  35. +47 −47 src/core/Kernel.h
  36. +44 −48 src/core/KernelInvocation.cpp
  37. +48 −53 src/core/KernelInvocation.h
  38. +40 −46 src/core/Memory.cpp
  39. +45 −45 src/core/Memory.h
  40. +2 −7 src/core/Plugin.cpp
  41. +76 −56 src/core/Plugin.h
  42. +228 −211 src/core/Program.cpp
  43. +76 −66 src/core/Program.h
  44. +50 −75 src/core/Queue.cpp
  45. +192 −180 src/core/Queue.h
  46. +51 −75 src/core/WorkGroup.cpp
  47. +76 −79 src/core/WorkGroup.h
  48. +217 −259 src/core/WorkItem.cpp
  49. +188 −180 src/core/WorkItem.h
  50. +3,227 −3,150 src/core/WorkItemBuiltins.cpp
  51. +757 −754 src/core/common.cpp
  52. +217 −219 src/core/common.h
  53. +7 −1 src/core/gen_opencl-c.h.cmake
  54. +0 −259 src/core/half.cpp
  55. +0 −29 src/core/half.h
  56. +2 −2 src/install/cpack-description
  57. +85 −91 src/kernel/Simulation.cpp
  58. +38 −41 src/kernel/Simulation.h
  59. +80 −59 src/kernel/oclgrind-kernel.cpp
  60. +18 −18 src/plugins/InstructionCounter.cpp
  61. +30 −30 src/plugins/InstructionCounter.h
  62. +96 −100 src/plugins/InteractiveDebugger.cpp
  63. +50 −52 src/plugins/InteractiveDebugger.h
  64. +7 −7 src/plugins/Logger.cpp
  65. +12 −12 src/plugins/Logger.h
  66. +47 −57 src/plugins/MemCheck.cpp
  67. +48 −47 src/plugins/MemCheck.h
  68. +82 −90 src/plugins/RaceDetector.cpp
  69. +120 −128 src/plugins/RaceDetector.h
  70. +2,278 −2,185 src/plugins/Uninitialized.cpp
  71. +286 −269 src/plugins/Uninitialized.h
  72. +17 −22 src/runtime/async_queue.cpp
  73. +6 −9 src/runtime/async_queue.h
  74. +46 −33 src/runtime/icd.h
  75. +101 −85 src/runtime/oclgrind.cpp
  76. +1,818 −1,870 src/runtime/runtime.cpp
  77. +110 −107 tests/apps/image/image.c
  78. +23 −25 tests/apps/vecadd/vecadd.c
  79. +5 −5 tests/common/common.c
  80. +9 −7 tests/common/common.h
  81. +1 −0 tests/kernels/TESTS
  82. +20 −0 tests/kernels/interactive/pointers.cl
  83. +23 −0 tests/kernels/interactive/pointers.inp
  84. +23 −0 tests/kernels/interactive/pointers.ref
  85. +10 −0 tests/kernels/interactive/pointers.sim
  86. +19 −23 tests/runtime/build_program.c
  87. +25 −27 tests/runtime/kernel_scope_local_mem_usage.c
  88. +86 −90 tests/runtime/map_buffer.c
  89. +27 −24 tests/runtime/multqueues.c
  90. +31 −35 tests/runtime/sampler.c
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Language: Cpp
BasedOnStyle: LLVM

AllowShortFunctionsOnASingleLine: Empty
BreakBeforeBraces: Allman
ContinuationIndentWidth: 2
PointerAlignment: Left
13 changes: 13 additions & 0 deletions .github/workflows/check-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Run git-clang-format to check for violations
OUTPUT=$(git-clang-format --diff origin/master --extensions c,cpp,h,hpp)

# Check for no-ops
grep '^no modified files to format$' <<<"$OUTPUT" && exit 0
grep '^clang-format did not modify any files$' <<<"$OUTPUT" && exit 0

# Dump formatting diff and signal failure
echo -e "\n==== FORMATTING VIOLATIONS DETECTED ====\n"
echo "$OUTPUT"
exit 1
303 changes: 303 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
name: CI
on: [push, pull_request]

env:
RELEASE_VERSION: "21.10"
RELEASE_LLVM: "14"

jobs:
check-format:
name: Check formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: sudo apt-get install -y clang-format
- name: Check formatting
run: bash .github/workflows/check-format.sh

build:
name: Build ${{ matrix.os }} llvm-${{ matrix.llvm }} ${{ matrix.compiler }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
needs: [check-format]
env:
LLVM_VERSION: ${{ matrix.llvm }}
INSTALL_DIR: "${{ github.workspace }}/install"
strategy:
matrix:
os: [ubuntu-20.04, macos-11.0]
compiler: [gcc, clang]
build_type: [Release, Debug]
llvm: [12, 13, 14]
exclude:
- os: macos-11.0
llvm: 13
- os: macos-11.0
compiler: gcc

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: bash .github/workflows/install-deps.sh
- name: Set LLVM_DIR
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ ubuntu-.* ]]; then
echo LLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm >>$GITHUB_ENV
elif [[ "${{ matrix.os }}" =~ macos-.* ]]; then
echo LLVM_DIR=$PWD/llvm-${LLVM_VERSION}/lib/cmake/llvm >>$GITHUB_ENV
fi
- name: Set compiler
shell: bash
run: |
if [ "${{ matrix.compiler }}" == "gcc" ]; then
echo CC=gcc >>$GITHUB_ENV
echo CXX=g++ >>$GITHUB_ENV
elif [ "${{ matrix.compiler }}" == "clang" ]; then
echo CC=clang >>$GITHUB_ENV
echo CXX=clang++ >>$GITHUB_ENV
fi
- name: Create build dir
run: cmake -E make_directory build
- name: CMake
run: >
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DLLVM_DIR="$LLVM_DIR"
working-directory: build
- name: Build
run: cmake --build . --config ${{ matrix.build_type }}
working-directory: build
- name: Test
run: ctest -C ${{ matrix.build_type }} --output-on-failure
working-directory: build
- name: Install
run: cmake --install . --config ${{ matrix.build_type }}
working-directory: build
- name: Prepare build artifact
shell: bash
run: |
if [[ "${{ matrix.os }}" =~ ubuntu-.* ]]; then
cp src/install/INSTALL.linux ${INSTALL_DIR}
elif [[ "${{ matrix.os }}" =~ macos-.* ]]; then
cp src/install/INSTALL.darwin ${INSTALL_DIR}
fi
mv ${INSTALL_DIR} oclgrind-${RELEASE_VERSION}
mkdir -p artifact
tar czf artifact/oclgrind-${RELEASE_VERSION}.tgz oclgrind-${RELEASE_VERSION}
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-${{ matrix.os }}-llvm${{ matrix.llvm }}-${{ matrix.build_type }}-${{ matrix.compiler }}
path: artifact

build-windows:
name: Build ${{ matrix.platform }} llvm-${{ matrix.llvm }}
runs-on: windows-2019
needs: [check-format]
env:
LLVM_VERSION: ${{ matrix.llvm }}
BUILD_PLATFORM: ${{ matrix.platform }}
strategy:
matrix:
platform: [Win32, x64]
llvm: [12, 13, 14]

steps:
- uses: actions/checkout@v2
- name: cache-llvm
uses: actions/cache@v2
with:
path: llvm-${{ matrix.llvm }}
key: llvm-${{ matrix.llvm }}-${{ matrix.platform }}
- name: Install dependencies
run: bash .github/workflows/install-deps.sh
- name: Create build dir
run: cmake -E make_directory build
- name: CMake
shell: bash
run: >
cmake .. -G "Visual Studio 16 2019" -A ${{ matrix.platform }}
-DLLVM_DIR=$PWD/../llvm-${{ matrix.llvm }}/install/lib/cmake/llvm
-DCMAKE_INSTALL_PREFIX=$PWD/../install/
working-directory: build
- name: Build
run: cmake --build . --config Release --target ALL_BUILD
working-directory: build
- name: Test
run: >
cmake --build . --config Release --target RUN_TESTS ;
cat ./Testing/Temporary/LastTest.log
working-directory: build
- name: Install
run: cmake --build . --config Release --target INSTALL
working-directory: build
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-${{ matrix.platform }}-llvm${{ matrix.llvm }}
path: install
retention-days: 5

upload-windows-binaries:
name: Upload Windows binaries
runs-on: ubuntu-20.04
needs: [build-windows]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-Win32-llvm${{ env.RELEASE_LLVM }}
path: artifact/oclgrind-${{ env.RELEASE_VERSION }}/x86
- uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows-x64-llvm${{ env.RELEASE_LLVM }}
path: artifact/oclgrind-${{ env.RELEASE_VERSION }}/x64
- name: Prepare directory
shell: bash
run: |
outdir=artifact/oclgrind-${{ env.RELEASE_VERSION }}
cp src/install/INSTALL.windows $outdir/INSTALL.txt
cp src/install/install.bat $outdir/
cp src/install/uninstall.bat $outdir/
cp src/install/oclgrind-icd.reg $outdir/
mkdir $outdir/include
mv $outdir/x64/include/CL $outdir/include/
cp -r $outdir/x64/include/oclgrind $outdir/include/
rm -rf $outdir/include/oclgrind/*.pch
rm -rf $outdir/x86/include/CL
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-Windows
path: artifact

build-cts:
name: Build OpenCL CTS
runs-on: ubuntu-20.04
needs: [build]
env:
cts_hash: 92285f7c9de965ddc41e7dfaaab8c7c75aa55dbe
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache-cts
with:
path: opencl-cts
key: opencl-cts-${{ env.cts_hash }}
- name: Install dependencies
if: steps.cache-cts.outputs.cache-hit != 'true'
run: bash .github/workflows/install-deps.sh
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-CTS
path: opencl-cts
ref: ${{ env.cts_hash }}
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-Headers
path: opencl-cts/opencl-headers
- uses: actions/checkout@v2
if: steps.cache-cts.outputs.cache-hit != 'true'
with:
repository: KhronosGroup/OpenCL-ICD-Loader
path: opencl-cts/opencl-icd-loader
- name: Create ICD loader build dir
run: cmake -E make_directory opencl-cts/opencl-icd-loader/build
- name: CMake ICD Loader
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PWD/../../install \
-DOPENCL_ICD_LOADER_HEADERS_DIR=$PWD/../../opencl-headers
working-directory: opencl-cts/opencl-icd-loader/build
- name: Build ICD Loader
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake --build . && cmake --install .
working-directory: opencl-cts/opencl-icd-loader/build
- name: Create CTS build dir
run: cmake -E make_directory opencl-cts/build
- name: CMake CTS
if: steps.cache-cts.outputs.cache-hit != 'true'
run: >
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DCL_INCLUDE_DIR=$PWD/../opencl-headers \
-DCL_LIB_DIR=$PWD/../install/lib \
-DCL_LIBCLCXX_DIR=. \
-DCLConform_LIBRARIES=OpenCL
working-directory: opencl-cts/build
- name: Build CTS
if: steps.cache-cts.outputs.cache-hit != 'true'
run: cmake --build .
working-directory: opencl-cts/build

run-cts:
name: Run OpenCL CTS ${{ matrix.suite[0] }}
runs-on: ubuntu-20.04
needs: [build-cts]
env:
cts_hash: 92285f7c9de965ddc41e7dfaaab8c7c75aa55dbe
strategy:
fail-fast: false
matrix:
suite: [
[allocations],
[api],
[atomics],
[basic],
[buffers],
[commonfns],
[compiler],
[computeinfo],
[contractions],
[conversions, "-w -[4096]"],
[events],
[geometrics],
[images_clCopyImage],
[images_clFillImage],
[images_clGetInfo],
[images_clReadWriteImage],
[images_kernel_image_methods],
[images_kernel_read_write, read write small_images CL_FILTER_NEAREST CL_RGBA], # TODO: Enable all orders.
[images_samplerlessReads],
[half, -w],
#[integer_ops], # TODO: Fix crash.
#[math_brute_force, -w -m], # TODO: Fix crash when multi-threaded and access-when-mapped issue in CTS.
[mem_host_flags],
[multiple_device_context],
[printf],
[profiling],
[relationals],
[select, -w],
#[thread_dimensions], # TODO: Takes too long.
[vectors],
]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: >
LLVM_VERSION=${{ env.RELEASE_LLVM }} \
bash .github/workflows/install-deps.sh
- name: Download Oclgrind
uses: actions/download-artifact@v2
with:
name: Oclgrind-${{ env.RELEASE_VERSION }}-ubuntu-20.04-llvm${{ env.RELEASE_LLVM }}-Release-gcc
- name: Unpack Oclgrind
shell: bash
run: |
tar xf oclgrind-${RELEASE_VERSION}.tgz
- name: cache-cts
uses: actions/cache@v2
with:
path: opencl-cts
key: opencl-cts-${{ env.cts_hash }}
- name: Run CTS suite
run: bash .github/workflows/run-cts-suite.sh ${{ matrix.suite[0] }} ${{ matrix.suite[1] }}
2 changes: 2 additions & 0 deletions .github/workflows/cts-xfail/api
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
negative_get_platform_ids
kernel_attributes
1 change: 1 addition & 0 deletions .github/workflows/cts-xfail/compiler
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unload_build_threaded
1 change: 1 addition & 0 deletions .github/workflows/cts-xfail/conversions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
conversions
1 change: 1 addition & 0 deletions .github/workflows/cts-xfail/printf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
buffer_size
Loading