pocl (1.8-3) unstable; urgency=medium
authorAndreas Beckmann <anbe@debian.org>
Fri, 7 Jan 2022 23:55:22 +0000 (23:55 +0000)
committerAndreas Beckmann <anbe@debian.org>
Fri, 7 Jan 2022 23:55:22 +0000 (23:55 +0000)
  * Cherry-pick several upstream(ed) patches:
    - Check return code of all pthread_*() function calls for errors.
    - Return error (don't assert) if any worker thread is out-of-memory.
    - Show more information on OpenCL compile errors or test failures.
    - Export more symbols needed by other devices.
    - Fix underlinked device libraries.
    - Skip tests that require unavailable devices.
    - Unify test success/failure reporting.
    - Miscellaneous bugfixes.
  * armel/armhf: Reduce printf buffer size to 4 MB per core.
    (Closes: #997908)
  * Add superficial autopkgtest running clinfo.
  * Update symbols file.
  * Upload to unstable.

[dgit import unpatched pocl 1.8-3]

110 files changed:
1  2 
debian/changelog
debian/clean
debian/control
debian/copyright
debian/libpocl-dev.install
debian/libpocl2-common.install
debian/libpocl2.install
debian/libpocl2.lintian-overrides
debian/libpocl2.symbols
debian/patches/0004-Tweaks.patch
debian/patches/0011-Random-fix-for-accel-driver.patch
debian/patches/0013-Fix-data-race-in-compile_and_link_program.patch
debian/patches/0014-Fix-uninitialized-variable-in-tests-regression-test_.patch
debian/patches/0015-Enable-test_dlopen-only-if-DLFCN-is-available.patch
debian/patches/0016-Move-pocl_cmd_max_grid_dim_width-outside-HAVE_DLFCN_.patch
debian/patches/0017-Fix-missing-define-in-OpenCL-CTS.patch
debian/patches/0018-Fix-tests-regression-test_alignment_with_dynamic_wg..patch
debian/patches/0030-Add-missing-cl_ext_pocl.h-to-install.patch
debian/patches/0035-CUDA-don-t-leak-the-epoch_event.patch
debian/patches/0041-CUDA-const-correctness-in-get-free-device-name-strin.patch
debian/patches/0043-MapBuffer-MapImage-allocate-the-cl_mem-backing-buffe.patch
debian/patches/0052-vulkan-label-tests-that-work-with-vulkan-driver.patch
debian/patches/0058-run_test-show-diff-if-test-output-does-not-match-the.patch
debian/patches/0059-move-vector-type-printf-tests-to-a-separate-test.patch
debian/patches/0060-add-printf-tests-for-all-unsigned-fp-vector-types-an.patch
debian/patches/0061-test_printf_vectors-fails-on-most-platforms.patch
debian/patches/0062-add-test-test_ucharn.cl.patch
debian/patches/0063-hsa-add-PTHREAD_CHECK-to-the-remaining-pthread_-call.patch
debian/patches/0064-cuda-add-PTHREAD_CHECK-to-all-pthread_-calls.patch
debian/patches/0066-pthread-add-PTHREAD_CHECK-to-all-pthread_-calls.patch
debian/patches/0068-move-PTHREAD_CHECK-to-pocl_cl.h.patch
debian/patches/0069-add-PTHREAD_CHECK2-accepting-an-additional-non-zero-.patch
debian/patches/0071-add-PTHREAD_CHECK-to-all-macros-wrapping-pthread_-ca.patch
debian/patches/0072-pthread-add-return-code-to-pthread_scheduler_init.patch
debian/patches/0073-pthread-add-barrier-after-worker-thread-initializati.patch
debian/patches/0074-pthread-cleanup-fail-pthread_scheduler_init-if-any-w.patch
debian/patches/0075-be-more-verbose-on-pthread-errors.patch
debian/patches/0076-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
debian/patches/0077-add-POCL_EXPORT-to-additional-symbols-needed-if-hard.patch
debian/patches/0078-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
debian/patches/0079-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
debian/patches/0080-rename-get_llvm_cpu_name-to-pocl_get_llvm_cpu_name.patch
debian/patches/0081-rename-alloc_buffer_from_region-to-pocl_alloc_buffer.patch
debian/patches/0082-rename-free_chunk-to-pocl_free_chunk.patch
debian/patches/0083-rename-init_mem_region-to-pocl_init_mem_region.patch
debian/patches/0084-rename-byteswap_uint32_t-to-pocl_byteswap_uint32_t.patch
debian/patches/0086-enable-VISIBILITY_HIDDEN-by-default.patch
debian/patches/0087-rename-pocl_basic_alloc_mem_obj-to-pocl_driver_alloc.patch
debian/patches/0088-rename-pocl_basic_free-to-pocl_driver_free.patch
debian/patches/0089-rename-pocl_basic_svm_fill-to-pocl_driver_svm_fill.patch
debian/patches/0090-do-not-link-libpocl-devices-hsa.so-against-libpocl-d.patch
debian/patches/0096-Avoid-loss-precision-in-event-time-calculations.patch
debian/patches/0097-Avoid-inheritance-from-std-vector-in-ParallelRegion-.patch
debian/patches/0099-restore-setting-unroll-threshold-on-LLVM-9.patch
debian/patches/0100-link-libpocl-devices-pthread.so-with-pthread.patch
debian/patches/0101-link-libpocl-devices-cuda.so-with-lLLVM-pthread.patch
debian/patches/0102-link-libpocl-devices-hsa.so-with-pthread.patch
debian/patches/0103-link-libpocl-devices-ttasim.so-with-pthread.patch
debian/patches/0105-hsa-check-for-clang-target-hsail64.patch
debian/patches/0106-hsa-check-for-clang-target-amdgcn-amdhsa-nogpulib.patch
debian/patches/0107-check-for-.git-rebase-merge-to-detect-ongoing-git-re.patch
debian/patches/0108-do-not-reformat-if-there-are-uncommitted-changes.patch
debian/patches/0109-use-proper-tempfiles.patch
debian/patches/0110-exit-early-if-reformatting-produced-no-changes.patch
debian/patches/0111-import-clang-format-diff.py-from-clang-13.patch
debian/patches/0113-drop-irrelevant-metadata-causing-warnings-on-non-x86.patch
debian/patches/0114-do-not-build-libllvmopencl.so-by-default-no-longer-u.patch
debian/patches/0115-add-a-copy-of-the-Boost-license-for-sleef.patch
debian/patches/0116-add-a-copy-of-the-ROCm-Device-Libs-license-NCSA-for-.patch
debian/patches/0117-drop-the-clangxx-works-check-from-the-vecmathlib-age.patch
debian/patches/0118-cmake-policy-CMP0025-was-introduced-in-CMake-3.0.patch
debian/patches/0122-llvm-13-handle-deprecated-CreateLoad.patch
debian/patches/0127-really-enable-VISIBILITY_HIDDEN-by-default.patch
debian/patches/0128-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
debian/patches/0130-tests-use-EXIT_SUCCESS-EXIT_FAILURE-in-most-tests.patch
debian/patches/0131-tests-simplify-EXIT_SUCCESS-EXIT_FAILURE-usage.patch
debian/patches/0132-tests-emit-OK-along-EXIT_SUCCESS.patch
debian/patches/0133-consistently-use-add_test-NAME-.-COMMAND.patch
debian/patches/0134-fix-unlabeled-tests.patch
debian/patches/0135-skip-tests-that-require-unavailable-devices.patch
debian/patches/0136-skip-subdevice-tests-on-devices-with-only-1-compute-.patch
debian/patches/0137-add-poclu_show_program_build_log-cl_program.patch
debian/patches/0138-tests-run_-kernel.c-show-build-log-after-clBuildProg.patch
debian/patches/0139-do-not-dlopen-libpocl.so-without-ENABLE_ICD.patch
debian/patches/0140-add-dlopen-test-for-the-proxy-device.patch
debian/patches/0141-add-testcase-for-llvm-segfault-issue-889.patch
debian/patches/0142-ignore-known-llvm-segfault-test-failures.patch
debian/patches/0143-add-printf-and-parameter-passing-test-for-ulongn-vec.patch
debian/patches/0144-test_dlopen-fix-for-ICD-enabled.patch
debian/patches/2002-link-against-single-shared-libclang-cpp-when-buildin.patch
debian/patches/cl_ext_pocl.patch
debian/patches/distro.patch
debian/patches/fix-accel.patch
debian/patches/generic-cpu.patch
debian/patches/series
debian/patches/test_structs_as_args.patch
debian/patches/timeout.patch
debian/patches/use-system-CL-headers.patch
debian/patches/verbose.patch
debian/pocl-doc.doc-base
debian/pocl-doc.docs
debian/pocl-opencl-icd.docs
debian/pocl-opencl-icd.install
debian/pocl-opencl-icd.lintian-overrides
debian/rules
debian/source/format
debian/source/lintian-overrides
debian/tests/control
debian/upstream/metadata
debian/watch

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..54cc37d104be5408c87cb95d3a928a4e17a03a93
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,872 @@@
++pocl (1.8-3) unstable; urgency=medium
++
++  * Cherry-pick several upstream(ed) patches:
++    - Check return code of all pthread_*() function calls for errors.
++    - Return error (don't assert) if any worker thread is out-of-memory.
++    - Show more information on OpenCL compile errors or test failures.
++    - Export more symbols needed by other devices.
++    - Fix underlinked device libraries.
++    - Skip tests that require unavailable devices.
++    - Unify test success/failure reporting.
++    - Miscellaneous bugfixes.
++  * armel/armhf: Reduce printf buffer size to 4 MB per core.
++    (Closes: #997908)
++  * Add superficial autopkgtest running clinfo.
++  * Update symbols file.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 08 Jan 2022 00:55:22 +0100
++
++pocl (1.8-2) experimental; urgency=medium
++
++  * Add printf() tests for more vector types.
++  * Ignore llvm-10/llvm-11/llvm-12 segmentation fault (#975931) on
++    armel/armhf, seems fixed in llvm-13.
++  * Switch to llvm 11.  (Closes: #974797)
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 22 Nov 2021 18:00:18 +0100
++
++pocl (1.8-1) unstable; urgency=medium
++
++  * New upstream release.
++  * Refresh patches.
++  * Update symbols file for amd64 and i386.
++  * Revert to llvm 9.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 15 Oct 2021 18:22:36 +0200
++
++pocl (1.7-3) experimental; urgency=medium
++
++  * Switch to llvm 11.  (Closes: #974797)
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 04 Oct 2021 19:10:55 +0200
++
++pocl (1.7-2) unstable; urgency=medium
++
++  * Work around getconf on qemu/riscv64 returning 'undefined', thanks to
++    Alexandre Ghiti.  (Closes: #994797) (LP: #1942895)
++  * Bump Standards-Version to 4.6.0, no changes needed.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 30 Sep 2021 18:07:33 +0200
++
++pocl (1.7-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 03 Jun 2021 01:58:27 +0200
++
++pocl (1.6-5) unstable; urgency=medium
++
++  * Stop building libllvmopencl.so which is no longer used since 0.14.
++  * Build with -fvisibility=hidden.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 16 Feb 2021 11:00:57 +0100
++
++pocl (1.6-4) unstable; urgency=medium
++
++  * Restore setting unroll-threshold on LLVM 9 to avoid kernel/test_rotate
++    hanging on avx512 capable cpus.  (Closes: #980626)
++  * Kill hanging tests after 30 minutes.
++  * Let dh_shlibdeps find libpocl-devices-basic.so.
++  * Do not use the embedded copy of the OpenCL headers.
++  * Build with -fvisibility-inlines-hidden.
++  * Drop hidden symbols.
++  * Bump Standards-Version to 4.5.1, no changes needed.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 03 Feb 2021 21:21:03 +0100
++
++pocl (1.6-3) unstable; urgency=medium
++
++  * Update symbols file.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 05 Jan 2021 02:08:00 +0100
++
++pocl (1.6-2) experimental; urgency=medium
++
++  * Build with -DHARDENING_ENABLE=ON.
++  * Update symbols file for amd64 and i386.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 28 Dec 2020 23:50:16 +0100
++
++pocl (1.6-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh/remove patches.
++  * Add testcase for bug #975931.
++  * Revert to llvm 9.  (Reopens: #974797)
++  * Reintroduce "visibility hidden" to expose less internal symbols.
++  * Update symbols file for amd64 and i386.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 24 Dec 2020 04:19:57 +0100
++
++pocl (1.5-8) experimental; urgency=medium
++
++  * Cherry-pick upstream commits for llvm 11 support and some bugfixes.
++  * Switch to llvm 11.  (Closes: #974797)
++  * Update symbols file for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 17 Nov 2020 17:08:26 +0100
++
++pocl (1.5-7) unstable; urgency=medium
++
++  * Switch to llvm 10.
++  * Update symbols file.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 16 Nov 2020 14:45:48 +0100
++
++pocl (1.5-6) unstable; urgency=medium
++
++  * Fix separate arch:all build in debhelper-compat 13 with
++    -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 29 Jul 2020 12:52:56 +0200
++
++pocl (1.5-5) unstable; urgency=medium
++
++  * Update symbols file.
++  * Switch to debhelper-compat (= 13).
++  * Fix typos found by Lintian.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 29 Jul 2020 02:18:39 +0200
++
++pocl (1.5-4) unstable; urgency=medium
++
++  * Rebuild with GCC 10.  (Closes: #957694)
++  * Update symbols file.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 23 Jul 2020 14:20:52 +0200
++
++pocl (1.5-3) unstable; urgency=medium
++
++  * Update symbols file.
++  * Cherry-pick upstream commit 90fdec99 to avoid unwanted dependency on
++    symbols from libOpenCL.so.1.  (Closes: #958700)
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 27 Apr 2020 00:46:54 +0200
++
++pocl (1.5-2) unstable; urgency=medium
++
++  * The bullseye toolchain defaults to linking with --as-needed.
++  * Link against shared libclang-cpp when building with llvm >= 9.
++  * Update symbols file for amd64 and i386.
++  * Reduce local memory safety margin to prevent the pthread device from
++    running out of memory during initialization. This affects 32-bit builds
++    on platforms with large caches and large corecount.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 17 Apr 2020 16:40:56 +0200
++
++pocl (1.5-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh/remove patches.
++  * Update symbols file for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 04 Apr 2020 18:43:38 +0200
++
++pocl (1.4-6) unstable; urgency=medium
++
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 05 Feb 2020 20:55:06 +0100
++
++pocl (1.4-5) experimental; urgency=medium
++
++  * Update symbols files.
++  * Switch to llvm 9.
++  * Bump Standards-Version to 4.5.0, no changes needed.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 31 Jan 2020 17:11:45 +0100
++
++pocl (1.4-4) unstable; urgency=medium
++
++  * Postpone clinfo failures after dh_makeshlibs, too.
++  * Work around add_test_pocl() ignoring SKIP_RETURN_CODE.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 28 Jan 2020 12:02:47 +0100
++
++pocl (1.4-3) unstable; urgency=medium
++
++  * Update symbols files.
++  * Fix clash with altivec macros on ppc64el.
++  * Skip subdevice tests on (virtual) single core CPUs.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 19 Jan 2020 15:58:32 +0100
++
++pocl (1.4-2) experimental; urgency=medium
++
++  * Update symbols files.
++  * Switch to llvm 8.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 16 Jan 2020 03:03:18 +0100
++
++pocl (1.4-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh/remove patches.
++  * Link kernels with libm to avoid missing fma/fmaf/... symbols.
++  * Ignore regression/struct_kernel_arguments failure on i686.
++  * Switch back to llvm 7 for now.
++  * Update symbols files for amd64 and i386.
++  * Fix build on GNU/hurd, thanks to Samuel Thibault.  (Closes: #947881)
++  * Update copyright holders and years.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 04 Jan 2020 11:08:11 +0100
++
++pocl (1.3-10) unstable; urgency=medium
++
++  * Use upstream version of upstreamed patches.
++  * Backport "Use libdl directly" and related fixes from 1.4.
++    (Closes: #946582, #946422)
++  * Drop B-D on libltdl-dev.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 26 Dec 2019 23:19:15 +0100
++
++pocl (1.3-9) unstable; urgency=medium
++
++  * Bump Standards-Version to 4.4.1, no changes needed.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 09 Oct 2019 23:15:27 +0200
++
++pocl (1.3-8) experimental; urgency=medium
++
++  * Switch to llvm 8.
++  * Update symbols files for amd64 and i386.
++  * Backport "Fixes to global memory size detection" from 1.4.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 25 Sep 2019 00:48:51 +0200
++
++pocl (1.3-7) unstable; urgency=medium
++
++  * Try a fix for allocation limit computation on kfreebsd-i386.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 24 Sep 2019 00:55:41 +0200
++
++pocl (1.3-6) experimental; urgency=medium
++
++  * Update symbols files.
++  * Ignore workgroup/loop_with_two_paths_to_the_latch_LOOPS failures.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 14 Sep 2019 19:49:14 +0200
++
++pocl (1.3-5) experimental; urgency=medium
++
++  * Switch to llvm 7, again.  (Closes: #912793, #932707)
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Aug 2019 18:35:12 +0200
++
++pocl (1.3-4) unstable; urgency=medium
++
++  * Enable --exclude-libs on kFreeBSD.
++  * Tune symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 06 Sep 2019 23:13:34 +0200
++
++pocl (1.3-3) unstable; urgency=medium
++
++  * Rebuild with gcc 9.
++  * Update symbols files for amd64 and i386.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 24 Aug 2019 07:37:21 +0200
++
++pocl (1.3-2) unstable; urgency=medium
++
++  * Update symbols files.
++  * Bump Standards-Version to 4.4.0, no changes needed.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 14 Jul 2019 15:35:36 +0200
++
++pocl (1.3-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh/remove patches.
++  * Switch back to llvm 6.0 for now.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 13 Jul 2019 13:33:22 +0200
++
++pocl (1.2-10) experimental; urgency=medium
++
++  * Switch to llvm 7.  (Closes: #912793)
++  * Update symbols files.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 11 Feb 2019 16:56:57 +0100
++
++pocl (1.2-5) unstable; urgency=medium
++
++  * Disable dh_dwz which fails on 32-bit platforms, see #918903.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 05 Feb 2019 00:39:59 +0100
++
++pocl (1.2-4) unstable; urgency=medium
++
++  * Cherry-pick upstream "Fix kernel debug data emission".  (Closes: #919824)
++  * Switch to debhelper-compat (= 12).
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 04 Feb 2019 16:08:38 +0100
++
++pocl (1.2-3) experimental; urgency=medium
++
++  * kernel/test_printf: Add more tests.
++  * Perform compile test to select -march or -mcpu for clang.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 21 Jan 2019 01:34:24 +0100
++
++pocl (1.2-2) unstable; urgency=medium
++
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 15 Jan 2019 16:55:49 +0100
++
++pocl (1.2-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Remove patches that were applied upstream.
++  * Cherry-pick upstream commit fixing LINK_WITH_CLANG.
++  * Do not link with --rtlib=compiler-rt at all.
++  * Ignore kernel/test_printf failure on i686.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 11 Jan 2019 19:49:24 +0100
++
++pocl (1.2~rc2-1) experimental; urgency=medium
++
++  * New upstream release candidate.
++  * Refresh/remove patches.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 07 Sep 2018 19:14:21 +0200
++
++pocl (1.1-9) unstable; urgency=medium
++
++  * Drop unused deprecated module 'sphinx.ext.pngmath'.  (Closes: #918828)
++  * Update symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 10 Jan 2019 00:56:33 +0100
++
++pocl (1.1-8) unstable; urgency=medium
++
++  * Update symbols files.  (Closes: #916024)
++  * Fix building in armel chroot on arm64 host.  (Closes: #917244)
++  * Switch to debhelper-compat (= 11).
++  * Bump Standards-Version to 4.3.0, no changes needed.
++  * Update Lintian overrides.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 08 Jan 2019 13:04:26 +0100
++
++pocl (1.1-7) unstable; urgency=medium
++
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 07 Sep 2018 16:04:52 +0200
++
++pocl (1.1-6) experimental; urgency=medium
++
++  * pocl-opencl-icd: Mark as Multi-Arch: same.
++  * Fix building in armhf chroot on arm64 host.
++  * Bump Standards-Version to 4.2.1, no changes needed.
++  * Update symbols files.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 06 Sep 2018 14:11:03 +0200
++
++pocl (1.1-5) unstable; urgency=medium
++
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 09 Apr 2018 14:42:39 +0200
++
++pocl (1.1-4) experimental; urgency=medium
++
++  * Run clinfo during testing.
++  * Do not link with --rtlib=compiler-rt on non-x86.  (Closes: #892426)
++  * Prevent PIC/no-PIC option clash on mips64el.
++  * Set target cpu for armel to arm946e-s (arch=armv5te).
++  * Set target cpu for armhf to arm1156t2f-s (arch=armv6t2) with
++    -mfpu=vfp3-d16. Probably suboptimal (should rather be arch=armv7-a without
++    neon,vfp4), but passes all tests.  (Closes: #888063)
++  * Bump Standards-Version to 4.1.4, no changes needed.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 06 Apr 2018 19:39:01 +0200
++
++pocl (1.1-3) experimental; urgency=medium
++
++  * Add support for building for the GENERIC cpu, i.e. llvm defaults.
++  * Build with -DLLC_HOST_CPU=GENERIC on most architectures.
++  * Build with -DKERNELLIB_HOST_CPU_VARIANTS=distro on amd64.
++  * Switch to llvm 6.0.  (Closes: #892428)
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Mar 2018 13:12:40 +0200
++
++pocl (1.1-2) experimental; urgency=medium
++
++  * Switch to llvm 5.0.
++  * Update symbols files for amd64 and i386.
++  * Cherry-pick upstream commits for libhwloc 2.0 support.
++  * Cherry-pick upstream commit fixing test_clCreateSubDevices with 3 CUs.
++  * Cherry-pick upstream commit fixing reported values of native/preferred
++    vector width for unsupported types.
++  * pocl-doc: Mark as Multi-Arch: foreign.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 25 Mar 2018 17:35:44 +0200
++
++pocl (1.1-1) unstable; urgency=medium
++
++  * New upstream release.
++  * Remove patches, applied or fixed upstream.
++  * Remove -DFORCE_OCL_KERNEL_TARGET_CPU=ON, fixed upstream.
++  * Report the error code on test failure.
++  * Point watch file to git tags on github.
++  * Add debian/upstream/metadata.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 10 Mar 2018 00:37:43 +0100
++
++pocl (1.1~rc2-1) experimental; urgency=medium
++
++  * New upstream release candidate.  (Closes: #888062)
++  * Remove patches that were applied upstream.
++  * Update symbols files.
++  * Do not attempt to run the testsuite during an arch-indep build.
++  * Set LLVM_ARCH for arm64, armel, armhf to generic.
++  * Set LLVM_ARCH for s390x to z10.  (Closes: #888064)
++  * Drop internal helper library packages libpoclu-dev and libpoclu2.
++  * Add altivec.patch to get rid of the conflicting bool and vector macros
++    from altivec.h.  (Closes: #764561)
++  * Update Lintian overrides.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Feb 2018 17:31:09 +0100
++
++pocl (1.0-2) unstable; urgency=medium
++
++  * Merge changes from 0.14-7.
++  * Build with SLEEF instead of VECMATHLIB.
++  * HACK: Ignore test failure for kernel/test_fabs on i386.
++  * Add and use new CMake option -DFORCE_OCL_KERNEL_TARGET_CPU=ON.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 19 Jan 2018 01:11:11 +0100
++
++pocl (1.0-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh/remove patches.
++  * Build with -DPOCL_ICD_ABSOLUTE_PATH=OFF.
++  * Rename library packages for SOVERSION bump: 1 => 2.
++  * Update symbols files for amd64 and i386.
++  * Build with -DENABLE_VECMATHLIB=ON.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 14:13:19 +0100
++
++pocl (0.14-7) unstable; urgency=medium
++
++  * Switch to llvm 4.0.  (Closes: #873417)
++  * Update symbols files for amd64 and i386.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 18:36:08 +0100
++
++pocl (0.14-6) unstable; urgency=medium
++
++  * Switch to debhelper compat level 11.
++  * Bump Standards-Version to 4.1.3, no changes needed.
++  * Switch Vcs-* to salsa.debian.org.
++  * Remove superfluous patches.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 06:13:22 +0100
++
++pocl (0.14-5) unstable; urgency=medium
++
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 18 Dec 2017 01:44:17 +0100
++
++pocl (0.14-4) experimental; urgency=medium
++
++  * Switch to llvm 3.9.
++  * Update symbols files for amd64 and i386.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 16 Dec 2017 05:24:25 +0100
++
++pocl (0.14-3) experimental; urgency=medium
++
++  * Cherry-pick upstream [c9d2cd15] "llvm/Flatten: switch back to
++    force-inlining only some funcs", fixing kernel/test_convert_type_* failing
++    on i386 with LLC_HOST_CPU=i686.
++  * Switch LLC_HOST_CPU from "pentium3" to the correct baseline "i686" on
++    i386.
++  * kernel/test_printf actually passes on i386 with LLC_HOST_CPU=i686.
++  * Only override POCL_CACHE_DIR for the testsuite, not HOME.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 15 Dec 2017 07:08:32 +0100
++
++pocl (0.14-2) experimental; urgency=medium
++
++  * Cherry-pick upstream [62b74d6f] "Fix malloc size in tests/runtime/
++    test_clBuildProgram.c", fixing runtime/clBuildProgram failing frequently
++    on i386.
++  * Try to guess the minimal cpu for more architectures.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 14 Dec 2017 01:37:41 +0100
++
++pocl (0.14-1) experimental; urgency=medium
++
++  * New upstream release.
++  * The autotools based build system is gone.
++  * Refresh/remove patches.
++  * Use the CMAKE_INSTALL_SYSCONFDIR setting for /etc.
++  * Update symbols files.
++  * Update copyright holders and years.
++  * Remove pocl-standalone(1) manpage. The binary is no longer shipped.
++  * Ship the new poclcc binary in libpocl-dev.
++  * Do not downgrade to -std=c++11, fixing test_fabs failing on i386.
++    (Closes: #883613)
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 12 Dec 2017 03:48:35 +0100
++
++pocl (0.13-14) unstable; urgency=medium
++
++  * Bump Standards-Version to 4.1.2, no changes needed.
++  * cmake-no-get_cpu_name.patch: Rename/redo as
++    cmake-no-llvm-sys-getHostCPUName.patch to not use
++    llvm::sys::getHostCPUName().
++  * Clean up generated include/CL/cl.hpp* to fix building twice in a row.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 08 Dec 2017 18:55:52 +0100
++
++pocl (0.13-13) experimental; urgency=medium
++
++  * Fix cmake i386 detection, thanks to James Price.  (Closes: #882875)
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 28 Nov 2017 03:04:06 +0100
++
++pocl (0.13-12) experimental; urgency=medium
++
++  * Switch to cmake build system.
++  * llvmopencl.so.7 is now a private library.  (Closes: #823528)
++  * cmake-no-fno-rtti.patch: Build without -fno-rtti (a workaround for
++    clang-3.7), like autotools, to avoid symbol changes.
++  * cmake-no-get_cpu_name.patch: Do not use get_cpu_name(), makes some tests
++    fail.
++  * cmake-forcibly-link-regtests-with-pthread.patch: Link regression tests
++    with -lpthread unconditionally, otherwise test_issue_231 fails.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 27 Nov 2017 16:01:58 +0100
++
++pocl (0.13-11) unstable; urgency=medium
++
++  * Add Built-Using control field for linking against static clang libraries.
++  * do-not-export-clang-symbols.patch: Link static clang libraries with
++    --exclude-libs to not export their symbols.
++  * Update symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 26 Nov 2017 19:22:48 +0100
++
++pocl (0.13-10) unstable; urgency=medium
++
++  * Update symbols files.
++  * Bump Standards-Version to 4.1.1, no changes needed.
++  * Use dpkg makefile snippets instead of parsing the changelog manually.
++  * Switch B-D-I: python-sphinx to python3-sphinx.
++  * Set Rules-Requires-Root: no.
++  * set-POCL_DEVICE_ADDRESS_BITS-before-use.patch: Fix use-before-init in
++    CMakeLists.txt causing i386 to be misdetected as x86_64.
++  * Do not export libOpenCL.so.1 symbols.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 25 Nov 2017 21:03:13 +0100
++
++pocl (0.13-9) unstable; urgency=medium
++
++  * Work around using clang-3.8 with libstdc++-7-dev.  (Closes: #853620)
++  * Update symbols files.
++  * Switch to debhelper compat level 10.
++  * Bump Standards-Version to 4.0.1.
++  * Raise Priority to optional.
++  * Support nodoc build.
++  * Do not mark the -dev packages as Multi-Arch: foreign.
++  * Move kernel-<triplet>.bc from libpocl1-common into libpocl1.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 07 Aug 2017 04:57:35 +0200
++
++pocl (0.13-8) unstable; urgency=medium
++
++  * Enable more hardening.
++  * Reduce superfluous dependencies by linking with --as-needed.
++  * Update symbols files.
++  * Update lintian overrides.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 10 Oct 2016 13:38:39 +0200
++
++pocl (0.13-7) unstable; urgency=medium
++
++  * Update symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 09 Sep 2016 19:51:19 +0200
++
++pocl (0.13-6) unstable; urgency=medium
++
++  * Update symbols files.  (Closes: #835690, #836219)
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 06 Sep 2016 14:55:01 +0200
++
++pocl (0.13-5) unstable; urgency=medium
++
++  * Build-depend on the llvm-3.8 release version.
++  * Update symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 11 Jul 2016 04:24:40 +0200
++
++pocl (0.13-4) unstable; urgency=medium
++
++  * Use CLOCK_UPTIME_FAST on kFreeBSD.
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 03 Jul 2016 16:17:52 +0200
++
++pocl (0.13-3) experimental; urgency=medium
++
++  * Switch to llvm 3.8.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 22 Jun 2016 14:37:21 +0200
++
++pocl (0.13-2) unstable; urgency=medium
++
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 22 Jun 2016 11:40:19 +0200
++
++pocl (0.13-1) experimental; urgency=medium
++
++  * New upstream release.  (Closes: #820480)
++  * Refresh llvm-system-libs.patch, new upstream only supports llvm 3.7/3.8.
++  * Remove fix-image-args.patch, fixed upstream.
++  * glibc-2.23.patch: New, add support for glibc 2.23.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 15 Jun 2016 18:55:21 +0200
++
++pocl (0.12-6) unstable; urgency=medium
++
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 14 Jun 2016 20:11:10 +0200
++
++pocl (0.12-5) experimental; urgency=medium
++
++  * Switch to llvm 3.7.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Thu, 09 Jun 2016 10:26:04 +0200
++
++pocl (0.12-4) unstable; urgency=medium
++
++  * Update symbols files.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 08 Jun 2016 02:36:14 +0200
++
++pocl (0.12-3) unstable; urgency=medium
++
++  * Fix OpenCL headers for GNU/Hurd.
++  * Update symbols files.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sat, 28 May 2016 17:17:37 +0200
++
++pocl (0.12-2) experimental; urgency=medium
++
++  * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 10 May 2016 20:32:16 +0200
++
++pocl (0.12-1) experimental; urgency=medium
++
++  * New upstream release.
++  * Refresh patches.
++  * Update symbols files for amd64 and i386.
++  * Upload to experimental.
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 09 May 2016 14:44:03 +0200
++
++pocl (0.11-5) unstable; urgency=medium
++
++  * Work around clang failing to find sys/cdefs.h on !linux.
++
++ -- Andreas Beckmann <anbe@debian.org>  Fri, 27 May 2016 12:29:56 +0200
++
++pocl (0.11-4) unstable; urgency=medium
++
++  * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'.
++
++ -- Andreas Beckmann <anbe@debian.org>  Tue, 17 May 2016 12:45:38 +0200
++
++pocl (0.11-3) unstable; urgency=medium
++
++  * Update symbols files.
++  * Provide documentation package (pocl-doc), thanks to Ghislain Vaillant.
++
++ -- Andreas Beckmann <anbe@debian.org>  Sun, 08 May 2016 02:57:38 +0200
++
++pocl (0.11-2) unstable; urgency=medium
++
++  * Make the B-D on clang versioned to match llvm.
++  * Drop superfluous B-D.
++  * Fix testsuite failure on i386.  (Closes: #822563)
++  * Switch back target cpu to pentium3 on any-i386.
++  * Fix arm64 detection.  (Closes: #787686)
++  * Move libpocl1-common to section utils.
++  * Upload to unstable.
++
++ -- Andreas Beckmann <anbe@debian.org>  Wed, 27 Apr 2016 10:17:50 +0200
++
++pocl (0.11-1) experimental; urgency=medium
++
++  [ Vincent Danjean ]
++  * New upstream version  (Closes: #795321)
++  * Switch to llvm-3.6  (Closes: #803652)
++  * Fix "FTBFS on arm64" by targeting llvm arch to cortex-a53 on arm64
++    (Closes: #787686)
++  * Fix "vcs-browser field does not work" by fixing URL in debian/control
++    (Closes: #775844)
++
++  [ Andreas Beckmann ]
++  * Use a temporary, writable $HOME while running the testsuite.
++  * Show the full tests/testsuite.log on testsuite failures.
++  * Drop the -dbg package in favor of autogenerated -dbgsym packages.
++  * Update symbols files for amd64 and i386.
++  * llvm-config --system-libs is only needed with static llvm.
++  * Fix detection of image and sampler arguments, thanks to James Price.
++    (Closes: #799322)
++  * Put package under "Debian OpenCL Maintainers" team maintenance.
++  * Add Vincent Danjean and myself to Uploaders.
++  * Bump Standards-Version to 3.9.8 (no changes needed).
++
++ -- Andreas Beckmann <anbe@debian.org>  Mon, 25 Apr 2016 09:49:29 +0200
++
++pocl (0.10-12) experimental; urgency=medium
++
++  * Update again symbol file for armel
++  * apply partial fix for armhf (only one test fail, due to neon instruction)
++
++ -- Vincent Danjean <vdanjean@debian.org>  Sun, 02 Nov 2014 01:36:13 +0100
++
++pocl (0.10-11) experimental; urgency=medium
++
++  * Correctly fix FreeBSD include
++  * Update symbols file
++
++ -- Vincent Danjean <vdanjean@debian.org>  Mon, 27 Oct 2014 12:31:47 +0100
++
++pocl (0.10-10) unstable; urgency=medium
++
++  * fix symbol file (again), perhaps due to previous target adjustment
++  * trying pentium-m (for i386) and nehalem (for freebsd-i386) as
++    processor target
++
++ -- Vincent Danjean <vdanjean@debian.org>  Sat, 25 Oct 2014 22:32:40 +0200
++
++pocl (0.10-9) unstable; urgency=medium
++
++  * fix symbol file (again)
++  * lowering armhf llvm target (cortex-a5 instead of cortex-a7)
++    The good one should be ARMv7-A but it does not exist in LLVM
++    https://wiki.debian.org/ArmHardFloatPort
++  * bumping i386 target (from i686 to pentium4)
++    => some officially Debian supported i386 systems wont work with
++    pocl
++
++ -- Vincent Danjean <vdanjean@debian.org>  Fri, 24 Oct 2014 14:20:00 +0200
++
++pocl (0.10-8) unstable; urgency=medium
++
++  * fix symbol file for other architecture (!amd64)
++
++ -- Vincent Danjean <vdanjean@debian.org>  Fri, 24 Oct 2014 08:09:48 +0200
++
++pocl (0.10-7) unstable; urgency=medium
++
++  * bump minimum arch on i386 (from i586 to i686)
++  * to not ignore failed testsuite anymore at build time
++
++ -- Vincent Danjean <vdanjean@debian.org>  Wed, 22 Oct 2014 21:07:51 +0200
++
++pocl (0.10-6) unstable; urgency=medium
++
++  * Fix OpenCL headers for i386 FreeBSD
++  * use pkg-kde-tools to handle C++ symbols
++  * Try to support more Debian architectures.
++
++ -- Vincent Danjean <vdanjean@debian.org>  Wed, 22 Oct 2014 12:31:11 +0200
++
++pocl (0.10-5) unstable; urgency=medium
++
++  * Fix arm configure.ac detection
++  * try to support more Debian architectures
++
++ -- Vincent Danjean <vdanjean@debian.org>  Tue, 21 Oct 2014 14:50:28 +0200
++
++pocl (0.10-4) unstable; urgency=medium
++
++  * No need to provide utlist.h that is already provided in the uthash-dev
++    package (Closes: #764571)
++  * Fix some glitches in descriptions
++  * Remove old unneeded patches
++  * Add clang-3.5 dependency for libpocl1 (required when running a kernel)
++  * Fix default host CPU for the OpenCL compiler
++  * Add info in build logs to help debugging
++
++ -- Vincent Danjean <vdanjean@debian.org>  Fri, 10 Oct 2014 22:23:38 +0200
++
++pocl (0.10-3) unstable; urgency=medium
++
++  * Move the manpage in the correct package
++
++ -- Vincent Danjean <vdanjean@debian.org>  Wed, 08 Oct 2014 00:03:28 +0200
++
++pocl (0.10-2) unstable; urgency=medium
++
++  * Fix URLs, project name and update the copyright list
++    (initially created in 2012 with 0.7 version)
++
++ -- Vincent Danjean <vdanjean@debian.org>  Mon, 06 Oct 2014 23:22:34 +0200
++
++pocl (0.10-1) unstable; urgency=medium
++
++  * Initial release. (Closes: #676504: ITP: pocl -- Portable OpenCL)
++
++ -- Vincent Danjean <vdanjean@debian.org>  Sun, 05 Oct 2014 21:15:18 +0200
diff --cc debian/clean
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1bfc8417fc618cee1a848c8fe159dfb39bace556
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,3 @@@
++build-doc/
++debian/kcache/
++debian/stamp-failed-testsuite
diff --cc debian/control
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..22cdeb50e9a911aa073754e4df2c6ed58b5b2b72
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,137 @@@
++Source: pocl
++Section: libs
++Priority: optional
++Maintainer: Debian OpenCL Maintainers <pkg-opencl-devel@lists.alioth.debian.org>
++Uploaders: Vincent Danjean <vdanjean@debian.org>,
++ Andreas Beckmann <anbe@debian.org>,
++Build-Depends:
++ debhelper-compat (= 13),
++ gcc (>= 4:10),
++ pkg-config,
++ libhwloc-dev,
++ ocl-icd-dev (>= 2.2.3),
++ ocl-icd-libopencl1 (>= 2.2.3),
++ ocl-icd-opencl-dev,
++ clang-11,
++ libclang-11-dev,
++ libclang-cpp11-dev,
++ llvm-11-dev,
++ pkg-kde-tools,
++ cmake,
++ clinfo,
++Build-Depends-Indep:
++ dh-sequence-sphinxdoc,
++ python3-sphinx,
++Rules-Requires-Root: no
++Standards-Version: 4.6.0
++Homepage: http://portablecl.org
++Vcs-Browser: https://salsa.debian.org/opencl-team/pocl
++Vcs-Git: https://salsa.debian.org/opencl-team/pocl.git
++
++Package: pocl-opencl-icd
++Architecture: any
++Multi-Arch: same
++Depends:
++ libpocl2 (= ${binary:Version}),
++ ${misc:Depends}
++Provides:
++ opencl-icd,
++ opencl-icd-1.1-1,
++ opencl-icd-1.2-1,
++Description: pocl ICD
++ Portable Computing Language is an open source implementation of the OpenCL
++ standard which can be easily adapted for new targets. One of the goals of the
++ project is improving performance portability of OpenCL programs, avoiding the
++ need for target-dependent manual optimizations. A "native" target is included,
++ which allows running OpenCL kernels on the host (CPU).
++ .
++ This package allows one to use pocl as an installable client driver (ICD) for
++ OpenCL.
++
++Package: libpocl2-common
++Architecture: all
++Multi-Arch: foreign
++Section: utils
++Depends:
++ ${misc:Depends}
++Breaks:
++ libpocl1-common,
++Replaces:
++ libpocl1-common,
++Description: common files for the pocl library
++ Portable Computing Language is an open source implementation of the OpenCL
++ standard which can be easily adapted for new targets. One of the goals of the
++ project is improving performance portability of OpenCL programs, avoiding the
++ need for target-dependent manual optimizations. A "native" target is included,
++ which allows running OpenCL kernels on the host (CPU).
++ .
++ This package provides the architecture independent files of the pocl library.
++
++Package: libpocl2
++Architecture: any
++Multi-Arch: same
++Pre-Depends:
++ ${misc:Pre-Depends}
++Depends:
++ libpocl2-common (= ${source:Version}),
++ clang-${LLVM:Version},
++ ${shlibs:Depends},
++ ${misc:Depends}
++Recommends:
++ pocl-opencl-icd,
++Breaks:
++ libpocl1-common (<< 0.13-9),
++Replaces:
++ libpocl1-common (<< 0.13-9),
++Provides:
++ libpocl2+llvm${LLVM:Version},
++Description: Portable Computing Language library
++ Portable Computing Language is an open source implementation of the OpenCL
++ standard which can be easily adapted for new targets. One of the goals of the
++ project is improving performance portability of OpenCL programs, avoiding the
++ need for target-dependent manual optimizations. A "native" target is included,
++ which allows running OpenCL kernels on the host (CPU).
++ .
++ This package provides the core of pocl.
++
++Package: libpocl-dev
++Architecture: any
++Section: libdevel
++Depends:
++ libpocl2 (= ${binary:Version}),
++ ${shlibs:Depends},
++ ${misc:Depends}
++Description: development files for the pocl library
++ Portable Computing Language is an open source implementation of the OpenCL
++ standard which can be easily adapted for new targets. One of the goals of the
++ project is improving performance portability of OpenCL programs, avoiding the
++ need for target-dependent manual optimizations. A "native" target is included,
++ which allows running OpenCL kernels on the host (CPU).
++ .
++ This package provides the development files for the pocl library. Unless very
++ specific needs, this package is useless. This package is only required to link
++ directly and explicitly with pocl.
++ .
++ To develop OpenCL programs (that can be run with pocl), the opencl-dev virtual
++ package (provided by ocl-icd-opencl-dev for example) is required, not this one.
++
++Package: pocl-doc
++Architecture: all
++Multi-Arch: foreign
++Section: doc
++Depends:
++ ${sphinxdoc:Depends},
++ ${misc:Depends}
++Built-Using: ${sphinxdoc:Built-Using}
++Description: documentation for the pocl library
++ Portable Computing Language is an open source implementation of the OpenCL
++ standard which can be easily adapted for new targets. One of the goals of the
++ project is improving performance portability of OpenCL programs, avoiding the
++ need for target-dependent manual optimizations. A "native" target is included,
++ which allows running OpenCL kernels on the host (CPU).
++ .
++ This package provides the development files for the pocl library.  Unless very
++ specific needs, this package is useless.  This package is only required to link
++ directly and explicitly with pocl.
++ .
++ This package provides the documentation for the pocl library.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0e05c9e44f3e7c5b3de48d0ae7a6e878a30a42f2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,133 @@@
++Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
++Upstream-Name: Portable Computing Language
++Source: http://portablecl.org/download.html
++
++Files: *
++Copyright: 2012-2021 pocl developers
++           2002-2019 Tampere University
++           2011-2012 Carlos Sánchez de La Lama
++           2011-2020 Pekka Jääskeläinen / Tampere University of Technology
++           2011-2014 Kalle Raiskila
++           2011-2014 Erik Schnetter
++           2011-2015 Ville Korhonen / Tampere University of Technology
++           2011-2015 Universidad Rey Juan Carlos
++           2012-2017 Christian Rau
++           2012      Cyril Roelandt
++           2012      Timo Viitanen
++           2013      Jesse Towner
++           2013      Kalray
++           2013      Victor Oliveira
++           2014-2016 Advanced Micro Devices, Inc.
++           2014      Felix Bytow
++           2014      Lassi Koskinen
++           2014-2015 Matias Koskela
++           2014-2018 Michal Babej
++           2015-2020 Giuseppe Bilotta
++           2016      Tom Gall
++           2016      Marc Andrysco
++           2016-2017 James Price
++           2017      Stephan Nolting
++           2018      Julius Ikkala
++           2020      Isuru Fernando
++License: Expat
++
++Files: include/utlist.h
++Copyright: 2007-2011, Troy D. Hanson   http://uthash.sourceforge.net
++License: Free-Software-2
++
++Files: include/CL/*.h*
++Copyright: 2008-2019 The Khronos Group Inc.
++License: Free-Software-3
++
++Files: lib/kernel/sleef/*
++Copyright: 2010-2017 Naoki Shibata
++           2010-2017 ARM Ltd.
++License: Boost-1.0
++
++Files: debian/*
++Copyright: 2012 Vincent Danjean <vdanjean@debian.org>
++           Â© 2016-2022 Andreas Beckmann <anbe@debian.org>
++License: Expat
++
++License: Expat
++ Permission is hereby granted, free of charge, to any person obtaining a copy
++ of this software and associated documentation files (the "Software"), to deal
++ in the Software without restriction, including without limitation the rights
++ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ copies of the Software, and to permit persons to whom the Software is
++ furnished to do so, subject to the following conditions:
++ .
++ The above copyright notice and this permission notice shall be included in
++ all copies or substantial portions of the Software.
++ .
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ THE SOFTWARE.
++
++License: Free-Software-2
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions are met:
++ .
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ .
++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
++ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
++ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++License: Free-Software-3
++ Permission is hereby granted, free of charge, to any person obtaining a
++ copy of this software and/or associated documentation files (the
++ "Materials"), to deal in the Materials without restriction, including
++ without limitation the rights to use, copy, modify, merge, publish,
++ distribute, sublicense, and/or sell copies of the Materials, and to
++ permit persons to whom the Materials are furnished to do so, subject to
++ the following conditions:
++ .
++ The above copyright notice and this permission notice shall be included
++ in all copies or substantial portions of the Materials.
++ .
++ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++
++License: Boost-1.0
++ Boost Software License - Version 1.0 - August 17th, 2003
++ .
++ Permission is hereby granted, free of charge, to any person or organization
++ obtaining a copy of the software and accompanying documentation covered by
++ this license (the "Software") to use, reproduce, display, distribute,
++ execute, and transmit the Software, and to prepare derivative works of the
++ Software, and to permit third-parties to whom the Software is furnished to
++ do so, all subject to the following:
++ .
++ The copyright notices in the Software and this entire statement, including
++ the above license grant, this restriction and the following disclaimer,
++ must be included in all copies of the Software, in whole or in part, and
++ all derivative works of the Software, unless such copies or derivative
++ works are solely in the form of machine-executable object code generated by
++ a source language processor.
++ .
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
++ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
++ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ DEALINGS IN THE SOFTWARE.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1b06fa21bfbe8868a0f8e5202337c12c624ce93d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,3 @@@
++usr/bin
++usr/lib/${DEB_HOST_MULTIARCH}/libpocl.so
++usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/pocl.pc
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a8e36eed4846299568b6adb158dbb0a41276f14e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++usr/share/pocl/include
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..65801a2159db8233272ba42d3dad8266e636c176
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++usr/lib/${DEB_HOST_MULTIARCH}/libpocl.so.2*
++usr/lib/${DEB_HOST_MULTIARCH}/pocl/libpocl-devices-basic.so
++usr/lib/${DEB_HOST_MULTIARCH}/pocl/libpocl-devices-pthread.so
++usr/share/pocl/kernel-*-*-*-*-*.bc
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6d898ada8cd46bc758fe2afa1c49f6fe9594980c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++# we use fake Debian revisions to mark symbol (dis)appearance on compiler version changes
++symbols-file-contains-debian-revision
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8c06f010409ac374c4349d1b344552629db0388c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,210 @@@
++# SymbolsHelper-Confirmed: 1.8 amd64 arm64 armel armhf hurd-i386 i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64
++libpocl-devices-basic.so #PACKAGE# #MINVER#
++* Build-Depends-Package: libpocl-dev
++ pocl_basic_init_device_ops@Base 1.6
++libpocl-devices-pthread.so #PACKAGE# #MINVER#
++* Build-Depends-Package: libpocl-dev
++ pocl_pthread_init_device_ops@Base 1.6
++libpocl.so.2 #PACKAGE# #MINVER#
++* Build-Depends-Package: libpocl-dev
++#MISSING: 0.11# Header@Base 0.10
++#MISSING: 0.11# KernelName@Base 0.10
++ POclReleaseDevice@Base 1.8-3~visibility
++ POclReleaseEvent@Base 1.6-5~visibility
++ POclRetainEvent@Base 1.6-5~visibility
++#MISSING: 1.6-5~visibility# X@Base 0.13
++#MISSING: 1.6-5~visibility# Y@Base 0.10
++ _Z20getModuleIntMetadataRKN4llvm6ModuleEPKcRm@Base 1.8
++ _Z21getModuleBoolMetadataRKN4llvm6ModuleEPKcRb@Base 1.8
++ _Z23getModuleStringMetadataRKN4llvm6ModuleEPKcRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 1.8
++ _ZN4pocl23eraseFunctionAndCallersEPN4llvm8FunctionE@Base 1.8-3~visibility
++#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12emplace_backIJS5_EEEvDpOT_@Base 0.11
++#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRKS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
++#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
++#MISSING: 1.8# (optional=templinst)_ZNSt6vectorIPKcSaIS1_EE17_M_realloc_insertIJS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
++#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening
++#MISSING: 1.8# (optional=templinst|arch=mipsel)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag@Base 1.1-6~llvm6.0+gcc8
++#MISSING: 1.8# (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4swapERS4_@Base 1.6-2~hardening
++#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKc{size_t}@Base 1.6-2~hardening
++#MISSING: 1.8# (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_@Base 1.6-2~hardening
++#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE24_M_get_insert_unique_posERKS5_@Base 1.0
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS5_ERKS5_@Base 1.0
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E@Base 1.0
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 1.1-2~llvm5.0
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIvESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 1.7-3~llvm10
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 0.11
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 0.11
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 1.0
++#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 1.0
++#MISSING: 1.8# (optional=templinst)_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_@Base 1.6-2~hardening
++ (arch=armel riscv64)_ZTIN9__gnu_cxx7__mutexE@Base 1.4-5~llvm9
++ (arch=armel riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
++ (arch=!armel !riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
++ (arch=armel riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
++ (arch=!armel !riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
++ (arch=armel armhf)_ZTISt19_Sp_make_shared_tag@Base 0.10
++ (arch=armel riscv64)_ZTSN9__gnu_cxx7__mutexE@Base 1.0
++ (arch=armel riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
++ (arch=!armel !riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
++ (arch=armel riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
++ (arch=!armel !riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
++ _ZTSSt19_Sp_make_shared_tag@Base 0.10
++ _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag@Base 1.1-8~llvm6.0+gcc8.2
++#MISSING: 0.14# check_compiler_cache@Base 0.10
++ clGetExtensionFunctionAddress@Base 0.10
++ clGetExtensionFunctionAddressForPlatform@Base 1.0
++#MISSING: 1.6-5~visibility# cl_context_count@Base 1.1
++#MISSING: 0.14~visibility# context_set_properties@Base 0.10
++#MISSING: 0.14# cpufreq_file@Base 0.10
++#MISSING: 0.14# cpuinfo@Base 0.10
++#MISSING: 1.0# create_workitem_aa_plugin@Base 0.10
++#MISSING: 1.8# currentPoclDevice@Base 0.14
++#MISSING: 1.6-5~# fill_dev_image_t@Base 1.6
++#MISSING: 1.6-5~# fill_dev_sampler_t@Base 1.6
++#MISSING: 0.14# find_env@Base 0.10
++#MISSING: 0.14# get_cpu_name@Base 0.13
++#MISSING: 0.14~visibility# llvm_codegen@Base 0.10
++ pocl_SHA1_Final@Base 1.8-3~visibility
++ pocl_SHA1_Init@Base 1.8-3~visibility
++ pocl_SHA1_Update@Base 1.8-3~visibility
++ pocl_abort_on_pthread_error@Base 1.8-3~visibility
++ pocl_aligned_malloc@Base 1.6
++ pocl_aligned_malloc_global_mem@Base 1.6
++ pocl_alloc_buffer_from_region@Base 1.8-3~visibility
++ pocl_alloc_or_retain_mem_host_ptr@Base 1.8
++#MISSING: 0.12# pocl_basic_malloc@Base 0.11
++#MISSING: 0.13# pocl_basic_set_buffer_image_limits@Base 0.12
++ pocl_broadcast@Base 1.6
++ pocl_byteswap_uint32_t@Base 1.8-3~visibility
++ pocl_cache_create_program_cachedir@Base 1.8-3~visibility
++ pocl_cache_kernel_cachedir_path@Base 1.8-3~visibility
++ pocl_cache_program_bc_path@Base 1.8-3~visibility
++ pocl_cache_tempname@Base 1.8-3~visibility
++ pocl_cache_work_group_function_path@Base 1.6-5~visibility
++ pocl_cache_write_descriptor@Base 1.8-3~visibility
++ pocl_check_kernel_disk_cache@Base 1.8
++ pocl_check_kernel_dlhandle_cache@Base 1.6
++ pocl_cmd_max_grid_dim_width@Base 1.8-3~visibility
++#MISSING: 0.11~visibility# pocl_command_enqueue@Base 0.10
++ pocl_command_push@Base 1.6
++ pocl_command_to_str@Base 1.6-5~visibility
++#MISSING: 0.14# pocl_compact_queue_list@Base 0.12
++#MISSING: 1.6~visibility# pocl_context_handling_lock@Base 1.1
++#MISSING: 0.14~visibility# pocl_cpufreq_get_max@Base 0.10
++#MISSING: 0.12# pocl_cpuinfo_append_cpu_name@Base 0.10
++#MISSING: 0.14~visibility# pocl_cpuinfo_detect_compute_unit_count@Base 0.10
++ pocl_cpuinfo_detect_device_info@Base 1.6
++#MISSING: 0.14~visibility# pocl_cpuinfo_detect_max_clock_frequency@Base 0.10
++#MISSING: 0.14~visibility# pocl_cpuinfo_get_cpu_name_and_vendor@Base 0.12
++#MISSING: 1.6~visibility# pocl_cq_profiling_enabled@Base 1.5
++#MISSING: 1.6~visibility# pocl_cq_profiling_init@Base 1.5
++#MISSING: 1.6~visibility# pocl_cq_profiling_register_event@Base 1.5
++#MISSING: 0.11~visibility# pocl_create_command@Base 0.10
++#MISSING: 0.11~visibility# pocl_create_event@Base 0.10
++ pocl_debug_measure_finish@Base 1.8-3~visibility
++ pocl_debug_measure_start@Base 1.8-3~visibility
++#MISSING: 0.12# pocl_debug_messages@Base 0.11
++ pocl_debug_messages_filter@Base 1.6
++ pocl_debug_messages_setup@Base 1.8
++ pocl_debug_output_lock@Base 1.6
++ pocl_debug_output_unlock@Base 1.6
++ pocl_debug_print_duration@Base 1.8-3~visibility
++ pocl_debug_print_header@Base 1.6
++#MISSING: 0.12# pocl_debug_timespec@Base 0.11
++ pocl_default_local_size_optimizer@Base 1.6
++ pocl_device_get_env_count@Base 1.6
++#MISSING: 1.6-5~visibility# pocl_device_types@Base 1.6
++ pocl_driver_alloc_mem_obj@Base 1.8-3~visibility
++ pocl_driver_build_binary@Base 1.8
++ pocl_driver_build_poclbinary@Base 1.8
++ pocl_driver_build_source@Base 1.8
++ pocl_driver_copy@Base 1.8
++ pocl_driver_copy_rect@Base 1.8
++ pocl_driver_copy_with_size@Base 1.8
++ pocl_driver_free@Base 1.8-3~visibility
++ pocl_driver_free_mapping_ptr@Base 1.8
++ pocl_driver_free_program@Base 1.8
++ pocl_driver_get_mapping_ptr@Base 1.8
++ pocl_driver_link_program@Base 1.8
++ pocl_driver_map_mem@Base 1.8
++ pocl_driver_memfill@Base 1.8
++ pocl_driver_read@Base 1.8
++ pocl_driver_read_rect@Base 1.8
++ pocl_driver_setup_metadata@Base 1.8
++ pocl_driver_supports_binary@Base 1.8
++ pocl_driver_svm_fill@Base 1.8-3~visibility
++ pocl_driver_unmap_mem@Base 1.8
++ pocl_driver_write@Base 1.8
++ pocl_driver_write_rect@Base 1.8
++ pocl_exec_command@Base 1.6
++ pocl_exists@Base 1.6-5~visibility
++ pocl_fill_dev_image_t@Base 1.6-5~
++ pocl_fill_dev_sampler_t@Base 1.6-5~
++#MISSING: 0.14# pocl_find_img_format@Base 0.10
++#MISSING: 0.14# pocl_finish_all_queues@Base 0.12
++ pocl_free_chunk@Base 1.8-3~visibility
++ pocl_free_global_mem@Base 1.6
++#MISSING: 0.14~visibility# pocl_free_llvm_irs@Base 0.12
++ pocl_get_bool_option@Base 0.10
++ pocl_get_int_option@Base 0.10
++ pocl_get_llvm_cpu_name@Base 1.8-3~visibility
++ pocl_get_string_option@Base 0.10
++ pocl_gettimemono_ns@Base 1.6-5~visibility
++ pocl_init_default_device_infos@Base 1.6
++ pocl_init_dlhandle_cache@Base 1.6
++#MISSING: 0.14~visibility# pocl_init_mem_manager@Base 0.10
++ pocl_init_mem_region@Base 1.8-3~visibility
++ pocl_is_option_set@Base 1.8-3~visibility
++#MISSING: 0.14~visibility# pocl_llvm_build_program@Base 0.10
++#MISSING: 0.14~visibility# pocl_llvm_codegen@Base 0.10
++ pocl_llvm_generate_workgroup_function@Base 0.10
++#MISSING: 0.14~visibility# pocl_llvm_get_kernel_count@Base 0.12
++#MISSING: 0.14# pocl_llvm_get_kernel_metadata@Base 0.10
++#MISSING: 0.14# pocl_llvm_get_kernel_names@Base 0.10
++#MISSING: 0.14~visibility# pocl_llvm_update_binaries@Base 0.10
++#MISSING: 0.14# pocl_map_mem_cmd@Base 0.10
++#MISSING: 0.14~visibility# pocl_mem_manager_free_command@Base 0.10
++#MISSING: 0.14~visibility# pocl_mem_manager_free_event@Base 0.10
++#MISSING: 0.14~visibility# pocl_mem_manager_new_command@Base 0.10
++#MISSING: 0.14~visibility# pocl_mem_manager_new_event@Base 0.10
++#MISSING: 0.14~visibility# pocl_memalign_alloc@Base 0.11
++#MISSING: 0.14# pocl_memalign_alloc_global_mem@Base 0.13
++ pocl_mk_tempname@Base 1.8-3~visibility
++ pocl_mkdir_p@Base 1.8-3~visibility
++ pocl_ndrange_node_cleanup@Base 1.6
++#MISSING: 0.14~visibility# pocl_print_system_memory_stats@Base 0.13
++#MISSING: 0.13# pocl_pthread_malloc@Base 0.11
++ pocl_read_file@Base 1.8-3~visibility
++#MISSING: 0.14~visibility# pocl_rect_copy@Base 0.13
++ pocl_reinit_system_memory@Base 1.8-3~visibility
++ pocl_release_dlhandle_cache@Base 1.6
++ pocl_release_mem_host_ptr@Base 1.8
++ pocl_rename@Base 1.8-3~visibility
++ pocl_restore_ftz@Base 1.6
++ pocl_restore_rm@Base 1.6
++ pocl_run_command@Base 1.8-3~visibility
++ pocl_save_ftz@Base 1.6
++ pocl_save_rm@Base 1.6
++ pocl_set_buffer_image_limits@Base 1.6
++ pocl_set_default_rm@Base 1.6
++ pocl_set_ftz@Base 1.6
++ pocl_setup_device_for_system_memory@Base 1.8-3~visibility
++ pocl_size_ceil2@Base 1.8-3~visibility
++ pocl_stderr_is_a_tty@Base 1.6-5~
++#MISSING: 0.12# pocl_sysfs_detect_compute_unit_count@Base 0.11
++ pocl_topology_detect_device_info@Base 1.6
++ pocl_unmap_command_finished2@Base 1.8-3~visibility
++ pocl_update_event_complete_msg@Base 1.6
++ pocl_update_event_failed@Base 1.6
++#MISSING: 1.6-5~visibility# pocl_update_event_finished_msg@Base 1.4
++ pocl_update_event_running@Base 1.6
++ pocl_update_event_running_unlocked@Base 1.8-3~visibility
++ pocl_update_event_submitted@Base 1.6
++#MISSING: 0.14~visibility# pocl_update_program_llvm_irs@Base 0.11
++ pocl_wg_utilization_maximizer@Base 1.8-3~visibility
++ pocl_write_file@Base 1.6-5~visibility
++#MISSING: 1.6~visibility# scheduler_initialized@Base 1.3
++#MISSING: 1.6-5~# stderr_is_a_tty@Base 1.6
++#MISSING: 0.12~visibility# supported_image_formats@Base 0.10
++#MISSING: 0.14# ta_pool_lock@Base 0.10
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..34533edb62c9c8dcd4d191b1897e828c5adc22aa
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,43 @@@
++From 2b2a98b537169526a6b6833c48c04bc32f2e64d3 Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?=
++ <pekka.jaaskelainen@tuni.fi>
++Date: Tue, 12 Oct 2021 18:22:28 +0300
++Subject: [PATCH 04/90] Tweaks
++
++---
++ CHANGES                       |  4 +--
++ doc/sphinx/source/install.rst |  4 +--
++ doc/www/downloads/CHANGES     | 52 +++++++++++++++++++++++++++++++++++
++ doc/www/index.mak             |  2 ++
++ 4 files changed, 58 insertions(+), 4 deletions(-)
++
++diff --git a/CHANGES b/CHANGES
++index aaa320d5..c995d667 100644
++--- a/CHANGES
+++++ b/CHANGES
++@@ -1,5 +1,5 @@
++-1.8 unreleased
++-==============
+++1.8 October 2021
+++================
++ 
++ Notable User Facing Changes
++ ---------------------------
++diff --git a/doc/sphinx/source/install.rst b/doc/sphinx/source/install.rst
++index 11362cdf..29e91bc0 100644
++--- a/doc/sphinx/source/install.rst
+++++ b/doc/sphinx/source/install.rst
++@@ -24,8 +24,8 @@ Installing requirements for Ubuntu::
++ Note: The binary packages from https://apt.llvm.org/ are recommended
++ (and tested for each release) instead of the binary tar balls or
++ the packages included in the distribution. The following assumes
++-apt.llvm.org is added to your apt repos (LLVM_VERSION=12 recommended
++-for PoCL 1.7)::
+++apt.llvm.org is added to your apt repos (LLVM_VERSION=13 recommended
+++for PoCL 1.8)::
++ 
++     apt install -y build-essential ocl-icd-libopencl1 cmake git pkg-config libclang-${LLVM_VERSION}-dev clang llvm-${LLVM_VERSION} make ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev libclang-cpp${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION} llvm-${LLVM_VERSION}-dev
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e5c3aa2dd37ce79653201801b532f6984df8fdda
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,31 @@@
++From 528846008de66e3f6301db647d3f249f6d7224b4 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Tue, 20 Jul 2021 12:19:28 +0300
++Subject: [PATCH 11/90] Random fix for accel driver
++
++Accel does not use CPU or LLVM -> remove call to get_llvm_cpu_name()
++---
++ lib/CL/devices/accel/accel.cc | 6 ------
++ 1 file changed, 6 deletions(-)
++
++diff --git a/lib/CL/devices/accel/accel.cc b/lib/CL/devices/accel/accel.cc
++index cc8b5077..e68f9485 100644
++--- a/lib/CL/devices/accel/accel.cc
+++++ b/lib/CL/devices/accel/accel.cc
++@@ -567,13 +567,7 @@ unsigned int pocl_accel_probe(struct pocl_device_ops *ops) {
++ 
++ char *pocl_accel_build_hash(cl_device_id /*device*/) {
++   char *res = (char *)calloc(1000, sizeof(char));
++-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
++-  char *name = get_llvm_cpu_name();
++-  snprintf(res, 1000, "accel-%s-%s", HOST_DEVICE_BUILD_HASH, name);
++-  POCL_MEM_FREE(name);
++-#else
++   snprintf(res, 1000, "accel-%s", HOST_DEVICE_BUILD_HASH);
++-#endif
++   return res;
++ }
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..70fe7a545a2a3fde83cb87d5a53a76ef9d633c08
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,48 @@@
++From cb763c07a0273340e04142d9efcf7504bdef2532 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Tue, 31 Aug 2021 09:11:52 +0300
++Subject: [PATCH 13/90] Fix data race in compile_and_link_program()
++
++lock cl_program before touching kernels
++---
++ lib/CL/pocl_build.c | 10 +++++-----
++ 1 file changed, 5 insertions(+), 5 deletions(-)
++
++diff --git a/lib/CL/pocl_build.c b/lib/CL/pocl_build.c
++index f2746e36..c162fae5 100644
++--- a/lib/CL/pocl_build.c
+++++ b/lib/CL/pocl_build.c
++@@ -611,11 +611,13 @@ compile_and_link_program(int compile_program,
++   POCL_GOTO_LABEL_COND (PFN_NOTIFY, (pfn_notify == NULL && user_data != NULL),
++                         CL_INVALID_VALUE);
++ 
++-  POCL_GOTO_LABEL_ON (PFN_NOTIFY, program->kernels, CL_INVALID_OPERATION,
+++  POCL_LOCK_OBJ (program);
+++
+++  POCL_GOTO_LABEL_ON (FINISH, program->kernels, CL_INVALID_OPERATION,
++                       "Program already has kernels\n");
++ 
++   POCL_GOTO_LABEL_ON (
++-      PFN_NOTIFY,
+++      FINISH,
++       (program->source == NULL && program->binaries == NULL
++        && program->builtin_kernel_names == NULL),
++       CL_INVALID_PROGRAM,
++@@ -623,13 +625,11 @@ compile_and_link_program(int compile_program,
++       "need "
++       "to call clCreateProgramWith{Binary|Source|BuiltinKernels} first\n");
++ 
++-  POCL_GOTO_LABEL_ON (PFN_NOTIFY,
+++  POCL_GOTO_LABEL_ON (FINISH,
++                       ((program->source == NULL) && (link_program == 0)),
++                       CL_INVALID_OPERATION,
++                       "Cannot clCompileProgram when program has no source\n");
++ 
++-  POCL_LOCK_OBJ (program);
++-
++   program->main_build_log[0] = 0;
++ 
++   TP_BUILD_PROGRAM (program->context->id, program->id);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..275e42010dae445a9e4ffaa7d9cc18d9d2b32d38
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From 4d40d5e2e01b20ae7f4fe6f9618aa53171e5a380 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Mon, 6 Sep 2021 07:28:26 +0300
++Subject: [PATCH 14/90] Fix uninitialized variable in
++ tests/regression/test_alignment_with_dynamic_wg2.cpp
++
++---
++ tests/regression/test_alignment_with_dynamic_wg2.cpp | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/tests/regression/test_alignment_with_dynamic_wg2.cpp b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++index ad24df02..51235238 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg2.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++@@ -59,8 +59,8 @@ int main(int argc, char *argv[]) {
++   cl::Program program(SOURCE);
++   program.build("-cl-std=CL1.2");
++ 
++-  float in1[ARRAY_SIZE];
++-  float out[ARRAY_SIZE];
+++  float in1[ARRAY_SIZE] = { 0.0f };
+++  float out[ARRAY_SIZE] = { 0.0f };
++ 
++   cl::Buffer inbuf((cl_mem_flags)(CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR),
++                    (ARRAY_SIZE * sizeof(float)), in1);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7aeff8ff86d0bd12cc69640fc6072ca0707318bb
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++From 965061430041b184d179202e2fc88a83658b4645 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Wed, 8 Sep 2021 18:17:03 +0300
++Subject: [PATCH 15/90] Enable test_dlopen only if DLFCN is available
++
++---
++ tests/runtime/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt
++index 29d9e6fa..a6b92437 100644
++--- a/tests/runtime/CMakeLists.txt
+++++ b/tests/runtime/CMakeLists.txt
++@@ -24,7 +24,7 @@
++ #=============================================================================
++ 
++ # do not link test_dlopen with -lOpenCL
++-if (UNIX)
+++if (UNIX AND HAVE_DLFCN_H)
++   add_executable("test_dlopen" "test_dlopen.c")
++   if(SANITIZER_OPTIONS)
++     target_link_libraries("test_dlopen" ${SANITIZER_LIBS})
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..48509e9a758b6b4e5be853f80c5c655042927478
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,59 @@@
++From 52256431983ce7b623bae843bcc788b2b1c8d44a Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Wed, 8 Sep 2021 18:20:08 +0300
++Subject: [PATCH 16/90] Move pocl_cmd_max_grid_dim_width() outside HAVE_DLFCN_H
++
++some build configs that don't use dlopen() require it
++---
++ lib/CL/devices/common.c | 21 ++++++++++++---------
++ 1 file changed, 12 insertions(+), 9 deletions(-)
++
++diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c
++index 1574e0fa..1804283d 100644
++--- a/lib/CL/devices/common.c
+++++ b/lib/CL/devices/common.c
++@@ -769,6 +769,17 @@ pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg)
++   }
++ }
++ 
+++/* Returns the width of the widest dimension in the grid of the given
+++   run command. */
+++size_t
+++pocl_cmd_max_grid_dim_width (_cl_command_run *cmd)
+++{
+++  return max (max (cmd->pc.local_size[0] * cmd->pc.num_groups[0],
+++                   cmd->pc.local_size[1] * cmd->pc.num_groups[1]),
+++              cmd->pc.local_size[2] * cmd->pc.local_size[2]);
+++}
+++
+++
++ /* CPU driver stuff */
++ 
++ #ifdef HAVE_DLFCN_H
++@@ -947,15 +958,6 @@ pocl_check_kernel_disk_cache (_cl_command_node *command, int specialized)
++   return module_fn;
++ }
++ 
++-/* Returns the width of the widest dimension in the grid of the given
++-   run command. */
++-size_t
++-pocl_cmd_max_grid_dim_width (_cl_command_run *cmd)
++-{
++-  return max (max (cmd->pc.local_size[0] * cmd->pc.num_groups[0],
++-                   cmd->pc.local_size[1] * cmd->pc.num_groups[1]),
++-              cmd->pc.local_size[2] * cmd->pc.local_size[2]);
++-}
++ 
++ /* Look for a dlhandle in the dlhandle cache for the given kernel command.
++    If found, push the handle up in the cache to improve cache hit speed,
++@@ -1075,6 +1077,7 @@ pocl_check_kernel_dlhandle_cache (_cl_command_node *command,
++ 
++ #endif
++ 
+++
++ #define MIN_MAX_MEM_ALLOC_SIZE (128*1024*1024)
++ 
++ /* accounting object for the main memory */
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a01782b95991f8072aa7735e519cf569ec809709
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From 415a74300277ba448ed8d346c19a3374e2305688 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Thu, 9 Sep 2021 11:39:05 +0300
++Subject: [PATCH 17/90] Fix missing define in OpenCL-CTS
++
++---
++ examples/conformance/CMakeLists.txt | 5 ++++-
++ 1 file changed, 4 insertions(+), 1 deletion(-)
++
++diff --git a/examples/conformance/CMakeLists.txt b/examples/conformance/CMakeLists.txt
++index d8dd28a3..6bcecd2a 100644
++--- a/examples/conformance/CMakeLists.txt
+++++ b/examples/conformance/CMakeLists.txt
++@@ -51,7 +51,10 @@ ExternalProject_Add(
++   PREFIX "${TS_BASEDIR}"
++   GIT_REPOSITORY "https://github.com/franz/OpenCL-CTS"
++   GIT_TAG "cl12_trunk"
++-  CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release
+++  CONFIGURE_COMMAND ${CMAKE_COMMAND}
+++    -DCMAKE_BUILD_TYPE=Release
+++    -DCMAKE_C_FLAGS_RELEASE=-DCL_TARGET_OPENCL_VERSION=120
+++    -DCMAKE_CXX_FLAGS_RELEASE=-DCL_TARGET_OPENCL_VERSION=120
++     -DENABLE_ASAN=${ENABLE_ASAN}
++     -DENABLE_TSAN=${ENABLE_TSAN}
++     ${CTS_OPENCL_LIBRARY}
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..201e2c73d07a8cfa6903623113dff6d4fb9a4fbf
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,61 @@@
++From c4974a2747337ade2d178fb7099da4a6bace52fb Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Mon, 20 Sep 2021 09:12:24 +0300
++Subject: [PATCH 18/90] Fix tests/regression/test_alignment_with_dynamic_wg.cpp
++
++Don't rebuild the program inside loop iteration,
++instead create a new one on each iteration.
++---
++ tests/regression/test_alignment_with_dynamic_wg.cpp | 11 +++++------
++ 1 file changed, 5 insertions(+), 6 deletions(-)
++
++diff --git a/tests/regression/test_alignment_with_dynamic_wg.cpp b/tests/regression/test_alignment_with_dynamic_wg.cpp
++index c16b50a7..65b5d665 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg.cpp
++@@ -50,8 +50,7 @@ __kernel void test(global uint *output, global const uint* trialValue){
++ 
++ bool test_invocation(unsigned x, unsigned y, unsigned z,
++                      const std::string &arg_x, const std::string &arg_y,
++-                     const std::string &arg_z, cl::CommandQueue &queue,
++-                     cl::Program &program) {
+++                     const std::string &arg_z, cl::CommandQueue &queue) {
++ 
++   unsigned expected_sum = x * y * z * 4;
++ 
++@@ -59,6 +58,7 @@ bool test_invocation(unsigned x, unsigned y, unsigned z,
++   assert(local_size > 0);
++   assert(local_size <= 256);
++ 
+++  cl::Program program(SOURCE);
++   std::string options = "-cl-std=CL1.2";
++   options += " -DX=" + arg_x + " -DY=" + arg_y + " -DZ=" + arg_z;
++   program.build(options.c_str());
++@@ -109,7 +109,6 @@ bool test_invocation(unsigned x, unsigned y, unsigned z,
++ int main(int argc, char *argv[]) {
++   cl::Device device = cl::Device::getDefault();
++   cl::CommandQueue queue = cl::CommandQueue::getDefault();
++-  cl::Program program(SOURCE);
++ 
++   if (argc < 4) {
++     std::cout << "USAGE: $0 X Y Z\n";
++@@ -124,13 +123,13 @@ int main(int argc, char *argv[]) {
++   unsigned y = std::stoi(argv[2]);
++   unsigned z = std::stoi(argv[3]);
++ 
++-  if (!test_invocation(x, y, z, arg_x, arg_y, arg_z, queue, program))
+++  if (!test_invocation(x, y, z, arg_x, arg_y, arg_z, queue))
++     return 1;
++ 
++-  if (!test_invocation(y, z, x, arg_y, arg_z, arg_x, queue, program))
+++  if (!test_invocation(y, z, x, arg_y, arg_z, arg_x, queue))
++     return 1;
++ 
++-  if (!test_invocation(z, x, y, arg_z, arg_x, arg_y, queue, program))
+++  if (!test_invocation(z, x, y, arg_z, arg_x, arg_y, queue))
++     return 1;
++ 
++   return 0;
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f3e38d5e2569017c7d4f188c55960be05566377b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++From f5a841706edd5b201274337660528d75797031bc Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Andr=C3=A9=20Gem=C3=BCnd?=
++ <andre.gemuend@scai.fraunhofer.de>
++Date: Thu, 11 Nov 2021 09:38:24 +0100
++Subject: [PATCH 30/90] Add missing cl_ext_pocl.h to install.
++
++---
++ include/CL/CMakeLists.txt | 1 +
++ 1 file changed, 1 insertion(+)
++
++diff --git a/include/CL/CMakeLists.txt b/include/CL/CMakeLists.txt
++index 63e6b1ba..eb4f4773 100644
++--- a/include/CL/CMakeLists.txt
+++++ b/include/CL/CMakeLists.txt
++@@ -35,6 +35,7 @@ if(INSTALL_OPENCL_HEADERS)
++                 cl_ext.h
++                 cl_egl.h
++                 cl_ext_intel.h
+++                cl_ext_pocl.h
++                 cl_gl.h
++                 cl_gl_ext.h
++                 cl_half.h
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3ad29a493498305c6ff0b7c6a471d60aa49dbf9f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From 121e0725edfc86d7a2624cb5ee7b473ad3fef2d2 Mon Sep 17 00:00:00 2001
++From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
++Date: Wed, 3 Feb 2021 20:32:31 +0100
++Subject: [PATCH 35/90] CUDA: don't leak the epoch_event
++
++---
++ lib/CL/devices/cuda/pocl-cuda.c | 4 +++-
++ 1 file changed, 3 insertions(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/cuda/pocl-cuda.c b/lib/CL/devices/cuda/pocl-cuda.c
++index 54c3dcd1..ebece5ba 100644
++--- a/lib/CL/devices/cuda/pocl-cuda.c
+++++ b/lib/CL/devices/cuda/pocl-cuda.c
++@@ -525,8 +525,10 @@ pocl_cuda_uninit (unsigned j, cl_device_id device)
++ {
++   pocl_cuda_device_data_t *data = device->data;
++ 
++-  if (device->available)
+++  if (device->available) {
+++      cuEventDestroy (data->epoch_event);
++       cuCtxDestroy (data->context);
+++  }
++ 
++   POCL_MEM_FREE (data);
++   device->data = NULL;
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f92cc3afbea856636637c44d61823e6cd4d5d89d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,52 @@@
++From 29fd60c9851c80eaae763de2b42d5eb5ca77b814 Mon Sep 17 00:00:00 2001
++From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
++Date: Tue, 23 Nov 2021 17:25:10 +0100
++Subject: [PATCH 41/90] CUDA: const correctness in get/free device name string
++
++This silences a couple of const correctness warnings due to implicit
++casts to/from char*/const char*.
++---
++ lib/CL/devices/cuda/pocl-cuda.c | 20 +++++++++++++-------
++ 1 file changed, 13 insertions(+), 7 deletions(-)
++
++diff --git a/lib/CL/devices/cuda/pocl-cuda.c b/lib/CL/devices/cuda/pocl-cuda.c
++index ebece5ba..c78e8990 100644
++--- a/lib/CL/devices/cuda/pocl-cuda.c
+++++ b/lib/CL/devices/cuda/pocl-cuda.c
++@@ -286,12 +286,15 @@ pocl_cuda_init (unsigned j, cl_device_id dev, const char *parameters)
++     ret = CL_INVALID_DEVICE;
++ 
++   /* Get specific device name */
++-  dev->long_name = dev->short_name = calloc (256, sizeof (char));
++-
++-  if (ret != CL_INVALID_DEVICE)
++-    cuDeviceGetName (dev->long_name, 256, data->device);
++-  else
++-    snprintf (dev->long_name, 255, "Unavailable CUDA device #%d", j);
+++  {
+++     char *name = calloc (256, sizeof (char));
+++
+++     if (ret != CL_INVALID_DEVICE)
+++       cuDeviceGetName (name, 256, data->device);
+++     else
+++       snprintf (name, 255, "Unavailable CUDA device #%d", j);
+++     dev->long_name = dev->short_name = name;
+++  }
++ 
++   SETUP_DEVICE_CL_VERSION (CUDA_DEVICE_CL_VERSION_MAJOR,
++                            CUDA_DEVICE_CL_VERSION_MINOR);
++@@ -533,7 +536,10 @@ pocl_cuda_uninit (unsigned j, cl_device_id device)
++   POCL_MEM_FREE (data);
++   device->data = NULL;
++ 
++-  POCL_MEM_FREE (device->long_name);
+++  char *name = (char*)device->long_name;
+++  POCL_MEM_FREE (name);
+++  device->long_name = device->short_name = NULL;
+++
++   return CL_SUCCESS;
++ }
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..47c25c9a7cc239e37d0d7ec7b4ac4063bbe46c65
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,62 @@@
++From b72f97ad1028c586c156336662f606e3b3c36909 Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Thu, 25 Nov 2021 15:49:47 +0200
++Subject: [PATCH 43/90] MapBuffer/MapImage: allocate the cl_mem backing buffer
++ if required
++
++---
++ lib/CL/clEnqueueMapBuffer.c | 12 +++++++++++-
++ lib/CL/clEnqueueMapImage.c  | 14 ++++++++++++--
++ 2 files changed, 23 insertions(+), 3 deletions(-)
++
++diff --git a/lib/CL/clEnqueueMapBuffer.c b/lib/CL/clEnqueueMapBuffer.c
++index f342177c..b277dd94 100644
++--- a/lib/CL/clEnqueueMapBuffer.c
+++++ b/lib/CL/clEnqueueMapBuffer.c
++@@ -104,7 +104,17 @@ POname(clEnqueueMapBuffer)(cl_command_queue command_queue,
++   mapping_info->offset = offset;
++   mapping_info->size = size;
++ 
++-  errcode = device->ops->get_mapping_ptr (device->data, mem_id, buffer,
+++  /* because cl_mems are per-context, PoCL delays allocation of
+++   * cl_mem backing memory until it knows which device will need it,
+++   * so the cl_mem might not yet be allocated on this device. However,
+++   * some drivers can avoid unnecessary host memory usage if we
+++   * allocate it now. We can assume it will be used on this device. */
+++  pocl_mem_identifier *p = &buffer->device_ptrs[device->global_mem_id];
+++  if (p->mem_ptr == NULL)
+++    errcode = device->ops->alloc_mem_obj (device, buffer, NULL);
+++
+++  if (errcode == CL_SUCCESS)
+++    errcode = device->ops->get_mapping_ptr (device->data, mem_id, buffer,
++                                           mapping_info);
++   DL_APPEND (buffer->mappings, mapping_info);
++   ++buffer->map_count;
++diff --git a/lib/CL/clEnqueueMapImage.c b/lib/CL/clEnqueueMapImage.c
++index 2de8c04c..09467838 100644
++--- a/lib/CL/clEnqueueMapImage.c
+++++ b/lib/CL/clEnqueueMapImage.c
++@@ -154,8 +154,18 @@ CL_API_SUFFIX__VERSION_1_0
++   assert (start_offset <= end_offset);
++   mapping_info->size = end_offset + 1 - start_offset;
++ 
++-  errcode = device->ops->get_mapping_ptr (device->data, mem_id, image,
++-                                          mapping_info);
+++  /* because cl_mems are per-context, PoCL delays allocation of
+++   * cl_mem backing memory until it knows which device will need it,
+++   * so the cl_mem might not yet be allocated on this device. However,
+++   * some drivers can avoid unnecessary host memory usage if we
+++   * allocate it now. We can assume it will be used on this device. */
+++  pocl_mem_identifier *p = &image->device_ptrs[device->global_mem_id];
+++  if (p->mem_ptr == NULL)
+++    errcode = device->ops->alloc_mem_obj (device, image, NULL);
+++
+++  if (errcode == CL_SUCCESS)
+++    errcode = device->ops->get_mapping_ptr (device->data, mem_id, image,
+++                                            mapping_info);
++   DL_APPEND (image->mappings, mapping_info);
++   ++image->map_count;
++   POCL_UNLOCK_OBJ (image);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..10cfe06adaca5b940820eb3ce36f9c0b9219aa0e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,38 @@@
++From 33dd3f8e2fa7dd0910e0541376d7b5a32ee2404e Mon Sep 17 00:00:00 2001
++From: Michal Babej <michal.babej@tuni.fi>
++Date: Wed, 1 Dec 2021 15:16:26 +0200
++Subject: [PATCH 52/90] vulkan: label tests that work with vulkan driver
++
++---
++ tests/CMakeLists.txt            |  8 +++++++-
++ 9 files changed, 44 insertions(+), 5 deletions(-)
++
++diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
++index 9612b24e..ae3f9f26 100644
++--- a/tests/CMakeLists.txt
+++++ b/tests/CMakeLists.txt
++@@ -37,7 +37,7 @@ if(ENABLE_HOST_CPU_DEVICES)
++ endif()
++ 
++ #######################################################################
++-if (UNIX)
+++if (UNIX AND ENABLE_LOADABLE_DRIVERS)
++ 
++ add_test(NAME pocl_test_dlopen_libpocl COMMAND test_dlopen)
++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_libpocl")
++@@ -72,6 +72,12 @@ if(ENABLE_CUDA)
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_cuda")
++ endif()
++ 
+++if(ENABLE_VULKAN)
+++  add_test(NAME pocl_test_dlopen_device_vulkan COMMAND test_dlopen vulkan)
+++  set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_vulkan")
+++  set_property(TEST "pocl_version_check" "pocl_test_dlopen_libpocl" "pocl_test_dlopen_device_vulkan" APPEND PROPERTY LABELS "vulkan")
+++endif()
+++
++ endif ()
++ #######################################################################
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..31cfe8fb5b9503c58145e320d21a4485c83193fa
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++From 928aa90c0f5f1df9a52b92ddead76e870d91769a Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 19 Nov 2021 12:10:45 +0100
++Subject: [PATCH 58/90] run_test: show diff if test output does not match the
++ expected output
++
++---
++ cmake/run_test.cmake | 10 ++++++++++
++ 1 file changed, 10 insertions(+)
++
++diff --git a/cmake/run_test.cmake b/cmake/run_test.cmake
++index 5ea265bb..41f13bf8 100644
++--- a/cmake/run_test.cmake
+++++ b/cmake/run_test.cmake
++@@ -62,6 +62,16 @@ if(output_blessed)
++     )
++ 
++   if( test_not_successful )
+++    find_program(DIFF "diff")
+++    if(DIFF)
+++      execute_process(
+++        COMMAND "${DIFF}" "-d" "-u" "${output_blessed}" "${RANDOM_FILE}"
+++        RESULT_VARIABLE test_not_successful
+++        OUTPUT_VARIABLE stdout
+++        ERROR_VARIABLE stderr
+++        )
+++      message("${stdout}\n${stderr}")
+++    endif()
++     message(SEND_ERROR "FAIL: Test output does not match the expected output; output stored in ${RANDOM_FILE}" )
++   else()
++     file(REMOVE "${RANDOM_FILE}")
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3d510256b1a641d39f1a7c6ad9bda0397c09513c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,176 @@@
++From 99a2351887d364af48b378c6d164d2e93838212e Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 2 Dec 2021 23:49:57 +0100
++Subject: [PATCH 59/90] move vector type printf tests to a separate test
++
++---
++ tests/kernel/CMakeLists.txt                 |  9 +++++++-
++ tests/kernel/test_printf.cl                 | 22 -------------------
++ tests/kernel/test_printf_expout.txt         | 20 -----------------
++ tests/kernel/test_printf_vectors.cl         | 24 +++++++++++++++++++++
++ tests/kernel/test_printf_vectors_expout.txt | 22 +++++++++++++++++++
++ 5 files changed, 54 insertions(+), 43 deletions(-)
++ create mode 100644 tests/kernel/test_printf_vectors.cl
++ create mode 100644 tests/kernel/test_printf_vectors_expout.txt
++
++diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt
++index 2a23ceca..831ad179 100644
++--- a/tests/kernel/CMakeLists.txt
+++++ b/tests/kernel/CMakeLists.txt
++@@ -222,6 +222,10 @@ add_test_pocl(NAME "kernel/test_printf"
++               EXPECTED_OUTPUT "test_printf_expout.txt"
++               COMMAND "kernel" "test_printf")
++ 
+++add_test_pocl(NAME "kernel/test_printf_vectors"
+++              EXPECTED_OUTPUT "test_printf_vectors_expout.txt"
+++              COMMAND "kernel" "test_printf_vectors")
+++
++ add_test_pocl(NAME "kernel/test_sizeof_uint"
++               EXPECTED_OUTPUT "test_sizeof_expout.txt"
++               COMMAND "kernel" "test_sizeof")
++@@ -237,7 +241,9 @@ set_tests_properties("kernel/test_shuffle_char"
++   "kernel/test_shuffle_int" "kernel/test_shuffle_uint"
++   "kernel/test_shuffle_long" "kernel/test_shuffle_ulong"
++   "kernel/test_shuffle_float" ${EXTRA_TESTS}
++-  "kernel/test_printf" "kernel/test_sizeof_uint"
+++  "kernel/test_printf"
+++  "kernel/test_printf_vectors"
+++  "kernel/test_sizeof_uint"
++ 
++   PROPERTIES
++     COST 77
++@@ -301,6 +307,7 @@ endif()
++ set_property(TEST
++   "kernel/test_local_struct_array"
++   "kernel/test_printf"
+++  "kernel/test_printf_vectors"
++   "kernel/test_shuffle_char"
++   "kernel/test_shuffle_short"
++   "kernel/test_shuffle_ushort"
++diff --git a/tests/kernel/test_printf.cl b/tests/kernel/test_printf.cl
++index 07999772..a22ed531 100644
++--- a/tests/kernel/test_printf.cl
+++++ b/tests/kernel/test_printf.cl
++@@ -159,29 +159,7 @@ kernel void test_printf()
++   printf ("%4.6f\n", M_PI);
++   printf ("%4.7f\n", M_PI);
++ 
++-  printf ("\nVECTORS\n\n");
++-
++-  printf("%v4hld\n", (int4)9);
++-  printf("%v4hlf\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+12));
++-  printf("%10.7v4hlf\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f));
++-  printf("%v4hlg\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+33));
++-  printf("%v4hlF\n", (float4)(8.0f, INFINITY, -INFINITY, NAN));
++-
++-  printf("%v4hla\n", (float4)(10.0f, 3.88E-43f, 4.0E23f, 0.0f));
++-  printf("%v4hla\n", (float4)(90.0f, 9.0f, 0.9f, 0.09f));
++-  printf("%v4hla\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f));
++-
++-  printf("%#v2hhx\n",(char2)(0xFA,0xFB));
++-  printf("%#v2hx\n",(short2)(0x1234,0x8765));
++-  printf("%#v2hlx\n",(int2)(0x12345678,0x87654321));
++-
++   printf("|%c|%4c|%-4c|\n", 'a', 'b', 'c');
++   printf("|%s|%4s|%-4s|%4s|%.4s|\n", "aa", "bb", "cc", "dddddddddd", "eeeeee");
++   printf("|%p|%12p|%-12p|\n", (void*)0x2349aacc, (void*)0xdeaddeed, (void*)0x92820384);
++-
++-  printf ("\nPARAMETER PASSING\n\n");
++-
++-  printf("%c %#v2hhx %#v2hhx %c\n", '*', (char2)(0xFA, 0xFB), (char2)(0xFC, 0xFD), '.');
++-  printf("%c %#v2hx %#v2hx %c\n", '*', (short2)(0x1234, 0x8765), (short2)(0xBEEF, 0xF00D), '.');
++-  printf("%c %#v2hlx %#v2hlx %c\n", '*', (int2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.');
++ }
++diff --git a/tests/kernel/test_printf_expout.txt b/tests/kernel/test_printf_expout.txt
++index 81937eb4..258ba483 100644
++--- a/tests/kernel/test_printf_expout.txt
+++++ b/tests/kernel/test_printf_expout.txt
++@@ -134,27 +134,7 @@ quickfoxjump
++ 3.14
++ 3.141593
++ 3.1415927
++-
++-VECTORS
++-
++-9,9,9,9
++-90.000000,9.000000,0.900000,1986545975296.000000
++-4096.0000000, 1.0000000, 0.1250000, 0.0078125
++-90,9,0.9,1.98655e+33
++-8.000000,INF,-INF,NAN
++-0x1.4p+3,0x1.15p-141,0x1.52d02cp+78,0x0p+0
++-0x1.68p+6,0x1.2p+3,0x1.ccccccp-1,0x1.70a3d8p-4
++-0x1p+12,0x1p+0,0x1p-3,0x1p-7
++-0xfa,0xfb
++-0x1234,0x8765
++-0x12345678,0x87654321
++ |a|   b|c   |
++ |aa|  bb|cc  |dddddddddd|eeee|
++ |0x2349aacc|  0xdeaddeed|0x92820384  |
++-
++-PARAMETER PASSING
++-
++-* 0xfa,0xfb 0xfc,0xfd .
++-* 0x1234,0x8765 0xbeef,0xf00d .
++-* 0x12345678,0x87654321 0x2468ace0,0xfdb97531 .
++ OK
++diff --git a/tests/kernel/test_printf_vectors.cl b/tests/kernel/test_printf_vectors.cl
++new file mode 100644
++index 00000000..577491c0
++--- /dev/null
+++++ b/tests/kernel/test_printf_vectors.cl
++@@ -0,0 +1,24 @@
+++kernel void test_printf_vectors()
+++{
+++  printf ("\nVECTORS\n\n");
+++
+++  printf("%v4hld\n", (int4)9);
+++  printf("%v4hlf\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+12));
+++  printf("%10.7v4hlf\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f));
+++  printf("%v4hlg\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+33));
+++  printf("%v4hlF\n", (float4)(8.0f, INFINITY, -INFINITY, NAN));
+++
+++  printf("%v4hla\n", (float4)(10.0f, 3.88E-43f, 4.0E23f, 0.0f));
+++  printf("%v4hla\n", (float4)(90.0f, 9.0f, 0.9f, 0.09f));
+++  printf("%v4hla\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f));
+++
+++  printf("%#v2hhx\n",(char2)(0xFA,0xFB));
+++  printf("%#v2hx\n",(short2)(0x1234,0x8765));
+++  printf("%#v2hlx\n",(int2)(0x12345678,0x87654321));
+++
+++  printf ("\nPARAMETER PASSING\n\n");
+++
+++  printf("%c %#v2hhx %#v2hhx %c\n", '*', (char2)(0xFA, 0xFB), (char2)(0xFC, 0xFD), '.');
+++  printf("%c %#v2hx %#v2hx %c\n", '*', (short2)(0x1234, 0x8765), (short2)(0xBEEF, 0xF00D), '.');
+++  printf("%c %#v2hlx %#v2hlx %c\n", '*', (int2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.');
+++}
++diff --git a/tests/kernel/test_printf_vectors_expout.txt b/tests/kernel/test_printf_vectors_expout.txt
++new file mode 100644
++index 00000000..0a0f2b90
++--- /dev/null
+++++ b/tests/kernel/test_printf_vectors_expout.txt
++@@ -0,0 +1,22 @@
+++Running test test_printf_vectors...
+++
+++VECTORS
+++
+++9,9,9,9
+++90.000000,9.000000,0.900000,1986545975296.000000
+++4096.0000000, 1.0000000, 0.1250000, 0.0078125
+++90,9,0.9,1.98655e+33
+++8.000000,INF,-INF,NAN
+++0x1.4p+3,0x1.15p-141,0x1.52d02cp+78,0x0p+0
+++0x1.68p+6,0x1.2p+3,0x1.ccccccp-1,0x1.70a3d8p-4
+++0x1p+12,0x1p+0,0x1p-3,0x1p-7
+++0xfa,0xfb
+++0x1234,0x8765
+++0x12345678,0x87654321
+++
+++PARAMETER PASSING
+++
+++* 0xfa,0xfb 0xfc,0xfd .
+++* 0x1234,0x8765 0xbeef,0xf00d .
+++* 0x12345678,0x87654321 0x2468ace0,0xfdb97531 .
+++OK
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..593dad29802771230eac1bf3cc537102047971dc
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,316 @@@
++From 1b60e63790980e0632fb23d7ad11cad84237dd19 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 22 Nov 2021 13:21:28 +0100
++Subject: [PATCH 60/90] add printf() tests for all (unsigned, fp) vector types
++ and sizes
++
++---
++ tests/kernel/test_printf_vectors.cl         | 193 +++++++++++++++++++-
++ tests/kernel/test_printf_vectors_expout.txt |  86 ++++++++-
++ 2 files changed, 274 insertions(+), 5 deletions(-)
++
++diff --git a/tests/kernel/test_printf_vectors.cl b/tests/kernel/test_printf_vectors.cl
++index 577491c0..c0f3a6d2 100644
++--- a/tests/kernel/test_printf_vectors.cl
+++++ b/tests/kernel/test_printf_vectors.cl
++@@ -16,9 +16,196 @@ kernel void test_printf_vectors()
++   printf("%#v2hx\n",(short2)(0x1234,0x8765));
++   printf("%#v2hlx\n",(int2)(0x12345678,0x87654321));
++ 
+++  printf("\n");
+++  printf("uchar2   %#v2hhx\n", (uchar2)(0xa1, 0xa2));
+++  printf("uchar3   %#v3hhx\n", (uchar3)(0xb1, 0xb2, 0xb3));
+++  printf("uchar4   %#v4hhx\n", (uchar4)(0xc1, 0xc2, 0xc3, 0xc4));
+++  printf("uchar8   %#v8hhx\n", (uchar8)(0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8));
+++  printf("uchar16  %#v16hhx\n", (uchar16)(0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf1));
+++
+++  printf("\n");
+++  printf("ushort2  %#v2hx\n", (ushort2)(0xa1a2, 0xa3a4));
+++  printf("ushort3  %#v3hx\n", (ushort3)(0xb1b2, 0xb3b4, 0xb5b6));
+++  printf("ushort4  %#v4hx\n", (ushort4)(0xc1c2, 0xc3c4, 0xc5c6, 0xc7c8));
+++  printf("ushort8  %#v8hx\n", (ushort8)(0xd1d2, 0xd3d4, 0xd5d6, 0xd7d8, 0xd9da, 0xdbdc, 0xddde, 0xdfe1));
+++  printf("ushort16 %#v16hx\n", (ushort16)(0xf1f2, 0xf3f4, 0xf5f6, 0xf7f8, 0xf9fa, 0xfbfc, 0xfdfe, 0xff11, 0x1213, 0x1415, 0x1617, 0x1819, 0x1a1b, 0x1c1d, 0x1e1f, 0x2122));
+++
+++  printf("\n");
+++  printf("uint2    %#v2hlx\n", (uint2)(0xa1a2a3a4, 0xa5a6a7a8));
+++  printf("uint3    %#v3hlx\n", (uint3)(0xb1b2b3b4, 0xb5b6b7b8, 0xb9babbbc));
+++  printf("uint4    %#v4hlx\n", (uint4)(0xc1c2c3c4, 0xc5c6c7c8, 0xc9cacbcc, 0xcdcecfd1));
+++  printf("uint8    %#v8hlx\n", (uint8)(0xe1e2e3e4, 0xe5e6e7e8, 0xe9eaebec, 0xedeeeff1, 0xf2f3f4f5, 0xf6f7f8f9, 0xfafbfcfd, 0xfeff1112));
+++  printf("uint16   %#v16hlx\n", (uint16)(0x21222324, 0x25262728, 0x292a2b2c, 0x2d2e2f31, 0x32333435, 0x36373839, 0x3a3b3c3d, 0x3e3f4142, 0x43444546, 0x4748494a, 0x4b4c4d4f, 0x51525354, 0x55565758, 0x595a5b5c, 0x5d5e5f61, 0x62636465));
+++
+++#ifdef cl_khr_int64
+++  printf("\n");
+++  printf("ulong2   %#v2lx\n", (ulong2)(0xa1a2a3a4a5a6a7a8UL, 0xa9aaabacadaeafb1UL));
+++  printf("ulong3   %#v3lx\n", (ulong3)(0xc1c2c3c4c5c6c7c8UL, 0xc9cacbcccdcecfd1UL, 0xd2d3d4d5d6d7d8d9UL));
+++  printf("ulong4   %#v4lx\n", (ulong4)(0xe1e2e3e4e5e6e7e8UL, 0xe9eaebecedeeeff1UL, 0xf2f3f4f5f6f7f8f9UL, 0xfafbfcfdfeff1112UL));
+++  printf("ulong8   %#v8lx\n", (ulong8)(0x2122232425262728UL, 0x292a2b2c2d2e2f31UL, 0x3233343536373839UL, 0x3a3b3c3d3e3f4142UL, 0x434445464748494aUL, 0x4b4c4d4e4f515253UL, 0x5455565758595a5bUL, 0x5c5d5e5f61626364UL));
+++  printf("ulong16  %#v16lx\n", (ulong16)(0x7172737475767778UL, 0x797a7b7c7d7e7f81UL, 0x8283848586878889UL, 0x8a8b8c8d8e8f9192UL, 0x939495969798999aUL, 0x9b9c9d9e9fa1a2a3UL, 0xa4a5a6a7a8a9aaabUL, 0xacadaeafb1b2b3b4UL,
+++                                         0xb5b6b7b8b9babbbcUL, 0xbdbebfc1c2c3c4c5UL, 0xc6c7c8c9cacbcccdUL, 0xcecfd1d2d3d4d5d6UL, 0xd7d8d9dadbdcdddeUL, 0xdfe1e2e3e4e5e6e7UL, 0xe8e9eaebecedeeefUL, 0xf1f2f3f4f5f6f7f8UL));
+++#endif
+++
+++  printf("\n");
+++  printf("float2   %v2hlg\n", (float2)(1.012f, 2.022f));
+++  printf("float3   %v3hlg\n", (float3)(1.013f, 2.023f, 3.033f));
+++  printf("float4   %v4hlg\n", (float4)(1.014f, 2.024f, 3.034f, 4.044f));
+++  printf("float8   %v8hlg\n", (float8)(1.018f, 2.028f, 3.038f, 4.048f, 5.058f, 6.068f, 7.078f, 8.088f));
+++  printf("float16  %v16hlg\n", (float16)(1.01f, 2.02f, 3.03f, 4.04f, 5.05f, 6.06f, 7.07f, 8.08f, 9.09f, 10.010f, 11.011f, 12.012f, 13.013f, 14.014f, 15.015f, 16.016f));
+++
+++#ifdef cl_khr_fp64
+++  printf("\n");
+++  printf("double2  %v2lg\n", (double2)(10.112, 20.222));
+++  printf("double3  %v3lg\n", (double3)(10.113, 20.223, 30.333));
+++  printf("double4  %v4lg\n", (double4)(10.114, 20.224, 30.334, 40.444));
+++  printf("double8  %v8lg\n", (double8)(10.118, 20.228, 30.338, 40.448, 50.558, 60.668, 70.778, 80.888));
+++  printf("double16 %v16lg\n", (double16)(10.11, 20.22, 30.33, 40.44, 50.55, 60.66, 70.77, 80.88, 90.99, 100.1, 110.2, 120.3, 130.4, 140.5, 150.6, 160.7));
+++#endif
+++
++   printf ("\nPARAMETER PASSING\n\n");
++ 
++-  printf("%c %#v2hhx %#v2hhx %c\n", '*', (char2)(0xFA, 0xFB), (char2)(0xFC, 0xFD), '.');
++-  printf("%c %#v2hx %#v2hx %c\n", '*', (short2)(0x1234, 0x8765), (short2)(0xBEEF, 0xF00D), '.');
++-  printf("%c %#v2hlx %#v2hlx %c\n", '*', (int2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.');
+++  printf("%c %#v2hhx %#v2hhx %c\n", '*', (uchar2)(0xFA, 0xFB), (char2)(0x21, 0xFD), '.');
+++  printf("%c %#v2hx %#v2hx %c\n", '*', (ushort2)(0x1234, 0x8765), (short2)(0xBE21, 0xF00D), '.');
+++  printf("%c %#v2hlx %#v2hlx %c\n", '*', (uint2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.');
+++  printf("%c %#v2hhx %#v2hhx %#v2hhx %#v2hhx %#v2hhx %#v2hhx %#v2hhx %#v2hhx %c\n",
+++         '*',
+++         (uchar2)(0xFA,0xFB),
+++         (uchar2)(0xFC,0xFD),
+++         (uchar2)(-23,-42),
+++         (uchar2)(0xFE,0xFF),
+++         (uchar2)(0x21,0x2B),
+++         (uchar2)(0x3A,0x3B),
+++         (uchar2)(0x4A,0x4B),
+++         (uchar2)(0x5A,0x5B),
+++         '.');
+++
+++  printf("\n%c %#v2hhx %#v2hhx %c\n", 'c',
+++         (uchar2)(0xa1, 0xa2),
+++         (uchar2)(0x21, 0xb4), '.');
+++  printf("%c %#v3hhx %#v3hhx %c\n", 'c',
+++         (uchar3)(0xc1, 0xc2, 0x21),
+++         (uchar3)(0xd4, 0xd5, 0xd6), '.');
+++  printf("%c %#v4hhx %#v4hhx %c\n", 'c',
+++         (uchar4)(0xe1, 0xe2, 0x21, 0xe4),
+++         (uchar4)(0xf5, 0xf6, 0xf7, 0xf8), '.');
+++  printf("%c %#v8hhx %#v8hhx %c\n", 'c',
+++         (uchar8)(0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18),
+++         (uchar8)(0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x31), '.');
+++  printf("%c %#v16hhx %#v16hhx %c\n", 'c',
+++         (uchar16)(0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x21, 0x4d, 0x4e, 0x4f, 0x51),
+++         (uchar16)(0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x61, 0x62), '.');
+++  printf("%c %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %#hhx %c\n", 'c',
+++         0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x81,
+++         0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x91, 0x92, '.');
+++
+++  printf("\n%c %#v2hx %#v2hx %c\n", 's',
+++         (ushort2)(0xa1a2, 0xa3a4),
+++         (ushort2)(0xb521, 0xb7b8), '.');
+++  printf("%c %#v3hx %#v3hx %c\n", 's',
+++         (ushort3)(0xc1c2, 0xc3c4, 0xc5c6),
+++         (ushort3)(0xd7d8, 0xd921, 0xdbdc), '.');
+++  printf("%c %#v4hx %#v4hx %c\n", 's',
+++         (ushort4)(0xe1e2, 0xe3e4, 0xe5e6, 0xe7e8),
+++         (ushort4)(0xf9fa, 0xfbfc, 0xfdfe, 0xff11), '.');
+++  printf("%c %#v8hx %#v8hx %c\n", 's',
+++         (ushort8)(0x2122, 0x2324, 0x2526, 0x2728, 0x292a, 0x2b2c, 0x2d2e, 0x2f31),
+++         (ushort8)(0x3233, 0x3435, 0x3637, 0x3821, 0x3a3b, 0x3c3d, 0x3e3f, 0x4142), '.');
+++  printf("%c %#v16hx %#v16hx %c\n", 's',
+++         (ushort16)(0x5152, 0x5354, 0x5556, 0x5758, 0x595a, 0x5b5c, 0x5d5e, 0x5f61, 0x6263, 0x6465, 0x6667, 0x6869, 0x6a6b, 0x6c6d, 0x6e6f, 0x7172),
+++         (ushort16)(0x7374, 0x7576, 0x7778, 0x797a, 0x7b7c, 0x7d7e, 0x7f81, 0x8221, 0x8485, 0x8687, 0x8889, 0x8a8b, 0x8c8d, 0x8e8f, 0x9192, 0x9394), '.');
+++  printf("%c %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %#hx %c\n", 's',
+++         0xa1a2, 0xa3a4, 0xa5a6, 0xa7a8, 0xa9aa, 0xabac, 0xadae, 0xafb1, 0xb2b3, 0xb4b5, 0xb6b7, 0xb8b9, 0xbabb, 0xbcbd, 0xbebf, 0xc1c2,
+++         0xc3c4, 0xc5c6, 0xc7c8, 0xc9ca, 0xcbcc, 0xcdce, 0xcfd1, 0xd2d3, 0xd4d5, 0xd6d7, 0xd8d9, 0xdadb, 0xdcdd, 0xdedf, 0xe1e2, 0xe3e4, '.');
+++
+++  printf("\n%c %#v2hlx %#v2hlx %c\n", 'i',
+++         (uint2)(0xa1a2a3a4, 0xa5a6a7a8),
+++         (uint2)(0xb9babbbc, 0xbdbebfc1), '.');
+++  printf("%c %#v3hlx %#v3hlx %c\n", 'i',
+++         (uint3)(0xd1d2d3d4, 0xd5d6d7d8, 0xd9dadbdc),
+++         (uint3)(0xedeeeff1, 0xf2f3f4f5, 0xf6f7f8f9), '.');
+++  printf("%c %#v4hlx %#v4hlx %c\n", 'i',
+++         (uint4)(0x11121314, 0x15161718, 0x191a1b1c, 0x1d1e1f21),
+++         (uint4)(0x22232425, 0x26272829, 0x2a2b2c2d, 0x2e2f3132), '.');
+++  printf("%c %#v8hlx %#v8hlx %c\n", 'i',
+++         (uint8)(0x41424344, 0x45464748, 0x494a4b4c, 0x4d4e4f51, 0x51535455, 0x35575859, 0x5a5b5c5d, 0x5e5f6162),
+++         (uint8)(0x63646566, 0x6768696a, 0x6b6c6d6e, 0x6f717273, 0x74757677, 0x78797a7b, 0x7c7d7e7f, 0x81828384), '.');
+++  printf("%c %#v16hlx %#v16hlx %c\n", 'i',
+++         (uint16)(0x91929394, 0x95969798, 0x999a9b9c, 0x9d9e9fa1, 0xa2a3a4a5, 0xa6a7a8a9, 0xaaabacad, 0xaeafb1b2, 0xb3b4b5b6, 0xb7b8b9ba, 0xbbbcbdbe, 0xbfc1c2c3, 0xc4c5c6c7, 0xc8c9cacb, 0xcccdcecf, 0xd1d2d3d4),
+++         (uint16)(0xd5d6d7d8, 0xd9dadbdc, 0xdddedfe1, 0xe2e3e4e5, 0xe6e7e8e9, 0xeaebeced, 0xeeeff1f2, 0xf3f4f5f6, 0xf7f8f9fa, 0xfbfcfdfe, 0xff111213, 0x14151617, 0x18191a1b, 0x1c1d1e1f, 0x21222324, 0x25262728), '.');
+++  printf("%c %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %#x %c\n", 'i',
+++         0x31323334, 0x35363738, 0x393a3b3c, 0x3d3e3f41, 0x42434445, 0x46474849, 0x4a4b4c4d, 0x4e4f5152, 0x53545556, 0x5758595a, 0x5b5c5d5e, 0x5f616263, 0x64656667, 0x68696a6b, 0x6c6d6e6f, 0x71727374,
+++         0x75767778, 0x797a7b7c, 0x7d7e7f81, 0x82838485, 0x86878889, 0x8a8b8c8d, 0x8e8f9192, 0x93949596, 0x9798999a, 0x9b9c9d9e, 0x9fa1a2a3, 0xa4a5a6a7, 0xa8a9aaab, 0xacadaeaf, 0xb1b2b3b4, 0xb5b6b7b8, '.');
+++
+++#ifdef cl_khr_int64
+++  printf("\n%c %#v2lx %#v2lx %c\n", 'l',
+++         (ulong2)(0xa1a2a3a4a5a6a7a8UL, 0xa9aaabacadaeafb1UL),
+++         (ulong2)(0xb2b3b4b5b6b7b8b9UL, 0xbabbbcbdbebfc1c2UL), '.');
+++  printf("%c %#v3lx %#v3lx %c\n", 'l',
+++         (ulong3)(0xd1d2d3d4d5d6d7d8UL, 0xd9dadbdcdddedfe1UL, 0xe2e3e4e5e6e7e8e9UL),
+++         (ulong3)(0xeaebecedeeeff1f2UL, 0xf3f4f5f6f7f8f9faUL, 0xfbfcfdfeff111213UL), '.');
+++  printf("%c %#v4lx %#v4lx %c\n", 'l',
+++         (ulong4)(0x2122232425262728UL, 0x292a2b2c2d2e2f31UL, 0x3233343536373839UL, 0x3a3b3c3d3e3f4142UL),
+++         (ulong4)(0x434445464748494aUL, 0x4b4c4d4e4f515253UL, 0x5455565758595a5bUL, 0x5c5d5e5f61626364UL), '.');
+++  printf("%c %#v8lx %#v8lx %c\n", 'l',
+++         (ulong8)(0x7172737475767778UL, 0x797a7b7c7d7e7f81UL, 0x8283848586878889UL, 0x8a8b8c8d8e8f9192UL, 0x939495969798999aUL, 0x9b9c9d9e9fa1a2a3UL, 0xa4a5a6a7a8a9aaabUL, 0xacadaeafb1b2b3b4UL),
+++         (ulong8)(0xb5b6b7b8b9babbbcUL, 0xbdbebfc1c2c3c4c5UL, 0xc6c7c8c9cacbcccdUL, 0xcecfd1d2d3d4d5d6UL, 0xd7d8d9dadbdcdddeUL, 0xdfe1e2e3e4e5e6e7UL, 0xe8e9eaebecedeeefUL, 0xf1f2f3f4f5f6f7f8UL), '.');
+++  printf("%c %#v16lx %#v16lx %c\n", 'l',
+++         (ulong16)(0x1112131415161718UL, 0x191a1b1c1d1e1f21UL, 0x2223242526272829UL, 0x2a2b2c2d2e2f3132UL, 0x333435363738393aUL, 0x3b3c3d3e3f414243UL, 0x4445464748494a4bUL, 0x4c4d4e4f51525354UL,
+++                   0x55565758595a5b5cUL, 0x5d5e5f6162636465UL, 0x666768696a6b6c6dUL, 0x6e6f717273747576UL, 0x7778797a7b7c7d7eUL, 0x7f81828384858687UL, 0x88898a8b8c8d8e8fUL, 0x9192939495969798UL),
+++         (ulong16)(0x999a9b9c9d9e9fa1UL, 0xa2a3a4a5a6a7a8a9UL, 0xaaabacadaeafb1b2UL, 0xb3b4b5b6b7b8b9baUL, 0xbbbcbdbebfc1c2c3UL, 0xc4c5c6c7c8c9cacbUL, 0xcccdcecfd1d2d3d4UL, 0xd5d6d7d8d9dadbdcUL,
+++                   0xdddedfe1e2e3e4e5UL, 0xe6e7e8e9eaebecedUL, 0xeeeff1f2f3f4f5f6UL, 0xf7f8f9fafbfcfdfeUL, 0xff11121314151617UL, 0x18191a1b1c1d1e1fUL, 0x2122232425262728UL, 0x292a2b2c2d2e2f31UL), '.');
+++  printf("%c %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %#lx %c\n", 'l',
+++         0x4142434445464748UL, 0x494a4b4c4d4e4f51UL, 0x5253545556575859UL, 0x5a5b5c5d5e5f6162UL, 0x636465666768696aUL, 0x6b6c6d6e6f717273UL, 0x7475767778797a7bUL, 0x7c7d7e7f81828384UL,
+++         0x85868788898a8b8cUL, 0x8d8e8f9192939495UL, 0x969798999a9b9c9dUL, 0x9e9fa1a2a3a4a5a6UL, 0xa7a8a9aaabacadaeUL, 0xafb1b2b3b4b5b6b7UL, 0xb8b9babbbcbdbebfUL, 0xc1c2c3c4c5c6c7c8UL,
+++         0xc9cacbcccdcecfd1UL, 0xd2d3d4d5d6d7d8d9UL, 0xdadbdcdddedfe1e2UL, 0xe3e4e5e6e7e8e9eaUL, 0xebecedeeeff1f2f3UL, 0xf4f5f6f7f8f9fafbUL, 0xfcfdfeff11121314UL, 0x15161718191a1b1cUL,
+++         0x1d1e1f2122232425UL, 0x262728292a2b2c2dUL, 0x2e2f313233343536UL, 0x3738393a3b3c3d3eUL, 0x3f41424344454647UL, 0x48494a4b4c4d4e4fUL, 0x5152535455565758UL, 0x595a5b5c5d5e5f61UL, '.');
+++#endif
+++
+++  printf("\n%c %v2hlg %v2hlg %c\n", 'f',
+++         (float2)(21.1f, 21.2f),
+++         (float2)(22.3f, 22.4f), '.');
+++  printf("%c %v3hlg %v3hlg %c\n", 'f',
+++         (float3)(31.1f, 31.2f, 31.3f),
+++         (float3)(32.4f, 32.5f, 32.6f), '.');
+++  printf("%c %v4hlg %v4hlg %c\n", 'f',
+++         (float4)(41.1f, 41.2f, 41.3f, 41.4f),
+++         (float4)(42.5f, 42.6f, 42.7f, 42.8f), '.');
+++  printf("%c %v8hlg %v8hlg %c\n", 'f',
+++         (float8)(81.01f, 81.02f, 81.03f, 81.04f, 81.05f, 81.06f, 81.07f, 81.08f),
+++         (float8)(82.09f, 82.10f, 82.11f, 82.12f, 82.13f, 82.14f, 82.15f, 82.16f), '.');
+++  printf("%c %v16hlg %v16hlg %c\n", 'f',
+++         (float16)(1.01f, 1.02f, 1.03f, 1.04f, 1.05f, 1.06f, 1.07f, 1.08f, 1.09f, 1.10f, 1.11f, 1.12f, 1.13f, 1.14f, 1.15f, 1.16f),
+++         (float16)(2.17f, 2.18f, 2.19f, 2.20f, 2.21f, 2.22f, 2.23f, 2.24f, 2.25f, 2.26f, 2.27f, 2.28f, 2.29f, 2.30f, 2.31f, 2.32f), '.');
+++  printf("%c %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %c\n", 'f',
+++         1.4f, 2.4f, 3.4f, 4.4f, 5.4f, 6.4f, 7.4f, 8.4f, 9.4f, 10.4f, 11.4f, 12.4f, 13.4f, 14.4f, 15.4f, 16.4f,
+++         17.4f, 18.4f, 19.4f, 20.4f, 21.4f, 22.4f, 23.4f, 24.4f, 25.4f, 26.4f, 27.4f, 28.4f, 29.4f, 30.4f, 31.4f, 32.4f, '.');
+++
+++#ifdef cl_khr_fp64
+++  printf("\n%c %v2lg %v2lg %c\n", 'd',
+++         (double2)(21.1, 21.2),
+++         (double2)(22.3, 22.4), '.');
+++  printf("%c %v3lg %v3lg %c\n", 'd',
+++         (double3)(31.1, 31.2, 31.3),
+++         (double3)(32.4, 32.5, 32.6), '.');
+++  printf("%c %v4lg %v4lg %c\n", 'd',
+++         (double4)(41.1, 41.2, 41.3, 41.4),
+++         (double4)(42.5, 42.6, 42.7, 42.8), '.');
+++  printf("%c %v8lg %v8lg %c\n", 'd',
+++         (double8)(81.01, 81.02, 81.03, 81.04, 81.05, 81.06, 81.07, 81.08),
+++         (double8)(82.09, 82.10, 82.11, 82.12, 82.13, 82.14, 82.15, 82.16), '.');
+++  printf("%c %v16lg %v16lg %c\n", 'd',
+++         (double16)(1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16),
+++         (double16)(2.17, 2.18, 2.19, 2.20, 2.21, 2.22, 2.23, 2.24, 2.25, 2.26, 2.27, 2.28, 2.29, 2.30, 2.31, 2.32), '.');
+++  printf("%c %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %c\n", 'd',
+++         1.8, 2.8, 3.8, 4.8, 5.8, 6.8, 7.8, 8.8, 9.8, 10.8, 11.8, 12.8, 13.8, 14.8, 15.8, 16.8,
+++         17.8, 18.8, 19.8, 20.8, 21.8, 22.8, 23.8, 24.8, 25.8, 26.8, 27.8, 28.8, 29.8, 30.8, 31.8, 32.8, '.');
+++#endif
+++
+++  printf("\n%c %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %c\n", 'x',
+++         0x31323334, 2.4f, 0x393a3b3c, 4.4f, 0x42434445, 6.4f, 0x4a4b4c4d, 8.4f, 0x53545556, 10.4f, 0x5b5c5d5e, 12.4f, 0x64656667, 14.4f, 0x6c6d6e6f, 16.4f,
+++         0x75767778, 18.4f, 0x7d7e7f81, 20.4f, 0x86878889, 22.4f, 0x8e8f9192, 24.4f, 0x9798999a, 26.4f, 0x9fa1a2a3, 28.4f, 0xa8a9aaab, 30.4f, 0xb1b2b3b4, 32.4f, '.');
+++  printf("%c %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %g %#x %c\n", 'x',
+++         1.4f, 0x35363738, 3.4f, 0x3d3e3f41, 5.4f, 0x46474849, 7.4f, 0x4e4f5152, 9.4f, 0x5758595a, 11.4f, 0x5f616263, 13.4f, 0x68696a6b, 15.4f, 0x71727374,
+++         17.4f, 0x797a7b7c, 19.4f, 0x82838485, 21.4f, 0x8a8b8c8d, 23.4f, 0x93949596, 25.4f, 0x9b9c9d9e, 27.4f, 0xa4a5a6a7, 29.4f, 0xacadaeaf, 31.4f, 0xb5b6b7b8, '.');
++ }
++diff --git a/tests/kernel/test_printf_vectors_expout.txt b/tests/kernel/test_printf_vectors_expout.txt
++index 0a0f2b90..75784731 100644
++--- a/tests/kernel/test_printf_vectors_expout.txt
+++++ b/tests/kernel/test_printf_vectors_expout.txt
++@@ -14,9 +14,91 @@ VECTORS
++ 0x1234,0x8765
++ 0x12345678,0x87654321
++ 
+++uchar2   0xa1,0xa2
+++uchar3   0xb1,0xb2,0xb3
+++uchar4   0xc1,0xc2,0xc3,0xc4
+++uchar8   0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8
+++uchar16  0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,0xf1
+++
+++ushort2  0xa1a2,0xa3a4
+++ushort3  0xb1b2,0xb3b4,0xb5b6
+++ushort4  0xc1c2,0xc3c4,0xc5c6,0xc7c8
+++ushort8  0xd1d2,0xd3d4,0xd5d6,0xd7d8,0xd9da,0xdbdc,0xddde,0xdfe1
+++ushort16 0xf1f2,0xf3f4,0xf5f6,0xf7f8,0xf9fa,0xfbfc,0xfdfe,0xff11,0x1213,0x1415,0x1617,0x1819,0x1a1b,0x1c1d,0x1e1f,0x2122
+++
+++uint2    0xa1a2a3a4,0xa5a6a7a8
+++uint3    0xb1b2b3b4,0xb5b6b7b8,0xb9babbbc
+++uint4    0xc1c2c3c4,0xc5c6c7c8,0xc9cacbcc,0xcdcecfd1
+++uint8    0xe1e2e3e4,0xe5e6e7e8,0xe9eaebec,0xedeeeff1,0xf2f3f4f5,0xf6f7f8f9,0xfafbfcfd,0xfeff1112
+++uint16   0x21222324,0x25262728,0x292a2b2c,0x2d2e2f31,0x32333435,0x36373839,0x3a3b3c3d,0x3e3f4142,0x43444546,0x4748494a,0x4b4c4d4f,0x51525354,0x55565758,0x595a5b5c,0x5d5e5f61,0x62636465
+++
+++ulong2   0xa1a2a3a4a5a6a7a8,0xa9aaabacadaeafb1
+++ulong3   0xc1c2c3c4c5c6c7c8,0xc9cacbcccdcecfd1,0xd2d3d4d5d6d7d8d9
+++ulong4   0xe1e2e3e4e5e6e7e8,0xe9eaebecedeeeff1,0xf2f3f4f5f6f7f8f9,0xfafbfcfdfeff1112
+++ulong8   0x2122232425262728,0x292a2b2c2d2e2f31,0x3233343536373839,0x3a3b3c3d3e3f4142,0x434445464748494a,0x4b4c4d4e4f515253,0x5455565758595a5b,0x5c5d5e5f61626364
+++ulong16  0x7172737475767778,0x797a7b7c7d7e7f81,0x8283848586878889,0x8a8b8c8d8e8f9192,0x939495969798999a,0x9b9c9d9e9fa1a2a3,0xa4a5a6a7a8a9aaab,0xacadaeafb1b2b3b4,0xb5b6b7b8b9babbbc,0xbdbebfc1c2c3c4c5,0xc6c7c8c9cacbcccd,0xcecfd1d2d3d4d5d6,0xd7d8d9dadbdcddde,0xdfe1e2e3e4e5e6e7,0xe8e9eaebecedeeef,0xf1f2f3f4f5f6f7f8
+++
+++float2   1.012,2.022
+++float3   1.013,2.023,3.033
+++float4   1.014,2.024,3.034,4.044
+++float8   1.018,2.028,3.038,4.048,5.058,6.068,7.078,8.088
+++float16  1.01,2.02,3.03,4.04,5.05,6.06,7.07,8.08,9.09,10.01,11.011,12.012,13.013,14.014,15.015,16.016
+++
+++double2  10.112,20.222
+++double3  10.113,20.223,30.333
+++double4  10.114,20.224,30.334,40.444
+++double8  10.118,20.228,30.338,40.448,50.558,60.668,70.778,80.888
+++double16 10.11,20.22,30.33,40.44,50.55,60.66,70.77,80.88,90.99,100.1,110.2,120.3,130.4,140.5,150.6,160.7
+++
++ PARAMETER PASSING
++ 
++-* 0xfa,0xfb 0xfc,0xfd .
++-* 0x1234,0x8765 0xbeef,0xf00d .
+++* 0xfa,0xfb 0x21,0xfd .
+++* 0x1234,0x8765 0xbe21,0xf00d .
++ * 0x12345678,0x87654321 0x2468ace0,0xfdb97531 .
+++* 0xfa,0xfb 0xfc,0xfd 0xe9,0xd6 0xfe,0xff 0x21,0x2b 0x3a,0x3b 0x4a,0x4b 0x5a,0x5b .
+++
+++c 0xa1,0xa2 0x21,0xb4 .
+++c 0xc1,0xc2,0x21 0xd4,0xd5,0xd6 .
+++c 0xe1,0xe2,0x21,0xe4 0xf5,0xf6,0xf7,0xf8 .
+++c 0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x31 .
+++c 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x21,0x4d,0x4e,0x4f,0x51 0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x61,0x62 .
+++c 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x91 0x92 .
+++
+++s 0xa1a2,0xa3a4 0xb521,0xb7b8 .
+++s 0xc1c2,0xc3c4,0xc5c6 0xd7d8,0xd921,0xdbdc .
+++s 0xe1e2,0xe3e4,0xe5e6,0xe7e8 0xf9fa,0xfbfc,0xfdfe,0xff11 .
+++s 0x2122,0x2324,0x2526,0x2728,0x292a,0x2b2c,0x2d2e,0x2f31 0x3233,0x3435,0x3637,0x3821,0x3a3b,0x3c3d,0x3e3f,0x4142 .
+++s 0x5152,0x5354,0x5556,0x5758,0x595a,0x5b5c,0x5d5e,0x5f61,0x6263,0x6465,0x6667,0x6869,0x6a6b,0x6c6d,0x6e6f,0x7172 0x7374,0x7576,0x7778,0x797a,0x7b7c,0x7d7e,0x7f81,0x8221,0x8485,0x8687,0x8889,0x8a8b,0x8c8d,0x8e8f,0x9192,0x9394 .
+++s 0xa1a2 0xa3a4 0xa5a6 0xa7a8 0xa9aa 0xabac 0xadae 0xafb1 0xb2b3 0xb4b5 0xb6b7 0xb8b9 0xbabb 0xbcbd 0xbebf 0xc1c2 0xc3c4 0xc5c6 0xc7c8 0xc9ca 0xcbcc 0xcdce 0xcfd1 0xd2d3 0xd4d5 0xd6d7 0xd8d9 0xdadb 0xdcdd 0xdedf 0xe1e2 0xe3e4 .
+++
+++i 0xa1a2a3a4,0xa5a6a7a8 0xb9babbbc,0xbdbebfc1 .
+++i 0xd1d2d3d4,0xd5d6d7d8,0xd9dadbdc 0xedeeeff1,0xf2f3f4f5,0xf6f7f8f9 .
+++i 0x11121314,0x15161718,0x191a1b1c,0x1d1e1f21 0x22232425,0x26272829,0x2a2b2c2d,0x2e2f3132 .
+++i 0x41424344,0x45464748,0x494a4b4c,0x4d4e4f51,0x51535455,0x35575859,0x5a5b5c5d,0x5e5f6162 0x63646566,0x6768696a,0x6b6c6d6e,0x6f717273,0x74757677,0x78797a7b,0x7c7d7e7f,0x81828384 .
+++i 0x91929394,0x95969798,0x999a9b9c,0x9d9e9fa1,0xa2a3a4a5,0xa6a7a8a9,0xaaabacad,0xaeafb1b2,0xb3b4b5b6,0xb7b8b9ba,0xbbbcbdbe,0xbfc1c2c3,0xc4c5c6c7,0xc8c9cacb,0xcccdcecf,0xd1d2d3d4 0xd5d6d7d8,0xd9dadbdc,0xdddedfe1,0xe2e3e4e5,0xe6e7e8e9,0xeaebeced,0xeeeff1f2,0xf3f4f5f6,0xf7f8f9fa,0xfbfcfdfe,0xff111213,0x14151617,0x18191a1b,0x1c1d1e1f,0x21222324,0x25262728 .
+++i 0x31323334 0x35363738 0x393a3b3c 0x3d3e3f41 0x42434445 0x46474849 0x4a4b4c4d 0x4e4f5152 0x53545556 0x5758595a 0x5b5c5d5e 0x5f616263 0x64656667 0x68696a6b 0x6c6d6e6f 0x71727374 0x75767778 0x797a7b7c 0x7d7e7f81 0x82838485 0x86878889 0x8a8b8c8d 0x8e8f9192 0x93949596 0x9798999a 0x9b9c9d9e 0x9fa1a2a3 0xa4a5a6a7 0xa8a9aaab 0xacadaeaf 0xb1b2b3b4 0xb5b6b7b8 .
+++
+++l 0xa1a2a3a4a5a6a7a8,0xa9aaabacadaeafb1 0xb2b3b4b5b6b7b8b9,0xbabbbcbdbebfc1c2 .
+++l 0xd1d2d3d4d5d6d7d8,0xd9dadbdcdddedfe1,0xe2e3e4e5e6e7e8e9 0xeaebecedeeeff1f2,0xf3f4f5f6f7f8f9fa,0xfbfcfdfeff111213 .
+++l 0x2122232425262728,0x292a2b2c2d2e2f31,0x3233343536373839,0x3a3b3c3d3e3f4142 0x434445464748494a,0x4b4c4d4e4f515253,0x5455565758595a5b,0x5c5d5e5f61626364 .
+++l 0x7172737475767778,0x797a7b7c7d7e7f81,0x8283848586878889,0x8a8b8c8d8e8f9192,0x939495969798999a,0x9b9c9d9e9fa1a2a3,0xa4a5a6a7a8a9aaab,0xacadaeafb1b2b3b4 0xb5b6b7b8b9babbbc,0xbdbebfc1c2c3c4c5,0xc6c7c8c9cacbcccd,0xcecfd1d2d3d4d5d6,0xd7d8d9dadbdcddde,0xdfe1e2e3e4e5e6e7,0xe8e9eaebecedeeef,0xf1f2f3f4f5f6f7f8 .
+++l 0x1112131415161718,0x191a1b1c1d1e1f21,0x2223242526272829,0x2a2b2c2d2e2f3132,0x333435363738393a,0x3b3c3d3e3f414243,0x4445464748494a4b,0x4c4d4e4f51525354,0x55565758595a5b5c,0x5d5e5f6162636465,0x666768696a6b6c6d,0x6e6f717273747576,0x7778797a7b7c7d7e,0x7f81828384858687,0x88898a8b8c8d8e8f,0x9192939495969798 0x999a9b9c9d9e9fa1,0xa2a3a4a5a6a7a8a9,0xaaabacadaeafb1b2,0xb3b4b5b6b7b8b9ba,0xbbbcbdbebfc1c2c3,0xc4c5c6c7c8c9cacb,0xcccdcecfd1d2d3d4,0xd5d6d7d8d9dadbdc,0xdddedfe1e2e3e4e5,0xe6e7e8e9eaebeced,0xeeeff1f2f3f4f5f6,0xf7f8f9fafbfcfdfe,0xff11121314151617,0x18191a1b1c1d1e1f,0x2122232425262728,0x292a2b2c2d2e2f31 .
+++l 0x4142434445464748 0x494a4b4c4d4e4f51 0x5253545556575859 0x5a5b5c5d5e5f6162 0x636465666768696a 0x6b6c6d6e6f717273 0x7475767778797a7b 0x7c7d7e7f81828384 0x85868788898a8b8c 0x8d8e8f9192939495 0x969798999a9b9c9d 0x9e9fa1a2a3a4a5a6 0xa7a8a9aaabacadae 0xafb1b2b3b4b5b6b7 0xb8b9babbbcbdbebf 0xc1c2c3c4c5c6c7c8 0xc9cacbcccdcecfd1 0xd2d3d4d5d6d7d8d9 0xdadbdcdddedfe1e2 0xe3e4e5e6e7e8e9ea 0xebecedeeeff1f2f3 0xf4f5f6f7f8f9fafb 0xfcfdfeff11121314 0x15161718191a1b1c 0x1d1e1f2122232425 0x262728292a2b2c2d 0x2e2f313233343536 0x3738393a3b3c3d3e 0x3f41424344454647 0x48494a4b4c4d4e4f 0x5152535455565758 0x595a5b5c5d5e5f61 .
+++
+++f 21.1,21.2 22.3,22.4 .
+++f 31.1,31.2,31.3 32.4,32.5,32.6 .
+++f 41.1,41.2,41.3,41.4 42.5,42.6,42.7,42.8 .
+++f 81.01,81.02,81.03,81.04,81.05,81.06,81.07,81.08 82.09,82.1,82.11,82.12,82.13,82.14,82.15,82.16 .
+++f 1.01,1.02,1.03,1.04,1.05,1.06,1.07,1.08,1.09,1.1,1.11,1.12,1.13,1.14,1.15,1.16 2.17,2.18,2.19,2.2,2.21,2.22,2.23,2.24,2.25,2.26,2.27,2.28,2.29,2.3,2.31,2.32 .
+++f 1.4 2.4 3.4 4.4 5.4 6.4 7.4 8.4 9.4 10.4 11.4 12.4 13.4 14.4 15.4 16.4 17.4 18.4 19.4 20.4 21.4 22.4 23.4 24.4 25.4 26.4 27.4 28.4 29.4 30.4 31.4 32.4 .
+++
+++d 21.1,21.2 22.3,22.4 .
+++d 31.1,31.2,31.3 32.4,32.5,32.6 .
+++d 41.1,41.2,41.3,41.4 42.5,42.6,42.7,42.8 .
+++d 81.01,81.02,81.03,81.04,81.05,81.06,81.07,81.08 82.09,82.1,82.11,82.12,82.13,82.14,82.15,82.16 .
+++d 1.01,1.02,1.03,1.04,1.05,1.06,1.07,1.08,1.09,1.1,1.11,1.12,1.13,1.14,1.15,1.16 2.17,2.18,2.19,2.2,2.21,2.22,2.23,2.24,2.25,2.26,2.27,2.28,2.29,2.3,2.31,2.32 .
+++d 1.8 2.8 3.8 4.8 5.8 6.8 7.8 8.8 9.8 10.8 11.8 12.8 13.8 14.8 15.8 16.8 17.8 18.8 19.8 20.8 21.8 22.8 23.8 24.8 25.8 26.8 27.8 28.8 29.8 30.8 31.8 32.8 .
+++
+++x 0x31323334 2.4 0x393a3b3c 4.4 0x42434445 6.4 0x4a4b4c4d 8.4 0x53545556 10.4 0x5b5c5d5e 12.4 0x64656667 14.4 0x6c6d6e6f 16.4 0x75767778 18.4 0x7d7e7f81 20.4 0x86878889 22.4 0x8e8f9192 24.4 0x9798999a 26.4 0x9fa1a2a3 28.4 0xa8a9aaab 30.4 0xb1b2b3b4 32.4 .
+++x 1.4 0x35363738 3.4 0x3d3e3f41 5.4 0x46474849 7.4 0x4e4f5152 9.4 0x5758595a 11.4 0x5f616263 13.4 0x68696a6b 15.4 0x71727374 17.4 0x797a7b7c 19.4 0x82838485 21.4 0x8a8b8c8d 23.4 0x93949596 25.4 0x9b9c9d9e 27.4 0xa4a5a6a7 29.4 0xacadaeaf 31.4 0xb5b6b7b8 .
++ OK
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9e148900bdab76ee073a923e9fd3eabea03644b0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,32 @@@
++From d0174ca066747a6fb7ad29bcf81b76244edcd16b Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 00:40:21 +0100
++Subject: [PATCH 61/90] test_printf_vectors fails on most platforms
++
++---
++ tests/kernel/CMakeLists.txt | 9 +++++++++
++ 1 file changed, 9 insertions(+)
++
++diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt
++index 831ad179..f587c780 100644
++--- a/tests/kernel/CMakeLists.txt
+++++ b/tests/kernel/CMakeLists.txt
++@@ -226,6 +226,15 @@ add_test_pocl(NAME "kernel/test_printf_vectors"
++               EXPECTED_OUTPUT "test_printf_vectors_expout.txt"
++               COMMAND "kernel" "test_printf_vectors")
++ 
+++# on most platforms, the printf tests for vector types expose bugs in the
+++# pocl printf implementation (passing of variadic arguments containing OpenCL
+++# vector types) and maybe also related bugs in llvm (issue #682, #1007)
+++if(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR
+++        CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x"))
+++  set_tests_properties("kernel/test_printf_vectors"
+++    PROPERTIES WILL_FAIL 1)
+++endif()
+++
++ add_test_pocl(NAME "kernel/test_sizeof_uint"
++               EXPECTED_OUTPUT "test_sizeof_expout.txt"
++               COMMAND "kernel" "test_sizeof")
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3587936c631cbe33866abb67249e3f7f1131c5ce
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,141 @@@
++From 6e49a1921da45689e6541c54cf66a6401cad90aa Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 2 Dec 2021 16:02:44 +0100
++Subject: [PATCH 62/90] add test test_ucharn.cl
++
++this is primarily intended for inspecting the disassembled kernel
++to debug parameter passing issues
++---
++ tests/kernel/CMakeLists.txt         |  4 ++
++ tests/kernel/test_ucharn.cl         | 84 +++++++++++++++++++++++++++++
++ tests/kernel/test_ucharn_expout.txt | 12 +++++
++ 3 files changed, 100 insertions(+)
++ create mode 100644 tests/kernel/test_ucharn.cl
++ create mode 100644 tests/kernel/test_ucharn_expout.txt
++
++diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt
++index f587c780..16894ed6 100644
++--- a/tests/kernel/CMakeLists.txt
+++++ b/tests/kernel/CMakeLists.txt
++@@ -218,6 +218,10 @@ add_test_pocl(NAME "kernel/test_shuffle_ulong"
++ 
++ ######################################################################
++ 
+++add_test_pocl(NAME "kernel/test_ucharn"
+++              EXPECTED_OUTPUT "test_ucharn_expout.txt"
+++              COMMAND "kernel" "test_ucharn")
+++
++ add_test_pocl(NAME "kernel/test_printf"
++               EXPECTED_OUTPUT "test_printf_expout.txt"
++               COMMAND "kernel" "test_printf")
++diff --git a/tests/kernel/test_ucharn.cl b/tests/kernel/test_ucharn.cl
++new file mode 100644
++index 00000000..c1a21732
++--- /dev/null
+++++ b/tests/kernel/test_ucharn.cl
++@@ -0,0 +1,84 @@
+++int f2(uchar2 uc2, int z) __attribute__((noinline));
+++int f2(uchar2 uc2, int z)
+++{
+++int s = uc2.x + uc2.y;
+++return s ^ z;
+++}
+++
+++int g2() __attribute__((noinline));
+++int g2()
+++{
+++uchar2 uc2 = (uchar2)(0x18, 0x29);
+++return f2(uc2, 0x12345678) ^ 0x12345678;
+++}
+++
+++int f3(uchar3 uc3, int z) __attribute__((noinline));
+++int f3(uchar3 uc3, int z)
+++{
+++int s = uc3.x + uc3.y + uc3.z;
+++return s ^ z;
+++}
+++
+++int g3() __attribute__((noinline));
+++int g3()
+++{
+++uchar3 uc3 = (uchar3)(0x18, 0x29, 0x3a);
+++return f3(uc3, 0x12345678) ^ 0x12345678;
+++}
+++
+++int f4(uchar4 uc4, int z) __attribute__((noinline));
+++int f4(uchar4 uc4, int z)
+++{
+++int s = uc4.x + uc4.y + uc4.z + uc4.w;
+++return s ^ z;
+++}
+++
+++int g4() __attribute__((noinline));
+++int g4()
+++{
+++uchar4 uc4 = (uchar4)(0x18, 0x29, 0x3a, 0x4b);
+++return f4(uc4, 0x12345678) ^ 0x12345678;
+++}
+++
+++int f8(uchar8 uc8, int z) __attribute__((noinline));
+++int f8(uchar8 uc8, int z)
+++{
+++int s = uc8.s0 + uc8.s1 + uc8.s2 + uc8.s3 + uc8.s4 + uc8.s5 + uc8.s6 + uc8.s7;
+++return s ^ z;
+++}
+++
+++int g8() __attribute__((noinline));
+++int g8()
+++{
+++uchar8 uc8 = (uchar8)(0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x8f);
+++return f8(uc8, 0x12345678) ^ 0x12345678;
+++}
+++
+++int f16(uchar16 uc16, int z) __attribute__((noinline));
+++int f16(uchar16 uc16, int z)
+++{
+++int s = uc16.s0 + uc16.s1 + uc16.s2 + uc16.s3 + uc16.s4 + uc16.s5 + uc16.s6 + uc16.s7 + uc16.s8 + uc16.s9 + uc16.sa + uc16.sb + uc16.sc + uc16.sd + uc16.se + uc16.sf;
+++return s ^ z;
+++}
+++
+++int g16() __attribute__((noinline));
+++int g16()
+++{
+++uchar16 uc16 = (uchar16)(0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x8f, 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0xf6, 0x17, 0x28);
+++return f16(uc16, 0x12345678) ^ 0x12345678;
+++}
+++
+++kernel void test_ucharn()
+++{
+++  printf("uchar2  %8x\n", f2((uchar2)(0), 0));
+++  printf("uchar3  %8x\n", f3((uchar3)(0), 0));
+++  printf("uchar4  %8x\n", f4((uchar4)(0), 0));
+++  printf("uchar8  %8x\n", f8((uchar8)(0), 0));
+++  printf("uchar16 %8x\n", f16((uchar16)(0), 0));
+++
+++  printf("uchar2  %8x\n", g2());
+++  printf("uchar3  %8x\n", g3());
+++  printf("uchar4  %8x\n", g4());
+++  printf("uchar8  %8x\n", g8());
+++  printf("uchar16 %8x\n", g16());
+++}
++diff --git a/tests/kernel/test_ucharn_expout.txt b/tests/kernel/test_ucharn_expout.txt
++new file mode 100644
++index 00000000..15152ffa
++--- /dev/null
+++++ b/tests/kernel/test_ucharn_expout.txt
++@@ -0,0 +1,12 @@
+++Running test test_ucharn...
+++uchar2         0
+++uchar3         0
+++uchar4         0
+++uchar8         0
+++uchar16        0
+++uchar2        41
+++uchar3        7b
+++uchar4        c6
+++uchar8       29c
+++uchar16      7a0
+++OK
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..39bf8f0a72dc355f9ef32a22135d0f6cff7845b0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++From 3ca77614402b4bfc03167232d9d80d998be4079c Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 22:50:25 +0100
++Subject: [PATCH 63/90] hsa: add PTHREAD_CHECK() to the remaining pthread_*()
++ calls
++
++---
++ lib/CL/devices/hsa/pocl-hsa.c | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/lib/CL/devices/hsa/pocl-hsa.c b/lib/CL/devices/hsa/pocl-hsa.c
++index de3d7854..45722587 100644
++--- a/lib/CL/devices/hsa/pocl-hsa.c
+++++ b/lib/CL/devices/hsa/pocl-hsa.c
++@@ -2035,7 +2035,7 @@ void
++ pocl_hsa_notify_event_finished (cl_event event)
++ {
++   pocl_hsa_event_data_t *e_d = (pocl_hsa_event_data_t *)event->data;
++-  pthread_cond_broadcast (&e_d->event_cond);
+++  PTHREAD_CHECK (pthread_cond_broadcast (&e_d->event_cond));
++ }
++ 
++ void
++@@ -2048,7 +2048,7 @@ pocl_hsa_update_event (cl_device_id device, cl_event event)
++       pocl_hsa_event_data_t *e_d
++           = (pocl_hsa_event_data_t *)malloc (sizeof (pocl_hsa_event_data_t));
++       assert (e_d);
++-      pthread_cond_init (&e_d->event_cond, NULL);
+++      PTHREAD_CHECK (pthread_cond_init (&e_d->event_cond, NULL));
++       event->data = (void *)e_d;
++     }
++   else
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d28f7086bddbcb8f919985a3d102c746e96a71c7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,166 @@@
++From 993a61853e4c5ebff5436fd88a8973d1c65d54a3 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 23:16:14 +0100
++Subject: [PATCH 64/90] cuda: add PTHREAD_CHECK() to all pthread_*() calls
++
++---
++ lib/CL/devices/cuda/pocl-cuda.c | 57 +++++++++++++++++----------------
++ 1 file changed, 30 insertions(+), 27 deletions(-)
++
++diff --git a/lib/CL/devices/cuda/pocl-cuda.c b/lib/CL/devices/cuda/pocl-cuda.c
++index af423655..4a4807dd 100644
++--- a/lib/CL/devices/cuda/pocl-cuda.c
+++++ b/lib/CL/devices/cuda/pocl-cuda.c
++@@ -438,9 +438,9 @@ pocl_cuda_init_queue (cl_device_id device, cl_command_queue queue)
++ 
++   if (queue_data->use_threads)
++     {
++-      pthread_mutex_init (&queue_data->lock, NULL);
++-      pthread_cond_init (&queue_data->pending_cond, NULL);
++-      pthread_cond_init (&queue_data->running_cond, NULL);
+++      PTHREAD_CHECK (pthread_mutex_init (&queue_data->lock, NULL));
+++      PTHREAD_CHECK (pthread_cond_init (&queue_data->pending_cond, NULL));
+++      PTHREAD_CHECK (pthread_cond_init (&queue_data->running_cond, NULL));
++       int err = pthread_create (&queue_data->submit_thread, NULL,
++                                 pocl_cuda_submit_thread, queue_data);
++       if (err)
++@@ -475,13 +475,13 @@ pocl_cuda_free_queue (cl_device_id device, cl_command_queue queue)
++   /* Kill queue threads */
++   if (queue_data->use_threads)
++     {
++-      pthread_mutex_lock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_lock (&queue_data->lock));
++       queue_data->queue = NULL;
++-      pthread_cond_signal (&queue_data->pending_cond);
++-      pthread_cond_signal (&queue_data->running_cond);
++-      pthread_mutex_unlock (&queue_data->lock);
++-      pthread_join (queue_data->submit_thread, NULL);
++-      pthread_join (queue_data->finalize_thread, NULL);
+++      PTHREAD_CHECK (pthread_cond_signal (&queue_data->pending_cond));
+++      PTHREAD_CHECK (pthread_cond_signal (&queue_data->running_cond));
+++      PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
+++      PTHREAD_CHECK (pthread_join (queue_data->submit_thread, NULL));
+++      PTHREAD_CHECK (pthread_join (queue_data->finalize_thread, NULL));
++     }
++   return CL_SUCCESS;
++ }
++@@ -1413,14 +1413,14 @@ pocl_cuda_submit (_cl_command_node *node, cl_command_queue cq)
++   if (((pocl_cuda_queue_data_t *)cq->data)->use_threads)
++     {
++ 
++-      pthread_cond_init (&p->event_cond, NULL);
+++      PTHREAD_CHECK (pthread_cond_init (&p->event_cond, NULL));
++       /* Add command to work queue */
++       POCL_UNLOCK_OBJ (node->event);
++       pocl_cuda_queue_data_t *queue_data = (pocl_cuda_queue_data_t *)cq->data;
++-      pthread_mutex_lock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_lock (&queue_data->lock));
++       DL_APPEND (queue_data->pending_queue, node);
++-      pthread_cond_signal (&queue_data->pending_cond);
++-      pthread_mutex_unlock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_cond_signal (&queue_data->pending_cond));
+++      PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++     }
++   else
++     {
++@@ -1568,7 +1568,7 @@ pocl_cuda_notify_event_finished (cl_event event)
++   pocl_cuda_event_data_t *e_d = (pocl_cuda_event_data_t *)event->data;
++ 
++   if (((pocl_cuda_queue_data_t *)event->queue->data)->use_threads)
++-    pthread_cond_broadcast (&e_d->event_cond);
+++    PTHREAD_CHECK (pthread_cond_broadcast (&e_d->event_cond));
++ }
++ 
++ void
++@@ -1582,7 +1582,8 @@ pocl_cuda_wait_event (cl_device_id device, cl_event event)
++       POCL_LOCK_OBJ (event);
++       while (event->status > CL_COMPLETE)
++         {
++-          pthread_cond_wait (&e_d->event_cond, &event->pocl_lock);
+++          PTHREAD_CHECK (
+++              pthread_cond_wait (&e_d->event_cond, &event->pocl_lock));
++         }
++       POCL_UNLOCK_OBJ (event);
++     }
++@@ -1600,7 +1601,7 @@ pocl_cuda_free_event_data (cl_event event)
++     {
++       pocl_cuda_event_data_t *event_data
++           = (pocl_cuda_event_data_t *)event->data;
++-      pthread_cond_destroy (&event_data->event_cond);
+++      PTHREAD_CHECK (pthread_cond_destroy (&event_data->event_cond));
++       if (event->queue->properties & CL_QUEUE_PROFILING_ENABLE)
++         cuEventDestroy (event_data->start);
++       cuEventDestroy (event_data->end);
++@@ -1649,22 +1650,23 @@ pocl_cuda_submit_thread (void *data)
++     {
++       /* Attempt to get next command from work queue */
++       _cl_command_node *node = NULL;
++-      pthread_mutex_lock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_lock (&queue_data->lock));
++       if (!queue_data->queue)
++         {
++-          pthread_mutex_unlock (&queue_data->lock);
+++          PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++           break;
++         }
++       if (!queue_data->pending_queue)
++         {
++-          pthread_cond_wait (&queue_data->pending_cond, &queue_data->lock);
+++          PTHREAD_CHECK (pthread_cond_wait (&queue_data->pending_cond,
+++                                            &queue_data->lock));
++         }
++       if (queue_data->pending_queue)
++         {
++           node = queue_data->pending_queue;
++           DL_DELETE (queue_data->pending_queue, node);
++         }
++-      pthread_mutex_unlock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++ 
++       /* Submit command, if we found one */
++       if (node)
++@@ -1672,10 +1674,10 @@ pocl_cuda_submit_thread (void *data)
++           pocl_cuda_submit_node (node, queue_data->queue, 0);
++ 
++           /* Add command to running queue */
++-          pthread_mutex_lock (&queue_data->lock);
+++          PTHREAD_CHECK (pthread_mutex_lock (&queue_data->lock));
++           DL_APPEND (queue_data->running_queue, node);
++-          pthread_cond_signal (&queue_data->running_cond);
++-          pthread_mutex_unlock (&queue_data->lock);
+++          PTHREAD_CHECK (pthread_cond_signal (&queue_data->running_cond));
+++          PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++         }
++     }
++ 
++@@ -1699,22 +1701,23 @@ pocl_cuda_finalize_thread (void *data)
++     {
++       /* Attempt to get next node from running queue */
++       _cl_command_node *node = NULL;
++-      pthread_mutex_lock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_lock (&queue_data->lock));
++       if (!queue_data->queue)
++         {
++-          pthread_mutex_unlock (&queue_data->lock);
+++          PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++           break;
++         }
++       if (!queue_data->running_queue)
++         {
++-          pthread_cond_wait (&queue_data->running_cond, &queue_data->lock);
+++          PTHREAD_CHECK (pthread_cond_wait (&queue_data->running_cond,
+++                                            &queue_data->lock));
++         }
++       if (queue_data->running_queue)
++         {
++           node = queue_data->running_queue;
++           DL_DELETE (queue_data->running_queue, node);
++         }
++-      pthread_mutex_unlock (&queue_data->lock);
+++      PTHREAD_CHECK (pthread_mutex_unlock (&queue_data->lock));
++ 
++       /* Wait for command to finish, if we found one */
++       if (node)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4d7511b731797b36ba9583f3fe4f4e12e522ff60
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,198 @@@
++From cb7c52ac03e7ba79730acbf782ea99f14631de00 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 23:39:45 +0100
++Subject: [PATCH 66/90] pthread: add PTHREAD_CHECK() to all pthread_*() calls
++
++---
++ lib/CL/devices/pthread/pthread.c           | 18 +++++++---------
++ lib/CL/devices/pthread/pthread_scheduler.c | 24 ++++++++++++----------
++ lib/CL/devices/pthread/pthread_utils.c     |  6 +++---
++ 3 files changed, 23 insertions(+), 25 deletions(-)
++
++diff --git a/lib/CL/devices/pthread/pthread.c b/lib/CL/devices/pthread/pthread.c
++index 9febfb26..444d7dc9 100644
++--- a/lib/CL/devices/pthread/pthread.c
+++++ b/lib/CL/devices/pthread/pthread.c
++@@ -294,8 +294,7 @@ pocl_pthread_join(cl_device_id device, cl_command_queue cq)
++         }
++       else
++         {
++-          int r = pthread_cond_wait (cq_cond, &cq->pocl_lock);
++-          assert (r == 0);
+++          PTHREAD_CHECK (pthread_cond_wait (cq_cond, &cq->pocl_lock));
++         }
++     }
++   return;
++@@ -335,15 +334,14 @@ pocl_pthread_notify_cmdq_finished (cl_command_queue cq)
++    * user threads waiting on the same command queue
++    * in pthread_scheduler_wait_cq(). */
++   pthread_cond_t *cq_cond = (pthread_cond_t *)cq->data;
++-  int r = pthread_cond_broadcast (cq_cond);
++-  assert (r == 0);
+++  PTHREAD_CHECK (pthread_cond_broadcast (cq_cond));
++ }
++ 
++ void
++ pocl_pthread_notify_event_finished (cl_event event)
++ {
++   struct event_data *e_d = event->data;
++-  pthread_cond_broadcast (&e_d->event_cond);
+++  PTHREAD_CHECK (pthread_cond_broadcast (&e_d->event_cond));
++ }
++ 
++ void
++@@ -355,7 +353,7 @@ pocl_pthread_update_event (cl_device_id device, cl_event event)
++       e_d = malloc(sizeof(struct event_data));
++       assert(e_d);
++ 
++-      pthread_cond_init(&e_d->event_cond, NULL);
+++      PTHREAD_CHECK (pthread_cond_init (&e_d->event_cond, NULL));
++       event->data = (void *) e_d;
++     }
++ }
++@@ -367,7 +365,7 @@ void pocl_pthread_wait_event (cl_device_id device, cl_event event)
++   POCL_LOCK_OBJ (event);
++   while (event->status > CL_COMPLETE)
++     {
++-      pthread_cond_wait(&e_d->event_cond, &event->pocl_lock);
+++      PTHREAD_CHECK (pthread_cond_wait (&e_d->event_cond, &event->pocl_lock));
++     }
++   POCL_UNLOCK_OBJ (event);
++ }
++@@ -386,8 +384,7 @@ pocl_pthread_init_queue (cl_device_id device, cl_command_queue queue)
++   queue->data
++       = pocl_aligned_malloc (HOST_CPU_CACHELINE_SIZE, sizeof (pthread_cond_t));
++   pthread_cond_t *cond = (pthread_cond_t *)queue->data;
++-  int r = pthread_cond_init (cond, NULL);
++-  assert (r == 0);
+++  PTHREAD_CHECK (pthread_cond_init (cond, NULL));
++   return CL_SUCCESS;
++ }
++ 
++@@ -395,8 +392,7 @@ int
++ pocl_pthread_free_queue (cl_device_id device, cl_command_queue queue)
++ {
++   pthread_cond_t *cond = (pthread_cond_t *)queue->data;
++-  int r = pthread_cond_destroy (cond);
++-  assert (r == 0);
+++  PTHREAD_CHECK (pthread_cond_destroy (cond));
++   POCL_MEM_FREE (queue->data);
++   return CL_SUCCESS;
++ }
++diff --git a/lib/CL/devices/pthread/pthread_scheduler.c b/lib/CL/devices/pthread/pthread_scheduler.c
++index 892fa6c3..d3ebb2c2 100644
++--- a/lib/CL/devices/pthread/pthread_scheduler.c
+++++ b/lib/CL/devices/pthread/pthread_scheduler.c
++@@ -88,7 +88,7 @@ pthread_scheduler_init (cl_device_id device)
++   size_t num_worker_threads = device->max_compute_units;
++   POCL_FAST_INIT (scheduler.wq_lock_fast);
++ 
++-  pthread_cond_init (&(scheduler.wake_pool), NULL);
+++  PTHREAD_CHECK (pthread_cond_init (&(scheduler.wake_pool), NULL));
++ 
++   scheduler.thread_pool = pocl_aligned_malloc (
++       HOST_CPU_CACHELINE_SIZE,
++@@ -109,9 +109,9 @@ pthread_scheduler_init (cl_device_id device)
++   for (i = 0; i < num_worker_threads; ++i)
++     {
++       scheduler.thread_pool[i].index = i;
++-      pthread_create (&scheduler.thread_pool[i].thread, NULL,
++-                      pocl_pthread_driver_thread,
++-                      (void*)&scheduler.thread_pool[i]);
+++      PTHREAD_CHECK (pthread_create (&scheduler.thread_pool[i].thread, NULL,
+++                                     pocl_pthread_driver_thread,
+++                                     (void *)&scheduler.thread_pool[i]));
++     }
++ 
++ }
++@@ -123,17 +123,17 @@ pthread_scheduler_uninit ()
++ 
++   POCL_FAST_LOCK (scheduler.wq_lock_fast);
++   scheduler.thread_pool_shutdown_requested = 1;
++-  pthread_cond_broadcast (&scheduler.wake_pool);
+++  PTHREAD_CHECK (pthread_cond_broadcast (&scheduler.wake_pool));
++   POCL_FAST_UNLOCK (scheduler.wq_lock_fast);
++ 
++   for (i = 0; i < scheduler.num_threads; ++i)
++     {
++-      pthread_join (scheduler.thread_pool[i].thread, NULL);
+++      PTHREAD_CHECK (pthread_join (scheduler.thread_pool[i].thread, NULL));
++     }
++ 
++   pocl_aligned_free (scheduler.thread_pool);
++   POCL_FAST_DESTROY (scheduler.wq_lock_fast);
++-  pthread_cond_destroy (&scheduler.wake_pool);
+++  PTHREAD_CHECK (pthread_cond_destroy (&scheduler.wake_pool));
++ 
++   scheduler.thread_pool_shutdown_requested = 0;
++ }
++@@ -144,7 +144,7 @@ void pthread_scheduler_push_command (_cl_command_node *cmd)
++ {
++   POCL_FAST_LOCK (scheduler.wq_lock_fast);
++   DL_APPEND (scheduler.work_queue, cmd);
++-  pthread_cond_broadcast (&scheduler.wake_pool);
+++  PTHREAD_CHECK (pthread_cond_broadcast (&scheduler.wake_pool));
++   POCL_FAST_UNLOCK (scheduler.wq_lock_fast);
++ }
++ 
++@@ -153,7 +153,7 @@ pthread_scheduler_push_kernel (kernel_run_command *run_cmd)
++ {
++   POCL_FAST_LOCK (scheduler.wq_lock_fast);
++   DL_APPEND (scheduler.kernel_queue, run_cmd);
++-  pthread_cond_broadcast (&scheduler.wake_pool);
+++  PTHREAD_CHECK (pthread_cond_broadcast (&scheduler.wake_pool));
++   POCL_FAST_UNLOCK (scheduler.wq_lock_fast);
++ }
++ 
++@@ -483,7 +483,8 @@ RETRY:
++   /* if neither a command nor a kernel was available, sleep */
++   if ((cmd == NULL) && (run_cmd == NULL) && (do_exit == 0))
++     {
++-      pthread_cond_wait (&scheduler.wake_pool, &scheduler.wq_lock_fast);
+++      PTHREAD_CHECK (
+++          pthread_cond_wait (&scheduler.wake_pool, &scheduler.wq_lock_fast));
++       goto RETRY;
++     }
++ 
++@@ -518,7 +519,8 @@ pocl_pthread_driver_thread (void *p)
++       cpu_set_t set;
++       CPU_ZERO (&set);
++       CPU_SET (td->index, &set);
++-      pthread_setaffinity_np (td->thread, sizeof (cpu_set_t), &set);
+++      PTHREAD_CHECK (
+++          pthread_setaffinity_np (td->thread, sizeof (cpu_set_t), &set));
++     }
++ #endif
++ 
++diff --git a/lib/CL/devices/pthread/pthread_utils.c b/lib/CL/devices/pthread/pthread_utils.c
++index a0894eb9..9ff24603 100644
++--- a/lib/CL/devices/pthread/pthread_utils.c
+++++ b/lib/CL/devices/pthread/pthread_utils.c
++@@ -62,21 +62,21 @@ kernel_run_command* new_kernel_run_command ()
++     {
++       LL_DELETE (kernel_pool, k);
++       memset (k, 0, sizeof(kernel_run_command));
++-      pthread_mutex_init(&k->lock, NULL);
+++      PTHREAD_CHECK (pthread_mutex_init (&k->lock, NULL));
++       POCL_UNLOCK (kernel_pool_lock);
++       return k;
++     }
++ 
++   POCL_UNLOCK (kernel_pool_lock);
++   k = (kernel_run_command*)calloc (1, sizeof (kernel_run_command));
++-  pthread_mutex_init (&k->lock, NULL);
+++  PTHREAD_CHECK (pthread_mutex_init (&k->lock, NULL));
++   return k;
++ }
++ 
++ void free_kernel_run_command (kernel_run_command *k)
++ {
++   POCL_LOCK (kernel_pool_lock);
++-  pthread_mutex_destroy (&k->lock);
+++  PTHREAD_CHECK (pthread_mutex_destroy (&k->lock));
++   LL_PREPEND (kernel_pool, k);
++   POCL_UNLOCK (kernel_pool_lock);
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0319b4298bd72dcfe441c6276f0547786ffdb72e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,54 @@@
++From 5090010cef03fa910ddafd6876448c3e86a74487 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 2 Dec 2021 01:53:31 +0100
++Subject: [PATCH 68/90] move PTHREAD_CHECK() to pocl_cl.h
++
++---
++ lib/CL/pocl_cl.h   | 14 ++++++++++++++
++ lib/CL/pocl_util.h |  5 -----
++ 2 files changed, 14 insertions(+), 5 deletions(-)
++
++diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
++index 5ff7408d..bb0c0e18 100644
++--- a/lib/CL/pocl_cl.h
+++++ b/lib/CL/pocl_cl.h
++@@ -107,6 +107,20 @@ typedef pthread_t pocl_thread_t;
++ #define ALIGN_CACHE(x) x
++ #endif
++ 
+++#ifdef __cplusplus
+++extern "C" {
+++#endif
+++
+++POCL_EXPORT
+++void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
+++
+++#ifdef __cplusplus
+++}
+++#endif
+++
+++#define PTHREAD_CHECK(code)                                                   \
+++  pocl_abort_on_pthread_error ((code), __LINE__, __FUNCTION__);
+++
++ /* Generic functionality for handling different types of 
++    OpenCL (host) objects. */
++ 
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index 0c1125c4..22022874 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -184,11 +184,6 @@ int pocl_check_event_wait_list(cl_command_queue     command_queue,
++                                cl_uint              num_events_in_wait_list,
++                                const cl_event *     event_wait_list);
++ 
++-void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
++-
++-#define PTHREAD_CHECK(code)                                                   \
++-  pocl_abort_on_pthread_error ((code), __LINE__, __FUNCTION__);
++-
++ void pocl_update_event_queued (cl_event event);
++ 
++ POCL_EXPORT
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..60a497e1085584da52b70be5982a4952468fc048
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,45 @@@
++From 0edbfbbc544b5b9a5ac874b726372354cc738adb Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 16:14:53 +0100
++Subject: [PATCH 69/90] add PTHREAD_CHECK2() accepting an additional non-zero
++ return code
++
++use e.g. for
++* pthread_broadcast(): PTHREAD_BARRIER_SERIAL_THREAD
++* pthread_cond_timedwait(): ETIMEDOUT
++
++avoid the extra function call to the error handler if the command succeeded
++---
++ lib/CL/pocl_cl.h | 16 ++++++++++++++--
++ 1 file changed, 14 insertions(+), 2 deletions(-)
++
++diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
++index bb0c0e18..c623d02c 100644
++--- a/lib/CL/pocl_cl.h
+++++ b/lib/CL/pocl_cl.h
++@@ -118,8 +118,20 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
++ }
++ #endif
++ 
++-#define PTHREAD_CHECK(code)                                                   \
++-  pocl_abort_on_pthread_error ((code), __LINE__, __FUNCTION__);
+++/* Some pthread_*() calls may return '0' or a specific non-zero value on
+++ * success.
+++ */
+++#define PTHREAD_CHECK2(_status_ok, _code)                                     \
+++  do                                                                          \
+++    {                                                                         \
+++      int _pthread_status = (_code);                                          \
+++      if (_pthread_status != 0 && _pthread_status != (_status_ok))            \
+++        pocl_abort_on_pthread_error (_pthread_status, __LINE__,               \
+++                                     __FUNCTION__);                           \
+++    }                                                                         \
+++  while (0)
+++
+++#define PTHREAD_CHECK(code) PTHREAD_CHECK2 (0, code)
++ 
++ /* Generic functionality for handling different types of 
++    OpenCL (host) objects. */
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..bac6b23c03f8d30c186543ab26ed988469f41a32
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,111 @@@
++From 11566d9a576724443ebbc3f81cb8983e70fa99af Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 2 Dec 2021 02:34:09 +0100
++Subject: [PATCH 71/90] add PTHREAD_CHECK() to all macros wrapping pthread_*()
++ calls
++
++---
++ lib/CL/pocl_cl.h | 60 ++++++++++++++++--------------------------------
++ 1 file changed, 20 insertions(+), 40 deletions(-)
++
++diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
++index c623d02c..fdd58f27 100644
++--- a/lib/CL/pocl_cl.h
+++++ b/lib/CL/pocl_cl.h
++@@ -28,6 +28,7 @@
++ #include "config.h"
++ 
++ #include <assert.h>
+++#include <errno.h>
++ #include <stdio.h>
++ 
++ #ifdef HAVE_VALGRIND
++@@ -136,37 +137,15 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
++ /* Generic functionality for handling different types of 
++    OpenCL (host) objects. */
++ 
++-#define POCL_LOCK(__LOCK__)                                                   \
++-  do                                                                          \
++-    {                                                                         \
++-      int r = pthread_mutex_lock (&(__LOCK__));                               \
++-      assert (r == 0);                                                        \
++-    }                                                                         \
++-  while (0)
+++#define POCL_LOCK(__LOCK__) PTHREAD_CHECK (pthread_mutex_lock (&(__LOCK__)))
++ #define POCL_UNLOCK(__LOCK__)                                                 \
++-  do                                                                          \
++-    {                                                                         \
++-      int r = pthread_mutex_unlock (&(__LOCK__));                             \
++-      assert (r == 0);                                                        \
++-    }                                                                         \
++-  while (0)
+++  PTHREAD_CHECK (pthread_mutex_unlock (&(__LOCK__)))
++ #define POCL_INIT_LOCK(__LOCK__)                                              \
++-  do                                                                          \
++-    {                                                                         \
++-      int r = pthread_mutex_init (&(__LOCK__), NULL);                         \
++-      assert (r == 0);                                                        \
++-    }                                                                         \
++-  while (0)
+++  PTHREAD_CHECK (pthread_mutex_init (&(__LOCK__), NULL))
++ /* We recycle OpenCL objects by not actually freeing them until the
++-   very end. Thus, the lock should not be destoryed at the refcount 0. */
+++   very end. Thus, the lock should not be destroyed at the refcount 0. */
++ #define POCL_DESTROY_LOCK(__LOCK__)                                           \
++-  do                                                                          \
++-    {                                                                         \
++-      int r = pthread_mutex_destroy (&(__LOCK__));                            \
++-      assert (r == 0);                                                        \
++-    }                                                                         \
++-  while (0)
++-
+++  PTHREAD_CHECK (pthread_mutex_destroy (&(__LOCK__)))
++ 
++ /* If available, use an Adaptive mutex for locking in the pthread driver,
++    otherwise fallback to simple mutexes */
++@@ -179,10 +158,10 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
++     do { \
++       pthread_mutexattr_t attrs; \
++       pthread_mutexattr_init (&attrs); \
++-      int r = pthread_mutexattr_settype (&attrs, PTHREAD_MUTEX_ADAPTIVE_NP); \
++-      assert (r == 0); \
++-      pthread_mutex_init(&l, &attrs); \
++-      pthread_mutexattr_destroy(&attrs);\
+++      PTHREAD_CHECK (                                                         \
+++          pthread_mutexattr_settype (&attrs, PTHREAD_MUTEX_ADAPTIVE_NP));     \
+++      PTHREAD_CHECK (pthread_mutex_init (&l, &attrs));                        \
+++      PTHREAD_CHECK (pthread_mutexattr_destroy (&attrs));                     \
++     } while (0)
++ #else
++ #define POCL_FAST_INIT(l) POCL_INIT_LOCK (l)
++@@ -190,17 +169,18 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
++ 
++ #define POCL_FAST_DESTROY(l) POCL_DESTROY_LOCK(l)
++ 
++-#define POCL_INIT_COND(c) pthread_cond_init (&c, NULL)
++-#define POCL_DESTROY_COND(c) pthread_cond_destroy (&c)
++-#define POCL_SIGNAL_COND(c) pthread_cond_signal (&c)
++-#define POCL_BROADCAST_COND(c) pthread_cond_broadcast (&c)
++-#define POCL_WAIT_COND(c, m) pthread_cond_wait (&c, &m)
++-#define POCL_TIMEDWAIT_COND(c, m, t) pthread_cond_timedwait (&c, &m, &t)
+++#define POCL_INIT_COND(c) PTHREAD_CHECK (pthread_cond_init (&c, NULL))
+++#define POCL_DESTROY_COND(c) PTHREAD_CHECK (pthread_cond_destroy (&c))
+++#define POCL_SIGNAL_COND(c) PTHREAD_CHECK (pthread_cond_signal (&c))
+++#define POCL_BROADCAST_COND(c) PTHREAD_CHECK (pthread_cond_broadcast (&c))
+++#define POCL_WAIT_COND(c, m) PTHREAD_CHECK (pthread_cond_wait (&c, &m))
+++#define POCL_TIMEDWAIT_COND(c, m, t) PTHREAD_CHECK2(ETIMEDOUT, pthread_cond_timedwait (&c, &m, &t))
++ 
++ #define POCL_CREATE_THREAD(thr, func, arg)                                    \
++-  pthread_create (&thr, NULL, func, arg)
++-#define POCL_JOIN_THREAD(thr) pthread_join (thr, NULL)
++-#define POCL_JOIN_THREAD2(thr, res_ptr) pthread_join (thr, res_ptr)
+++  PTHREAD_CHECK (pthread_create (&thr, NULL, func, arg))
+++#define POCL_JOIN_THREAD(thr) PTHREAD_CHECK (pthread_join (thr, NULL))
+++#define POCL_JOIN_THREAD2(thr, res_ptr)                                       \
+++  PTHREAD_CHECK (pthread_join (thr, res_ptr))
++ #define POCL_EXIT_THREAD(res) pthread_exit (res)
++ 
++ //############################################################################
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b7a61c2fd74a7c603555c17812edda92d1e4dd84
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,96 @@@
++From 7def8bbe7b04e5d93dd1be7a47ea59145dcfa916 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 26 Nov 2021 14:02:56 +0100
++Subject: [PATCH 72/90] pthread: add return code to pthread_scheduler_init()
++
++---
++ .../devices/pthread/pocl-pthread_scheduler.h  |  2 +-
++ lib/CL/devices/pthread/pthread.c              | 21 +++++++++++++------
++ lib/CL/devices/pthread/pthread_scheduler.c    |  3 ++-
++ 3 files changed, 18 insertions(+), 8 deletions(-)
++
++diff --git a/lib/CL/devices/pthread/pocl-pthread_scheduler.h b/lib/CL/devices/pthread/pocl-pthread_scheduler.h
++index e96980be..d56709d7 100644
++--- a/lib/CL/devices/pthread/pocl-pthread_scheduler.h
+++++ b/lib/CL/devices/pthread/pocl-pthread_scheduler.h
++@@ -36,7 +36,7 @@
++ typedef struct pool_thread_data thread_data;
++ 
++ /* Initializes scheduler. Must be called before any kernel enqueue */
++-void pthread_scheduler_init (cl_device_id device);
+++cl_int pthread_scheduler_init (cl_device_id device);
++ 
++ void pthread_scheduler_uninit ();
++ 
++diff --git a/lib/CL/devices/pthread/pthread.c b/lib/CL/devices/pthread/pthread.c
++index 444d7dc9..e66d76e0 100644
++--- a/lib/CL/devices/pthread/pthread.c
+++++ b/lib/CL/devices/pthread/pthread.c
++@@ -208,14 +208,19 @@ pocl_pthread_init (unsigned j, cl_device_id device, const char* parameters)
++   device->num_partition_types = 0;
++   device->partition_type = NULL;
++ 
+++  cl_int ret = CL_SUCCESS;
++   if (!scheduler_initialized)
++     {
++-      scheduler_initialized = 1;
++       pocl_init_dlhandle_cache();
++       pocl_init_kernel_run_command_manager();
++-      pthread_scheduler_init (device);
+++      ret = pthread_scheduler_init (device);
+++      if (ret == CL_SUCCESS)
+++        {
+++          scheduler_initialized = 1;
+++        }
++     }
++-  return CL_SUCCESS;
+++
+++  return ret;
++ }
++ 
++ cl_int
++@@ -246,13 +251,17 @@ pocl_pthread_reinit (unsigned j, cl_device_id device)
++   d->current_kernel = NULL;
++   device->data = d;
++ 
+++  cl_int ret = CL_SUCCESS;
++   if (!scheduler_initialized)
++     {
++-      pthread_scheduler_init (device);
++-      scheduler_initialized = 1;
+++      ret = pthread_scheduler_init (device);
+++      if (ret == CL_SUCCESS)
+++        {
+++          scheduler_initialized = 1;
+++        }
++     }
++ 
++-  return CL_SUCCESS;
+++  return ret;
++ }
++ 
++ void
++diff --git a/lib/CL/devices/pthread/pthread_scheduler.c b/lib/CL/devices/pthread/pthread_scheduler.c
++index d3ebb2c2..82683ece 100644
++--- a/lib/CL/devices/pthread/pthread_scheduler.c
+++++ b/lib/CL/devices/pthread/pthread_scheduler.c
++@@ -81,7 +81,7 @@ typedef struct scheduler_data_
++ 
++ static scheduler_data scheduler;
++ 
++-void
+++cl_int
++ pthread_scheduler_init (cl_device_id device)
++ {
++   unsigned i;
++@@ -114,6 +114,7 @@ pthread_scheduler_init (cl_device_id device)
++                                      (void *)&scheduler.thread_pool[i]));
++     }
++ 
+++  return CL_SUCCESS;
++ }
++ 
++ void
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a471e572c88f3d3382716a2f7cd4c6fa921ae0ec
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,64 @@@
++From 211c68cd0ea55eb52528483ad9853d0db13e2f2b Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 26 Nov 2021 14:11:30 +0100
++Subject: [PATCH 73/90] pthread: add barrier after worker thread initialization
++
++---
++ lib/CL/devices/pthread/pthread_scheduler.c | 13 +++++++++++++
++ 1 file changed, 13 insertions(+)
++
++diff --git a/lib/CL/devices/pthread/pthread_scheduler.c b/lib/CL/devices/pthread/pthread_scheduler.c
++index 82683ece..63f191c7 100644
++--- a/lib/CL/devices/pthread/pthread_scheduler.c
+++++ b/lib/CL/devices/pthread/pthread_scheduler.c
++@@ -77,6 +77,9 @@ typedef struct scheduler_data_
++   POCL_FAST_LOCK_T wq_lock_fast __attribute__ ((aligned (HOST_CPU_CACHELINE_SIZE)));
++ 
++   int thread_pool_shutdown_requested;
+++
+++  pthread_barrier_t init_barrier
+++      __attribute__ ((aligned (HOST_CPU_CACHELINE_SIZE)));
++ } scheduler_data __attribute__ ((aligned (HOST_CPU_CACHELINE_SIZE)));
++ 
++ static scheduler_data scheduler;
++@@ -106,6 +109,9 @@ pthread_scheduler_init (cl_device_id device)
++    * TODO fix this */
++   scheduler.local_mem_size = device->local_mem_size + device->max_parameter_size * MAX_EXTENDED_ALIGNMENT;
++ 
+++  PTHREAD_CHECK (pthread_barrier_init (&scheduler.init_barrier, NULL,
+++                                       num_worker_threads + 1));
+++
++   for (i = 0; i < num_worker_threads; ++i)
++     {
++       scheduler.thread_pool[i].index = i;
++@@ -114,6 +120,9 @@ pthread_scheduler_init (cl_device_id device)
++                                      (void *)&scheduler.thread_pool[i]));
++     }
++ 
+++  PTHREAD_CHECK2 (PTHREAD_BARRIER_SERIAL_THREAD,
+++                  pthread_barrier_wait (&scheduler.init_barrier));
+++
++   return CL_SUCCESS;
++ }
++ 
++@@ -135,6 +144,7 @@ pthread_scheduler_uninit ()
++   pocl_aligned_free (scheduler.thread_pool);
++   POCL_FAST_DESTROY (scheduler.wq_lock_fast);
++   PTHREAD_CHECK (pthread_cond_destroy (&scheduler.wake_pool));
+++  PTHREAD_CHECK (pthread_barrier_destroy (&scheduler.init_barrier));
++ 
++   scheduler.thread_pool_shutdown_requested = 0;
++ }
++@@ -525,6 +535,9 @@ pocl_pthread_driver_thread (void *p)
++     }
++ #endif
++ 
+++  PTHREAD_CHECK2 (PTHREAD_BARRIER_SERIAL_THREAD,
+++                  pthread_barrier_wait (&scheduler.init_barrier));
+++
++   while (1)
++     {
++       do_exit = pthread_scheduler_get_work (td);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9328f7812091ecece96e123e9e771221c9e4d4ad
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,73 @@@
++From 70f5e6bfee7798a847e76ee1c6a439ba3153299a Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 26 Nov 2021 14:22:35 +0100
++Subject: [PATCH 74/90] pthread: cleanup/fail pthread_scheduler_init() if any
++ worker is out-of-memory
++
++fixes: #1009
++---
++ lib/CL/devices/pthread/pthread_scheduler.c | 16 ++++++++++++++--
++ 1 file changed, 14 insertions(+), 2 deletions(-)
++
++diff --git a/lib/CL/devices/pthread/pthread_scheduler.c b/lib/CL/devices/pthread/pthread_scheduler.c
++index 63f191c7..c2a15b4c 100644
++--- a/lib/CL/devices/pthread/pthread_scheduler.c
+++++ b/lib/CL/devices/pthread/pthread_scheduler.c
++@@ -80,6 +80,8 @@ typedef struct scheduler_data_
++ 
++   pthread_barrier_t init_barrier
++       __attribute__ ((aligned (HOST_CPU_CACHELINE_SIZE)));
+++
+++  int worker_out_of_memory;
++ } scheduler_data __attribute__ ((aligned (HOST_CPU_CACHELINE_SIZE)));
++ 
++ static scheduler_data scheduler;
++@@ -111,6 +113,7 @@ pthread_scheduler_init (cl_device_id device)
++ 
++   PTHREAD_CHECK (pthread_barrier_init (&scheduler.init_barrier, NULL,
++                                        num_worker_threads + 1));
+++  scheduler.worker_out_of_memory = 0;
++ 
++   for (i = 0; i < num_worker_threads; ++i)
++     {
++@@ -123,6 +126,12 @@ pthread_scheduler_init (cl_device_id device)
++   PTHREAD_CHECK2 (PTHREAD_BARRIER_SERIAL_THREAD,
++                   pthread_barrier_wait (&scheduler.init_barrier));
++ 
+++  if (scheduler.worker_out_of_memory)
+++    {
+++      pthread_scheduler_uninit ();
+++      return CL_OUT_OF_HOST_MEMORY;
+++    }
+++
++   return CL_SUCCESS;
++ }
++ 
++@@ -518,12 +527,10 @@ pocl_pthread_driver_thread (void *p)
++   td->num_threads = scheduler.num_threads;
++   td->printf_buffer = pocl_aligned_malloc (MAX_EXTENDED_ALIGNMENT,
++                                            scheduler.printf_buf_size);
++-  assert (td->printf_buffer != NULL);
++ 
++   assert (scheduler.local_mem_size > 0);
++   td->local_mem = pocl_aligned_malloc (MAX_EXTENDED_ALIGNMENT,
++                                        scheduler.local_mem_size);
++-  assert (td->local_mem);
++ #ifdef __linux__
++   if (pocl_get_bool_option ("POCL_AFFINITY", 0))
++     {
++@@ -535,6 +542,11 @@ pocl_pthread_driver_thread (void *p)
++     }
++ #endif
++ 
+++  if (td->printf_buffer == NULL || td->local_mem == NULL)
+++    {
+++      POCL_ATOMIC_INC (scheduler.worker_out_of_memory);
+++    }
+++
++   PTHREAD_CHECK2 (PTHREAD_BARRIER_SERIAL_THREAD,
++                   pthread_barrier_wait (&scheduler.init_barrier));
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..725102b19f721f6ae5c956fda2652126b32f4704
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,27 @@@
++From 691a5759b925a071371dbc3f9ae2665236c3b992 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 19:28:10 +0100
++Subject: [PATCH 75/90] be more verbose on pthread errors
++
++---
++ lib/CL/pocl_util.c | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/lib/CL/pocl_util.c b/lib/CL/pocl_util.c
++index c6506eb0..e4c62b44 100644
++--- a/lib/CL/pocl_util.c
+++++ b/lib/CL/pocl_util.c
++@@ -1679,8 +1679,8 @@ pocl_abort_on_pthread_error (int status, unsigned line, const char *func)
++ {
++   if (status != 0)
++     {
++-      POCL_MSG_PRINT2 (HSA, func, line, "Error from pthread call:\n");
++-      POCL_ABORT ("%s\n", strerror (status));
+++      POCL_MSG_PRINT2 (ERROR, func, line, "Error from pthread call:\n");
+++      POCL_ABORT ("PTHREAD ERROR in %s():%u: %s (%d)\n", func, line, strerror (status), status);
++     }
++ }
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c40ffbdf95c37b5cb1392602a5075c4a9ab57359
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,148 @@@
++From 1e06f08618fb957172b65da16f3a1efa77b7168d Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 10 Feb 2021 23:25:57 +0100
++Subject: [PATCH 76/90] add POCL_EXPORT to additional symbols needed by the
++ cuda device
++
++---
++ include/pocl_cache.h         | 1 +
++ include/pocl_file_util.h     | 2 ++
++ lib/CL/pocl_intfn.h          | 2 ++
++ lib/CL/pocl_llvm.h           | 1 +
++ lib/CL/pocl_runtime_config.h | 1 +
++ lib/CL/pocl_timing.h         | 3 +++
++ lib/CL/pocl_util.h           | 1 +
++ lib/llvmopencl/LLVMUtils.h   | 1 +
++ 8 files changed, 12 insertions(+)
++
++diff --git a/include/pocl_cache.h b/include/pocl_cache.h
++index 0b6273da..ffb65ad4 100644
++--- a/include/pocl_cache.h
+++++ b/include/pocl_cache.h
++@@ -109,6 +109,7 @@ void pocl_cache_program_bc_path(char*       program_bc_path,
++                                cl_program   program,
++                                unsigned     device_i);
++ 
+++POCL_EXPORT
++ void pocl_cache_work_group_function_path (char *parallel_bc_path,
++                                           cl_program program,
++                                           unsigned device_i, cl_kernel kernel,
++diff --git a/include/pocl_file_util.h b/include/pocl_file_util.h
++index 3bbb2c27..68fe72ce 100644
++--- a/include/pocl_file_util.h
+++++ b/include/pocl_file_util.h
++@@ -42,6 +42,7 @@ int pocl_remove(const char* path);
++ 
++ int pocl_rename(const char *oldpath, const char *newpath);
++ 
+++POCL_EXPORT
++ int pocl_exists(const char* path);
++ 
++ /* Touch file to change last modified time. For portability, this
++@@ -49,6 +50,7 @@ int pocl_exists(const char* path);
++ int pocl_touch_file(const char* path);
++ 
++ /* Writes or appends data to a file.  */
+++POCL_EXPORT
++ int pocl_write_file(const char* path, const char* content,
++                     uint64_t count, int append, int dont_rewrite);
++ 
++diff --git a/lib/CL/pocl_intfn.h b/lib/CL/pocl_intfn.h
++index 1b5f7a0a..ec377648 100644
++--- a/lib/CL/pocl_intfn.h
+++++ b/lib/CL/pocl_intfn.h
++@@ -100,6 +100,7 @@ POdeclsymICD(clIcdGetPlatformIDsKHR)
++ POdeclsym(clReleaseCommandQueue)
++ POdeclsym(clReleaseContext)
++ POdeclsym(clReleaseDevice)
+++POCL_EXPORT
++ POdeclsym(clReleaseEvent)
++ POdeclsym(clReleaseKernel)
++ POdeclsym(clReleaseMemObject)
++@@ -108,6 +109,7 @@ POdeclsym(clReleaseSampler)
++ POdeclsym(clRetainCommandQueue)
++ POdeclsym(clRetainContext)
++ POdeclsym(clRetainDevice)
+++POCL_EXPORT
++ POdeclsym(clRetainEvent)
++ POdeclsym(clRetainKernel)
++ POdeclsym(clRetainMemObject)
++diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h
++index e33c76d2..60f48d23 100644
++--- a/lib/CL/pocl_llvm.h
+++++ b/lib/CL/pocl_llvm.h
++@@ -68,6 +68,7 @@ extern "C" {
++    * WG function that might be specialized according to the properties of
++    * the given Command.
++    */
+++  POCL_EXPORT
++   int pocl_llvm_generate_workgroup_function (unsigned DeviceI,
++                                              cl_device_id Device,
++                                              cl_kernel Kernel,
++diff --git a/lib/CL/pocl_runtime_config.h b/lib/CL/pocl_runtime_config.h
++index 7f47c13f..4f300f1d 100644
++--- a/lib/CL/pocl_runtime_config.h
+++++ b/lib/CL/pocl_runtime_config.h
++@@ -36,6 +36,7 @@ POCL_EXPORT
++ int pocl_get_int_option(const char *key, int default_value);
++ POCL_EXPORT
++ int pocl_get_bool_option(const char *key, int default_value);
+++POCL_EXPORT
++ const char* pocl_get_string_option(const char *key, const char *default_value);
++ 
++ #ifdef __cplusplus
++diff --git a/lib/CL/pocl_timing.h b/lib/CL/pocl_timing.h
++index afcffd94..7d27b9b1 100644
++--- a/lib/CL/pocl_timing.h
+++++ b/lib/CL/pocl_timing.h
++@@ -26,12 +26,15 @@
++ 
++ #include "config.h"
++ 
+++#include "pocl_export.h"
+++
++ #ifdef __cplusplus
++ extern "C" {
++ #endif
++ 
++ extern const unsigned pocl_timer_resolution;
++ 
+++POCL_EXPORT
++ uint64_t pocl_gettimemono_ns();
++ 
++ int pocl_gettimereal(int *year, int *mon, int *day, int *hour, int *min, int *sec, int* nanosec);
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index 22022874..dbf1373d 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -146,6 +146,7 @@ void pocl_unmap_command_finished (cl_device_id dev,
++                                   pocl_mem_identifier *mem_id, cl_mem mem,
++                                   mem_mapping_t *map);
++ 
+++POCL_EXPORT
++ void pocl_unmap_command_finished2 (cl_event event, _cl_command_t *cmd);
++ 
++ /**
++@@ -210,6 +210,7 @@ void pocl_update_event_failed (cl_event event);
++ const char*
++ pocl_status_to_str (int status);
++ 
+++POCL_EXPORT
++ const char *
++ pocl_command_to_str (cl_command_type cmd);
++ 
++diff --git a/lib/llvmopencl/LLVMUtils.h b/lib/llvmopencl/LLVMUtils.h
++index fe77e2ea..bbcaf2b0 100644
++--- a/lib/llvmopencl/LLVMUtils.h
+++++ b/lib/llvmopencl/LLVMUtils.h
++@@ -49,6 +49,7 @@ void
++ regenerate_kernel_metadata(llvm::Module &M, FunctionMapping &kernels);
++ 
++ // Remove a function from a module, along with all callsites.
+++POCL_EXPORT
++ void eraseFunctionAndCallers(llvm::Function *Function);
++ 
++ inline bool
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e42fc83a4d29f6e1ccfc21058d665b24e14be36a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From f9c48de6d771b638e914588599ea98defa22f0cb Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 13 Oct 2021 16:23:53 +0200
++Subject: [PATCH 77/90] add POCL_EXPORT to additional symbols needed if
++ hardening is enabled
++
++---
++ lib/CL/pocl_util.h | 2 ++
++ 1 file changed, 2 insertions(+)
++
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index dbf1373d..0b656a04 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -110,8 +110,10 @@ cl_int pocl_create_command_migrate (_cl_command_node **cmd,
++ void pocl_command_enqueue (cl_command_queue command_queue,
++                           _cl_command_node *node);
++ 
+++POCL_EXPORT
++ int pocl_alloc_or_retain_mem_host_ptr (cl_mem mem);
++ 
+++POCL_EXPORT
++ int pocl_release_mem_host_ptr (cl_mem mem);
++ 
++ /* does several sanity checks on buffer & given memory region */
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..72f3539ff12676a51ac232ba4f7fb8f6f6f744a7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,138 @@@
++From 9c2fa517d7adbf61917e5c9088f83652fcb7805a Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 29 Nov 2021 20:21:02 +0100
++Subject: [PATCH 78/90] add POCL_EXPORT to additional symbols needed by the hsa
++ device
++
++---
++ include/pocl_file_util.h         | 1 +
++ lib/CL/devices/basic/basic.c     | 3 +++
++ lib/CL/devices/common.h          | 3 +++
++ lib/CL/devices/pocl_local_size.h | 1 +
++ lib/CL/pocl_debug.h              | 1 +
++ lib/CL/pocl_intfn.h              | 1 +
++ lib/CL/pocl_util.h               | 2 ++
++ 7 files changed, 12 insertions(+)
++
++diff --git a/include/pocl_file_util.h b/include/pocl_file_util.h
++index 68fe72ce..2030f1fd 100644
++--- a/include/pocl_file_util.h
+++++ b/include/pocl_file_util.h
++@@ -60,6 +60,7 @@ int pocl_write_tempfile (char *output_path, const char *prefix,
++ 
++ /* Allocates memory and places file contents in it.
++  * Returns negative errno on error, zero otherwise. */
+++POCL_EXPORT
++ int pocl_read_file(const char* path, char** content, uint64_t *filesize);
++ 
++ int pocl_write_module(void *module, const char* path, int dont_rewrite);
++diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
++index ac5eaf7b..e550b2bd 100644
++--- a/lib/CL/devices/basic/basic.c
+++++ b/lib/CL/devices/basic/basic.c
++@@ -245,6 +245,7 @@ pocl_basic_init (unsigned j, cl_device_id device, const char* parameters)
++ }
++ 
++ 
+++POCL_EXPORT
++ cl_int
++ pocl_basic_alloc_mem_obj (cl_device_id device, cl_mem mem, void* host_ptr)
++ {
++@@ -274,6 +275,7 @@ pocl_basic_alloc_mem_obj (cl_device_id device, cl_mem mem, void* host_ptr)
++ }
++ 
++ 
+++POCL_EXPORT
++ void
++ pocl_basic_free (cl_device_id device, cl_mem mem)
++ {
++@@ -831,6 +833,7 @@ pocl_basic_svm_copy (cl_device_id dev, void *__restrict__ dst,
++   memcpy (dst, src, size);
++ }
++ 
+++POCL_EXPORT
++ void
++ pocl_basic_svm_fill (cl_device_id dev, void *__restrict__ svm_ptr, size_t size,
++                      void *__restrict__ pattern, size_t pattern_size)
++diff --git a/lib/CL/devices/common.h b/lib/CL/devices/common.h
++index 90a57b89..4643c4ae 100644
++--- a/lib/CL/devices/common.h
+++++ b/lib/CL/devices/common.h
++@@ -79,6 +79,7 @@ void pocl_init_dlhandle_cache ();
++ POCL_EXPORT
++ char *pocl_check_kernel_disk_cache (_cl_command_node *cmd, int specialized);
++ 
+++POCL_EXPORT
++ size_t pocl_cmd_max_grid_dim_width (_cl_command_run *cmd);
++ 
++ POCL_EXPORT
++@@ -89,8 +90,10 @@ void pocl_check_kernel_dlhandle_cache (_cl_command_node *command,
++ POCL_EXPORT
++ void pocl_release_dlhandle_cache (_cl_command_node *cmd);
++ 
+++POCL_EXPORT
++ void pocl_setup_device_for_system_memory(cl_device_id device);
++ 
+++POCL_EXPORT
++ void pocl_reinit_system_memory();
++ 
++ POCL_EXPORT
++diff --git a/lib/CL/devices/pocl_local_size.h b/lib/CL/devices/pocl_local_size.h
++index 359a195c..deaaef4f 100644
++--- a/lib/CL/devices/pocl_local_size.h
+++++ b/lib/CL/devices/pocl_local_size.h
++@@ -39,6 +39,7 @@ void pocl_default_local_size_optimizer (cl_device_id dev, size_t global_x,
++  * results as a side effect from the small work-groups. Performs an exhaustive
++  * search, thus should not be used with devices with a large work-group
++  * support. */
+++POCL_EXPORT
++ void pocl_wg_utilization_maximizer (cl_device_id dev, size_t global_x,
++                                     size_t global_y, size_t global_z,
++                                     size_t *local_x, size_t *local_y,
++diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h
++index 7a218a7c..0a158440 100644
++--- a/lib/CL/pocl_debug.h
+++++ b/lib/CL/pocl_debug.h
++@@ -175,6 +175,7 @@ POCL_EXPORT
++                                                const char* msg,
++                                                const char *func,
++                                                unsigned line);
+++POCL_EXPORT
++         extern void pocl_debug_print_duration (const char* func, unsigned line,
++                                                const char* msg, uint64_t nanosecs);
++         #define POCL_MEASURE_START(SUFFIX) \
++diff --git a/lib/CL/pocl_intfn.h b/lib/CL/pocl_intfn.h
++index ec377648..acbb211b 100644
++--- a/lib/CL/pocl_intfn.h
+++++ b/lib/CL/pocl_intfn.h
++@@ -99,6 +99,7 @@ POdeclsym(clGetSupportedImageFormats)
++ POdeclsymICD(clIcdGetPlatformIDsKHR)
++ POdeclsym(clReleaseCommandQueue)
++ POdeclsym(clReleaseContext)
+++POCL_EXPORT
++ POdeclsym(clReleaseDevice)
++ POCL_EXPORT
++ POdeclsym(clReleaseEvent)
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index 0b656a04..b876bd95 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -191,6 +191,7 @@ void pocl_update_event_queued (cl_event event);
++ POCL_EXPORT
++ void pocl_update_event_submitted (cl_event event);
++ 
+++POCL_EXPORT
++ void pocl_update_event_running_unlocked (cl_event event);
++ 
++ POCL_EXPORT
++@@ -216,6 +217,7 @@ POCL_EXPORT
++ const char *
++ pocl_command_to_str (cl_command_type cmd);
++ 
+++POCL_EXPORT
++ int
++ pocl_run_command(char * const *args);
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2c749ac3cd060658efcd3d85cff351c956327208
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,126 @@@
++From 212bed294876451fcc7d8ce183e25f0da63fe698 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 10:36:27 +0100
++Subject: [PATCH 79/90] add POCL_EXPORT to additional symbols needed by the tce
++ device
++
++---
++ include/pocl_cache.h         | 2 ++
++ include/pocl_file_util.h     | 3 +++
++ lib/CL/pocl_debug.h          | 2 ++
++ lib/CL/pocl_hash.h           | 5 +++++
++ lib/CL/pocl_runtime_config.h | 1 +
++ lib/CL/pocl_util.h           | 1 +
++ 6 files changed, 14 insertions(+)
++
++diff --git a/include/pocl_cache.h b/include/pocl_cache.h
++index ffb65ad4..18601e8c 100644
++--- a/include/pocl_cache.h
+++++ b/include/pocl_cache.h
++@@ -75,12 +75,14 @@
++ int pocl_cache_device_cachedir_exists(cl_program   program,
++                                       unsigned device_i);
++ 
+++POCL_EXPORT
++ int pocl_cache_write_descriptor(cl_program   program,
++                                 unsigned     device_i,
++                                 const char*  kernel_name,
++                                 const char*  content,
++                                 size_t       size);
++ 
+++POCL_EXPORT
++ void pocl_cache_kernel_cachedir_path (char *kernel_cachedir_path,
++                                       cl_program program, unsigned device_i,
++                                       cl_kernel kernel, const char *append_str,
++diff --git a/include/pocl_file_util.h b/include/pocl_file_util.h
++index 2030f1fd..1f8544ee 100644
++--- a/include/pocl_file_util.h
+++++ b/include/pocl_file_util.h
++@@ -35,11 +35,13 @@ extern "C" {
++ int pocl_rm_rf(const char* path);
++ 
++ /* Make a directory, including all directories along path */
+++POCL_EXPORT
++ int pocl_mkdir_p(const char* path);
++ 
++ /* Remove a file or empty directory */
++ int pocl_remove(const char* path);
++ 
+++POCL_EXPORT
++ int pocl_rename(const char *oldpath, const char *newpath);
++ 
++ POCL_EXPORT
++@@ -67,6 +69,7 @@ int pocl_write_module(void *module, const char* path, int dont_rewrite);
++ 
++ int pocl_mk_tempdir (char *output, const char *prefix);
++ 
+++POCL_EXPORT
++ int pocl_mk_tempname (char *output, const char *prefix, const char *suffix,
++                       int *ret_fd);
++ 
++diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h
++index 0a158440..d8482520 100644
++--- a/lib/CL/pocl_debug.h
+++++ b/lib/CL/pocl_debug.h
++@@ -170,7 +170,9 @@ POCL_EXPORT
++ POCL_EXPORT
++         extern void pocl_debug_print_header (const char * func, unsigned line,
++                                              const char* filter, int filter_type);
+++POCL_EXPORT
++         extern void pocl_debug_measure_start (uint64_t* start);
+++POCL_EXPORT
++         extern void pocl_debug_measure_finish (uint64_t* start, uint64_t* finish,
++                                                const char* msg,
++                                                const char *func,
++diff --git a/lib/CL/pocl_hash.h b/lib/CL/pocl_hash.h
++index a9ab939b..a1f9a3c5 100644
++--- a/lib/CL/pocl_hash.h
+++++ b/lib/CL/pocl_hash.h
++@@ -22,6 +22,8 @@
++ #ifndef POCL_HASH_H
++ #define POCL_HASH_H
++ 
+++#include "pocl_export.h"
+++
++ #ifdef __cplusplus
++ extern "C" {
++ #endif
++@@ -39,8 +41,11 @@ typedef struct {
++ 
++ #define SHA1_DIGEST_SIZE 20
++ 
+++POCL_EXPORT
++ void pocl_SHA1_Init(SHA1_CTX* context);
+++POCL_EXPORT
++ void pocl_SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len);
+++POCL_EXPORT
++ void pocl_SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);
++ 
++ #ifdef __cplusplus
++diff --git a/lib/CL/pocl_runtime_config.h b/lib/CL/pocl_runtime_config.h
++index 4f300f1d..639777f8 100644
++--- a/lib/CL/pocl_runtime_config.h
+++++ b/lib/CL/pocl_runtime_config.h
++@@ -31,6 +31,7 @@
++ extern "C" {
++ #endif
++ 
+++POCL_EXPORT
++ int pocl_is_option_set(const char *key);
++ POCL_EXPORT
++ int pocl_get_int_option(const char *key, int default_value);
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index b876bd95..c0fd0886 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -60,6 +60,7 @@
++ void pocl_install_sigusr2_handler ();
++ 
++ /* Finds the next highest power of two of the given value. */
+++POCL_EXPORT
++ size_t pocl_size_ceil2 (size_t x);
++ uint64_t pocl_size_ceil2_64 (uint64_t x);
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c4961ae85503bdbcf921f4830ed7b5441a464aa6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,96 @@@
++From 4c466f2bc61ddb7d40d2b44ff36a19cff7b5e75c Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 11:17:46 +0100
++Subject: [PATCH 80/90] rename get_llvm_cpu_name() to pocl_get_llvm_cpu_name()
++
++---
++ lib/CL/devices/basic/basic.c     | 2 +-
++ lib/CL/devices/common.c          | 2 +-
++ lib/CL/devices/hsa/pocl-hsa.c    | 2 +-
++ lib/CL/devices/pthread/pthread.c | 2 +-
++ lib/CL/pocl_llvm.h               | 2 +-
++ lib/CL/pocl_llvm_utils.cc        | 3 +--
++ 6 files changed, 6 insertions(+), 7 deletions(-)
++
++diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
++index e550b2bd..174ed981 100644
++--- a/lib/CL/devices/basic/basic.c
+++++ b/lib/CL/devices/basic/basic.c
++@@ -144,7 +144,7 @@ pocl_basic_build_hash (cl_device_id device)
++ {
++   char* res = calloc(1000, sizeof(char));
++ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
++-  char *name = get_llvm_cpu_name ();
+++  char *name = pocl_get_llvm_cpu_name ();
++   snprintf (res, 1000, "basic-%s-%s", HOST_DEVICE_BUILD_HASH, name);
++   POCL_MEM_FREE (name);
++ #else
++diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c
++index 2f275476..e4407341 100644
++--- a/lib/CL/devices/common.c
+++++ b/lib/CL/devices/common.c
++@@ -1521,7 +1521,7 @@ pocl_init_default_device_infos (cl_device_id dev)
++ #ifdef HOST_CPU_FORCED
++   dev->llvm_cpu = OCL_KERNEL_TARGET_CPU;
++ #else
++-  dev->llvm_cpu = get_llvm_cpu_name ();
+++  dev->llvm_cpu = pocl_get_llvm_cpu_name ();
++ #endif
++ 
++   dev->spirv_version = "SPIR-V_1.2";
++diff --git a/lib/CL/devices/hsa/pocl-hsa.c b/lib/CL/devices/hsa/pocl-hsa.c
++index 45722587..b07f9303 100644
++--- a/lib/CL/devices/hsa/pocl-hsa.c
+++++ b/lib/CL/devices/hsa/pocl-hsa.c
++@@ -485,7 +485,7 @@ get_hsa_device_features(char* dev_name, struct _cl_device_id* dev)
++               /* TODO: Add a CMake variable or HSA description string
++                  autodetection to control these. */
++               if (dev->llvm_cpu == NULL)
++-                dev->llvm_cpu = get_llvm_cpu_name ();
+++                dev->llvm_cpu = pocl_get_llvm_cpu_name ();
++               if (dev->llvm_target_triplet == NULL)
++                 dev->llvm_target_triplet = OCL_KERNEL_TARGET;
++               dev->arg_buffer_launcher = CL_TRUE;
++diff --git a/lib/CL/devices/pthread/pthread.c b/lib/CL/devices/pthread/pthread.c
++index e66d76e0..c73bfa16 100644
++--- a/lib/CL/devices/pthread/pthread.c
+++++ b/lib/CL/devices/pthread/pthread.c
++@@ -102,7 +102,7 @@ pocl_pthread_build_hash (cl_device_id device)
++ {
++   char* res = calloc(1000, sizeof(char));
++ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
++-  char *name = get_llvm_cpu_name ();
+++  char *name = pocl_get_llvm_cpu_name ();
++   snprintf (res, 1000, "pthread-%s-%s", HOST_DEVICE_BUILD_HASH, name);
++   POCL_MEM_FREE (name);
++ #else
++diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h
++index 60f48d23..bf32ab27 100644
++--- a/lib/CL/pocl_llvm.h
+++++ b/lib/CL/pocl_llvm.h
++@@ -36,7 +36,7 @@ extern "C" {
++ 
++   /* Returns the cpu name as reported by LLVM. */
++   POCL_EXPORT
++-  char *get_llvm_cpu_name ();
+++  char *pocl_get_llvm_cpu_name ();
++   /* Returns if the cpu supports FMA instruction (uses LLVM). */
++   int cpu_has_fma ();
++ 
++diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
++index ceb655e1..63037789 100644
++--- a/lib/CL/pocl_llvm_utils.cc
+++++ b/lib/CL/pocl_llvm_utils.cc
++@@ -121,8 +121,7 @@ static int getModuleTriple(const char *input_stream, size_t size,
++   return 0;
++ }
++ 
++-char *
++-get_llvm_cpu_name () {
+++char *pocl_get_llvm_cpu_name() {
++   StringRef r = llvm::sys::getHostCPUName();
++ 
++   // LLVM may return an empty string -- treat as generic
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e210c89b7ecb0b3793eb8689be314e2b4192befb
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,79 @@@
++From a568848aa4fa5770fe3bd045f55f9f9ce207fc50 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 11:21:48 +0100
++Subject: [PATCH 81/90] rename alloc_buffer_from_region() to
++ pocl_alloc_buffer_from_region()
++
++---
++ lib/CL/devices/accel/accel.cc       |  5 +++--
++ lib/CL/devices/bufalloc.c           |  6 +++---
++ lib/CL/devices/bufalloc.h           |  4 +++-
++ lib/CL/devices/tce/tce_common.cc    | 11 ++++++-----
++ lib/CL/devices/vulkan/pocl-vulkan.c |  8 ++++----
++ 5 files changed, 19 insertions(+), 15 deletions(-)
++
++diff --git a/lib/CL/devices/accel/accel.cc b/lib/CL/devices/accel/accel.cc
++index e68f9485..c04fbd93 100644
++--- a/lib/CL/devices/accel/accel.cc
+++++ b/lib/CL/devices/accel/accel.cc
++@@ -384,7 +384,7 @@ cl_int pocl_accel_alloc_mem_obj(cl_device_id device, cl_mem mem_obj,
++   if ((mem_obj->flags & CL_MEM_ALLOC_HOST_PTR) && (mem_obj->mem_host_ptr == NULL))
++     return CL_MEM_OBJECT_ALLOCATION_FAILURE;
++ 
++-  chunk = alloc_buffer_from_region(&data->AllocRegion, mem_obj->size);
+++  chunk = pocl_alloc_buffer_from_region(&data->AllocRegion, mem_obj->size);
++   if (chunk == NULL)
++     return CL_MEM_OBJECT_ALLOCATION_FAILURE;
++ 
++@@ -697,7 +697,8 @@ size_t scheduleNDRange(AccelData *data, _cl_command_run *run, size_t arg_size,
++   }
++   // Additional space for a signal
++   size_t extraAlloc = sizeof(uint32_t);
++-  chunk_info_t *chunk = alloc_buffer_from_region(&data->AllocRegion, arg_size + extraAlloc);
+++  chunk_info_t *chunk =
+++      pocl_alloc_buffer_from_region(&data->AllocRegion, arg_size + extraAlloc);
++   assert(chunk && "Failed to allocate signal/argument buffer");
++ 
++   POCL_MSG_PRINT_INFO("accel: allocated 0x%zx bytes for signal/arguments "
++diff --git a/lib/CL/devices/bufalloc.c b/lib/CL/devices/bufalloc.c
++index a6fc67d0..0a063a66 100644
++--- a/lib/CL/devices/bufalloc.c
+++++ b/lib/CL/devices/bufalloc.c
++@@ -182,8 +182,8 @@ append_new_chunk (memory_region_t *region,
++  *
++  * @return The chunk, or NULL if no space available in the region.
++  */
++-chunk_info_t*
++-alloc_buffer_from_region (memory_region_t *region, size_t size)
+++chunk_info_t *
+++pocl_alloc_buffer_from_region (memory_region_t *region, size_t size)
++ {
++ #ifdef ENABLE_ASSERTS
++   assert (region != NULL);
++@@ -258,7 +258,7 @@ alloc_buffer (memory_region_t *regions, size_t size)
++   memory_region_t *region = NULL;
++   LL_FOREACH(regions, region)
++     {
++-      chunk = alloc_buffer_from_region (region, size);
+++      chunk = pocl_alloc_buffer_from_region (region, size);
++       if (chunk != NULL)
++         return chunk;
++     }
++diff --git a/lib/CL/devices/bufalloc.h b/lib/CL/devices/bufalloc.h
++index e22f3e4c..6f70c9d9 100644
++--- a/lib/CL/devices/bufalloc.h
+++++ b/lib/CL/devices/bufalloc.h
++@@ -146,7 +146,9 @@ struct memory_region
++   ba_lock_t lock;
++ };
++ 
++-chunk_info_t *alloc_buffer_from_region(memory_region_t *region, size_t size);
+++POCL_EXPORT
+++chunk_info_t *pocl_alloc_buffer_from_region (memory_region_t *region,
+++                                             size_t size);
++ chunk_info_t *alloc_buffer(memory_region_t *regions, size_t size);
++ 
++ memory_region_t *free_buffer (memory_region_t *regions, memory_address_t addr);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..56f8c9086f57ade921f0d093fdc2f460496df538
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,64 @@@
++From a1c2bb0476079bb03d73a01a8fe64b18cb186e61 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 11:27:49 +0100
++Subject: [PATCH 82/90] rename free_chunk() to pocl_free_chunk()
++
++---
++ lib/CL/devices/accel/accel.cc    | 2 +-
++ lib/CL/devices/bufalloc.c        | 4 ++--
++ lib/CL/devices/bufalloc.h        | 3 ++-
++ lib/CL/devices/tce/tce_common.cc | 8 ++++----
++ 4 files changed, 9 insertions(+), 8 deletions(-)
++
++diff --git a/lib/CL/devices/accel/accel.cc b/lib/CL/devices/accel/accel.cc
++index c04fbd93..d64db3ad 100644
++--- a/lib/CL/devices/accel/accel.cc
+++++ b/lib/CL/devices/accel/accel.cc
++@@ -410,7 +410,7 @@ void pocl_accel_free(cl_device_id device, cl_mem mem) {
++                           mem->size, chunk->start_address);
++ 
++   assert(chunk != NULL);
++-  free_chunk (chunk);
+++  pocl_free_chunk(chunk);
++ 
++   p->mem_ptr = NULL;
++   p->version = 0;
++diff --git a/lib/CL/devices/bufalloc.c b/lib/CL/devices/bufalloc.c
++index 0a063a66..54007a05 100644
++--- a/lib/CL/devices/bufalloc.c
+++++ b/lib/CL/devices/bufalloc.c
++@@ -374,7 +374,7 @@ free_buffer (memory_region_t *regions, memory_address_t addr)
++  * form larger unallocated chunks.
++  */
++ void
++-free_chunk (chunk_info_t* chunk)
+++pocl_free_chunk (chunk_info_t *chunk)
++ {
++   memory_region_t *region = chunk->parent_region;
++   BA_LOCK (region->lock);
++@@ -385,7 +385,7 @@ free_chunk (chunk_info_t* chunk)
++   BA_UNLOCK (region->lock);
++ 
++ #ifdef DEBUG_BUFALLOC
++-  printf ("#### after free_chunk (%x)\n", chunk);
+++  printf ("#### after pocl_free_chunk (%x)\n", chunk);
++   print_chunks (region->chunks);
++   printf ("\n");
++ #endif
++diff --git a/lib/CL/devices/bufalloc.h b/lib/CL/devices/bufalloc.h
++index 6f70c9d9..0639dec4 100644
++--- a/lib/CL/devices/bufalloc.h
+++++ b/lib/CL/devices/bufalloc.h
++@@ -152,7 +152,8 @@ chunk_info_t *pocl_alloc_buffer_from_region (memory_region_t *region,
++ chunk_info_t *alloc_buffer(memory_region_t *regions, size_t size);
++ 
++ memory_region_t *free_buffer (memory_region_t *regions, memory_address_t addr);
++-void free_chunk(chunk_info_t* chunk);
+++POCL_EXPORT
+++void pocl_free_chunk (chunk_info_t *chunk);
++ 
++ void init_mem_region (
++     memory_region_t *region, memory_address_t start, size_t size);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ad0eaec26d90131688062059763e64befd726e77
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,58 @@@
++From 03136d3f6966ab8bde4b10b6c5b0a8f6b5fd6752 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 11:34:09 +0100
++Subject: [PATCH 83/90] rename init_mem_region() to pocl_init_mem_region()
++
++---
++ lib/CL/devices/accel/accel.cc       | 3 ++-
++ lib/CL/devices/bufalloc.c           | 3 ++-
++ lib/CL/devices/bufalloc.h           | 3 ++-
++ lib/CL/devices/tce/tce_common.cc    | 4 ++--
++ lib/CL/devices/vulkan/pocl-vulkan.c | 4 ++--
++ 5 files changed, 10 insertions(+), 7 deletions(-)
++
++diff --git a/lib/CL/devices/accel/accel.cc b/lib/CL/devices/accel/accel.cc
++index d64db3ad..195aa152 100644
++--- a/lib/CL/devices/accel/accel.cc
+++++ b/lib/CL/devices/accel/accel.cc
++@@ -521,7 +521,8 @@ cl_int pocl_accel_init(unsigned j, cl_device_id dev, const char *parameters) {
++   D->DataMemory.Map(D->BaseAddress + 2 * max_region, dmem_size, mem_fd);
++   D->ParameterMemory.Map(D->BaseAddress + 3 * max_region, pmem_size, mem_fd);
++ 
++-  init_mem_region(&D->AllocRegion, D->ParameterMemory.PhysAddress, pmem_size);
+++  pocl_init_mem_region(&D->AllocRegion, D->ParameterMemory.PhysAddress,
+++                       pmem_size);
++ 
++   // memory mapping done
++   close(mem_fd);
++diff --git a/lib/CL/devices/bufalloc.c b/lib/CL/devices/bufalloc.c
++index 54007a05..78be6b88 100644
++--- a/lib/CL/devices/bufalloc.c
+++++ b/lib/CL/devices/bufalloc.c
++@@ -398,7 +398,8 @@ pocl_free_chunk (chunk_info_t *chunk)
++  * @Param size  the size of the region (in bytes?)
++  */
++ void
++-init_mem_region (memory_region_t *region, memory_address_t start, size_t size)
+++pocl_init_mem_region (memory_region_t *region, memory_address_t start,
+++                      size_t size)
++ {
++   int i;
++   BA_INIT_LOCK (region->lock);
++diff --git a/lib/CL/devices/bufalloc.h b/lib/CL/devices/bufalloc.h
++index 0639dec4..91c85d39 100644
++--- a/lib/CL/devices/bufalloc.h
+++++ b/lib/CL/devices/bufalloc.h
++@@ -155,7 +155,8 @@ memory_region_t *free_buffer (memory_region_t *regions, memory_address_t addr);
++ POCL_EXPORT
++ void pocl_free_chunk (chunk_info_t *chunk);
++ 
++-void init_mem_region (
+++POCL_EXPORT
+++void pocl_init_mem_region (
++     memory_region_t *region, memory_address_t start, size_t size);
++ 
++ chunk_info_t *create_sub_chunk (chunk_info_t *parent, size_t offset, size_t size);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..17b8ad7cce65200736f8fd56473a578fef21970d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,42 @@@
++From 493a1112fd3b6e57fcf50edc4d447559d4fd7c44 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Sat, 4 Dec 2021 21:51:30 +0100
++Subject: [PATCH 84/90] rename byteswap_uint32_t() to pocl_byteswap_uint32_t()
++
++---
++ lib/CL/devices/tce/tce_common.cc    | 64 +++++++++++++++--------------
++ lib/CL/devices/tce/ttasim/ttasim.cc |  2 +-
++ lib/CL/pocl_util.c                  |  2 +-
++ lib/CL/pocl_util.h                  |  3 +-
++ 4 files changed, 37 insertions(+), 34 deletions(-)
++
++diff --git a/lib/CL/pocl_util.c b/lib/CL/pocl_util.c
++index e4c62b44..984808a3 100644
++--- a/lib/CL/pocl_util.c
+++++ b/lib/CL/pocl_util.c
++@@ -169,7 +169,7 @@ pocl_restore_rm (unsigned rm)
++ }
++ 
++ uint32_t
++-byteswap_uint32_t (uint32_t word, char should_swap)
+++pocl_byteswap_uint32_t (uint32_t word, char should_swap)
++ {
++     union word_union
++     {
++diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h
++index c0fd0886..d7192e69 100644
++--- a/lib/CL/pocl_util.h
+++++ b/lib/CL/pocl_util.h
++@@ -33,7 +33,8 @@
++ extern "C" {
++ #endif
++ 
++-uint32_t byteswap_uint32_t (uint32_t word, char should_swap);
+++POCL_EXPORT
+++uint32_t pocl_byteswap_uint32_t (uint32_t word, char should_swap);
++ float byteswap_float (float word, char should_swap);
++ 
++ /* set rounding mode */
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a8ebf38a34cf83a13ef25b519ac09972670ab149
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,31 @@@
++From 434e178c52e26718bdd1282ea05db059594893aa Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 6 Dec 2021 20:14:37 +0100
++Subject: [PATCH 86/90] enable VISIBILITY_HIDDEN by default
++
++(unless the proxy device is enabled)
++---
++ CMakeLists.txt | 7 ++++++-
++ 1 file changed, 6 insertions(+), 1 deletion(-)
++
++diff --git a/CMakeLists.txt b/CMakeLists.txt
++index 45044ed1..82eca451 100644
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -199,7 +199,12 @@ option(POCL_ICD_ABSOLUTE_PATH "Use absolute path in pocl.icd" ON)
++ 
++ option(ENABLE_POCL_BUILDING "When OFF, env var POCL_BUILDING has no effect. Defaults to ON" ON)
++ 
++-option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" OFF)
+++if (ENABLE_PROXY_DEVICE)
+++  set(VISIBILITY_HIDDEN_DEFAULT OFF)
+++else()
+++  set(VISIBILITY_HIDDEN_DEFAULT ON)
+++endif()
+++option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" VISIBILITY_HIDDEN_DEFAULT)
++ if(VISIBILITY_HIDDEN)
++   add_compile_options(-fvisibility=hidden)
++   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fvisibility-inlines-hidden>)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..26e62009ff01e104ce31c34819aa29b402b55e30
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,133 @@@
++From 5a8eea46cbba6ae36538d653d2fc8598b3b8e0d2 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 7 Dec 2021 00:14:36 +0100
++Subject: [PATCH 87/90] rename pocl_basic_alloc_mem_obj() to
++ pocl_driver_alloc_mem_obj()
++
++---
++ lib/CL/devices/basic/basic.c   | 32 +-------------------------------
++ lib/CL/devices/common_driver.c | 28 ++++++++++++++++++++++++++++
++ lib/CL/devices/common_driver.h |  4 ++++
++ lib/CL/devices/hsa/pocl-hsa.c  |  2 +-
++ 4 files changed, 34 insertions(+), 32 deletions(-)
++
++diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
++index 174ed981..569d7bc9 100644
++--- a/lib/CL/devices/basic/basic.c
+++++ b/lib/CL/devices/basic/basic.c
++@@ -77,7 +77,7 @@ pocl_basic_init_device_ops(struct pocl_device_ops *ops)
++   ops->reinit = pocl_basic_reinit;
++   ops->init = pocl_basic_init;
++ 
++-  ops->alloc_mem_obj = pocl_basic_alloc_mem_obj;
+++  ops->alloc_mem_obj = pocl_driver_alloc_mem_obj;
++   ops->free = pocl_basic_free;
++ 
++   ops->read = pocl_driver_read;
++@@ -245,36 +245,6 @@ pocl_basic_init (unsigned j, cl_device_id device, const char* parameters)
++ }
++ 
++ 
++-POCL_EXPORT
++-cl_int
++-pocl_basic_alloc_mem_obj (cl_device_id device, cl_mem mem, void* host_ptr)
++-{
++-  pocl_mem_identifier *p = &mem->device_ptrs[device->global_mem_id];
++-
++-  /* let other drivers preallocate */
++-  if ((mem->flags & CL_MEM_ALLOC_HOST_PTR) && (mem->mem_host_ptr == NULL))
++-    return CL_MEM_OBJECT_ALLOCATION_FAILURE;
++-
++-  /* malloc mem_host_ptr then increase refcount */
++-  pocl_alloc_or_retain_mem_host_ptr (mem);
++-
++-  cl_device_id svm_dev = mem->context->svm_allocdev;
++-  /* if we have a device which shares global memory with host,
++-   * and it needs to do anything to make allocations accessible
++-   * to itself, do it here */
++-  if (svm_dev && svm_dev->global_mem_id == 0 && svm_dev->ops->svm_register)
++-    svm_dev->ops->svm_register (svm_dev, mem->mem_host_ptr, mem->size);
++-
++-  p->version = mem->mem_host_ptr_version;
++-  p->mem_ptr = mem->mem_host_ptr;
++-
++-  POCL_MSG_PRINT_MEMORY ("Basic device ALLOC %p / size %zu \n", p->mem_ptr,
++-                         mem->size);
++-
++-  return CL_SUCCESS;
++-}
++-
++-
++ POCL_EXPORT
++ void
++ pocl_basic_free (cl_device_id device, cl_mem mem)
++diff --git a/lib/CL/devices/common_driver.c b/lib/CL/devices/common_driver.c
++index 9d306ad7..5a9f21b4 100644
++--- a/lib/CL/devices/common_driver.c
+++++ b/lib/CL/devices/common_driver.c
++@@ -454,6 +454,34 @@ pocl_driver_free_mapping_ptr (void *data, pocl_mem_identifier *mem_id,
++   return CL_SUCCESS;
++ }
++ 
+++cl_int
+++pocl_driver_alloc_mem_obj (cl_device_id device, cl_mem mem, void *host_ptr)
+++{
+++  pocl_mem_identifier *p = &mem->device_ptrs[device->global_mem_id];
+++
+++  /* let other drivers preallocate */
+++  if ((mem->flags & CL_MEM_ALLOC_HOST_PTR) && (mem->mem_host_ptr == NULL))
+++    return CL_MEM_OBJECT_ALLOCATION_FAILURE;
+++
+++  /* malloc mem_host_ptr then increase refcount */
+++  pocl_alloc_or_retain_mem_host_ptr (mem);
+++
+++  cl_device_id svm_dev = mem->context->svm_allocdev;
+++  /* if we have a device which shares global memory with host,
+++   * and it needs to do anything to make allocations accessible
+++   * to itself, do it here */
+++  if (svm_dev && svm_dev->global_mem_id == 0 && svm_dev->ops->svm_register)
+++    svm_dev->ops->svm_register (svm_dev, mem->mem_host_ptr, mem->size);
+++
+++  p->version = mem->mem_host_ptr_version;
+++  p->mem_ptr = mem->mem_host_ptr;
+++
+++  POCL_MSG_PRINT_MEMORY ("Basic device ALLOC %p / size %zu \n", p->mem_ptr,
+++                         mem->size);
+++
+++  return CL_SUCCESS;
+++}
+++
++ /* These are implementations of compilation callbacks for all devices
++  * that support compilation via LLVM. They take care of compilation/linking
++  * of source/binary/spir down to parallel.bc level.
++diff --git a/lib/CL/devices/common_driver.h b/lib/CL/devices/common_driver.h
++index 424f137e..02605ec2 100644
++--- a/lib/CL/devices/common_driver.h
+++++ b/lib/CL/devices/common_driver.h
++@@ -74,6 +74,10 @@ POCL_EXPORT
++   cl_int pocl_driver_free_mapping_ptr (void *data, pocl_mem_identifier *mem_id,
++                                        cl_mem mem, mem_mapping_t *map);
++ 
+++POCL_EXPORT
+++cl_int pocl_driver_alloc_mem_obj (cl_device_id device, cl_mem mem,
+++                                  void *host_ptr);
+++
++   POCL_EXPORT
++   int pocl_driver_build_source (cl_program program, cl_uint device_i,
++                                 cl_uint num_input_headers,
++diff --git a/lib/CL/devices/hsa/pocl-hsa.c b/lib/CL/devices/hsa/pocl-hsa.c
++index b07f9303..91feb438 100644
++--- a/lib/CL/devices/hsa/pocl-hsa.c
+++++ b/lib/CL/devices/hsa/pocl-hsa.c
++@@ -881,7 +881,7 @@ pocl_hsa_alloc_mem_obj (cl_device_id device, cl_mem mem_obj, void *host_ptr)
++ {
++   /* if we share global memory with CPU, let the CPU driver allocate it */
++   if (device->global_mem_id == 0)
++-    return pocl_basic_alloc_mem_obj (device, mem_obj, host_ptr);
+++    return pocl_driver_alloc_mem_obj (device, mem_obj, host_ptr);
++ 
++   /* ... otherwise allocate it via HSA. */
++   pocl_mem_identifier *p = &mem_obj->device_ptrs[device->global_mem_id];
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6c0b7f0a8125518a81fc3bbd1f454ce07d0b6999
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,115 @@@
++From 17e1e137faeb70c1d1fcfc30747dc66ce32c52e1 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 7 Dec 2021 00:23:00 +0100
++Subject: [PATCH 88/90] rename pocl_basic_free() to pocl_driver_free()
++
++---
++ lib/CL/devices/basic/basic.c   | 17 +----------------
++ lib/CL/devices/common_driver.c | 13 +++++++++++++
++ lib/CL/devices/common_driver.h |  3 +++
++ lib/CL/devices/hsa/pocl-hsa.c  |  2 +-
++ lib/CL/pocl_cl.h               |  2 +-
++ 5 files changed, 19 insertions(+), 18 deletions(-)
++
++diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
++index 569d7bc9..9d1b33be 100644
++--- a/lib/CL/devices/basic/basic.c
+++++ b/lib/CL/devices/basic/basic.c
++@@ -78,7 +78,7 @@ pocl_basic_init_device_ops(struct pocl_device_ops *ops)
++   ops->init = pocl_basic_init;
++ 
++   ops->alloc_mem_obj = pocl_driver_alloc_mem_obj;
++-  ops->free = pocl_basic_free;
+++  ops->free = pocl_driver_free;
++ 
++   ops->read = pocl_driver_read;
++   ops->read_rect = pocl_driver_read_rect;
++@@ -244,21 +244,6 @@ pocl_basic_init (unsigned j, cl_device_id device, const char* parameters)
++   return ret;
++ }
++ 
++-
++-POCL_EXPORT
++-void
++-pocl_basic_free (cl_device_id device, cl_mem mem)
++-{
++-  cl_device_id svm_dev = mem->context->svm_allocdev;
++-  if (svm_dev && svm_dev->global_mem_id == 0 && svm_dev->ops->svm_unregister)
++-    svm_dev->ops->svm_unregister (svm_dev, mem->mem_host_ptr, mem->size);
++-
++-  pocl_mem_identifier *p = &mem->device_ptrs[device->global_mem_id];
++-  pocl_release_mem_host_ptr (mem);
++-  p->mem_ptr = NULL;
++-  p->version = 0;
++-}
++-
++ void
++ pocl_basic_run (void *data, _cl_command_node *cmd)
++ {
++diff --git a/lib/CL/devices/common_driver.c b/lib/CL/devices/common_driver.c
++index 5a9f21b4..75df3461 100644
++--- a/lib/CL/devices/common_driver.c
+++++ b/lib/CL/devices/common_driver.c
++@@ -482,6 +482,19 @@ pocl_driver_alloc_mem_obj (cl_device_id device, cl_mem mem, void *host_ptr)
++   return CL_SUCCESS;
++ }
++ 
+++void
+++pocl_driver_free (cl_device_id device, cl_mem mem)
+++{
+++  cl_device_id svm_dev = mem->context->svm_allocdev;
+++  if (svm_dev && svm_dev->global_mem_id == 0 && svm_dev->ops->svm_unregister)
+++    svm_dev->ops->svm_unregister (svm_dev, mem->mem_host_ptr, mem->size);
+++
+++  pocl_mem_identifier *p = &mem->device_ptrs[device->global_mem_id];
+++  pocl_release_mem_host_ptr (mem);
+++  p->mem_ptr = NULL;
+++  p->version = 0;
+++}
+++
++ /* These are implementations of compilation callbacks for all devices
++  * that support compilation via LLVM. They take care of compilation/linking
++  * of source/binary/spir down to parallel.bc level.
++diff --git a/lib/CL/devices/common_driver.h b/lib/CL/devices/common_driver.h
++index 02605ec2..777c02ae 100644
++--- a/lib/CL/devices/common_driver.h
+++++ b/lib/CL/devices/common_driver.h
++@@ -78,6 +78,9 @@ POCL_EXPORT
++ cl_int pocl_driver_alloc_mem_obj (cl_device_id device, cl_mem mem,
++                                   void *host_ptr);
++ 
+++POCL_EXPORT
+++void pocl_driver_free (cl_device_id device, cl_mem mem);
+++
++   POCL_EXPORT
++   int pocl_driver_build_source (cl_program program, cl_uint device_i,
++                                 cl_uint num_input_headers,
++diff --git a/lib/CL/devices/hsa/pocl-hsa.c b/lib/CL/devices/hsa/pocl-hsa.c
++index 91feb438..3cab0fa6 100644
++--- a/lib/CL/devices/hsa/pocl-hsa.c
+++++ b/lib/CL/devices/hsa/pocl-hsa.c
++@@ -902,7 +902,7 @@ pocl_hsa_free (cl_device_id device, cl_mem memobj)
++ {
++   /* if we share global memory with CPU, let the CPU driver free it */
++   if (device->global_mem_id == 0)
++-    return pocl_basic_free (device, memobj);
+++    return pocl_driver_free (device, memobj);
++ 
++   /* ... otherwise free it via HSA. */
++   cl_mem_flags flags = memobj->flags;
++diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
++index fdd58f27..c09cfecc 100644
++--- a/lib/CL/pocl_cl.h
+++++ b/lib/CL/pocl_cl.h
++@@ -518,7 +518,7 @@ struct pocl_device_ops {
++   /* these are optional. If the driver needs to do anything to be able
++    * to use host memory, it should do it (and undo it) in these callbacks.
++    * Currently used by HSA.
++-   * See pocl_basic_alloc and pocl_basic_free for details. */
+++   * See pocl_driver_alloc_mem_obj and pocl_driver_free for details. */
++   void (*svm_register) (cl_device_id dev, void *host_ptr, size_t size);
++   void (*svm_unregister) (cl_device_id dev, void *host_ptr, size_t size);
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..669b7f40ce0ad8019e04d3ca417352745ff54639
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,92 @@@
++From 9f0e38126094058e4b5cb9eb1b8c36e2194384e2 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 7 Dec 2021 00:25:21 +0100
++Subject: [PATCH 89/90] rename pocl_basic_svm_fill() to pocl_driver_svm_fill()
++
++---
++ lib/CL/devices/basic/basic.c   | 12 +-----------
++ lib/CL/devices/common_driver.c | 10 ++++++++++
++ lib/CL/devices/common_driver.h |  5 +++++
++ lib/CL/devices/hsa/pocl-hsa.c  |  2 +-
++ 4 files changed, 17 insertions(+), 12 deletions(-)
++
++diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
++index 9d1b33be..fc675cf5 100644
++--- a/lib/CL/devices/basic/basic.c
+++++ b/lib/CL/devices/basic/basic.c
++@@ -125,7 +125,7 @@ pocl_basic_init_device_ops(struct pocl_device_ops *ops)
++   ops->svm_map = NULL;
++   ops->svm_unmap = NULL;
++   ops->svm_copy = pocl_basic_svm_copy;
++-  ops->svm_fill = pocl_basic_svm_fill;
+++  ops->svm_fill = pocl_driver_svm_fill;
++ 
++   ops->create_kernel = NULL;
++   ops->free_kernel = NULL;
++@@ -787,13 +787,3 @@ pocl_basic_svm_copy (cl_device_id dev, void *__restrict__ dst,
++ {
++   memcpy (dst, src, size);
++ }
++-
++-POCL_EXPORT
++-void
++-pocl_basic_svm_fill (cl_device_id dev, void *__restrict__ svm_ptr, size_t size,
++-                     void *__restrict__ pattern, size_t pattern_size)
++-{
++-  pocl_mem_identifier temp;
++-  temp.mem_ptr = svm_ptr;
++-  pocl_driver_memfill (dev->data, &temp, NULL, size, 0, pattern, pattern_size);
++-}
++diff --git a/lib/CL/devices/common_driver.c b/lib/CL/devices/common_driver.c
++index 75df3461..5d37e7de 100644
++--- a/lib/CL/devices/common_driver.c
+++++ b/lib/CL/devices/common_driver.c
++@@ -495,6 +495,16 @@ pocl_driver_free (cl_device_id device, cl_mem mem)
++   p->version = 0;
++ }
++ 
+++void
+++pocl_driver_svm_fill (cl_device_id dev, void *__restrict__ svm_ptr,
+++                      size_t size, void *__restrict__ pattern,
+++                      size_t pattern_size)
+++{
+++  pocl_mem_identifier temp;
+++  temp.mem_ptr = svm_ptr;
+++  pocl_driver_memfill (dev->data, &temp, NULL, size, 0, pattern, pattern_size);
+++}
+++
++ /* These are implementations of compilation callbacks for all devices
++  * that support compilation via LLVM. They take care of compilation/linking
++  * of source/binary/spir down to parallel.bc level.
++diff --git a/lib/CL/devices/common_driver.h b/lib/CL/devices/common_driver.h
++index 777c02ae..2f019418 100644
++--- a/lib/CL/devices/common_driver.h
+++++ b/lib/CL/devices/common_driver.h
++@@ -81,6 +81,11 @@ cl_int pocl_driver_alloc_mem_obj (cl_device_id device, cl_mem mem,
++ POCL_EXPORT
++ void pocl_driver_free (cl_device_id device, cl_mem mem);
++ 
+++POCL_EXPORT
+++void pocl_driver_svm_fill (cl_device_id dev, void *__restrict__ svm_ptr,
+++                           size_t size, void *__restrict__ pattern,
+++                           size_t pattern_size);
+++
++   POCL_EXPORT
++   int pocl_driver_build_source (cl_program program, cl_uint device_i,
++                                 cl_uint num_input_headers,
++diff --git a/lib/CL/devices/hsa/pocl-hsa.c b/lib/CL/devices/hsa/pocl-hsa.c
++index 3cab0fa6..4b34968d 100644
++--- a/lib/CL/devices/hsa/pocl-hsa.c
+++++ b/lib/CL/devices/hsa/pocl-hsa.c
++@@ -257,7 +257,7 @@ pocl_hsa_init_device_ops(struct pocl_device_ops *ops)
++   ops->svm_free = pocl_hsa_svm_free;
++   ops->svm_alloc = pocl_hsa_svm_alloc;
++   ops->svm_copy = pocl_hsa_svm_copy;
++-  ops->svm_fill = pocl_basic_svm_fill;
+++  ops->svm_fill = pocl_driver_svm_fill;
++   ops->svm_register = pocl_hsa_svm_register;
++   ops->svm_unregister = pocl_hsa_svm_unregister;
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4a349bac59d38bd5545fb9aa9a22396014ca7717
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,24 @@@
++From 352df65e2f00831b5cb7c22c628be26850b7c809 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 7 Dec 2021 18:06:32 +0100
++Subject: [PATCH 90/90] do not link libpocl-devices-hsa.so against
++ libpocl-devices-basic.so
++
++---
++ lib/CL/devices/hsa/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/hsa/CMakeLists.txt b/lib/CL/devices/hsa/CMakeLists.txt
++index 77d5e6c6..483efb2d 100644
++--- a/lib/CL/devices/hsa/CMakeLists.txt
+++++ b/lib/CL/devices/hsa/CMakeLists.txt
++@@ -28,5 +28,5 @@ if(MSVC)
++ endif(MSVC)
++ add_pocl_device_library(pocl-devices-hsa pocl-hsa.c pocl-hsa.h)
++ if(ENABLE_LOADABLE_DRIVERS)
++-  target_link_libraries(pocl-devices-hsa PRIVATE pocl-devices-basic ${HSALIB})
+++  target_link_libraries(pocl-devices-hsa PRIVATE ${HSALIB})
++ endif()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..88bda89c27595d6321a2602db14d6d288a62b63f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,36 @@@
++From 741a53c8fc2dfb7beab4dcd28fed10bfdcaddb89 Mon Sep 17 00:00:00 2001
++From: nchristensen <11543181+nchristensen@users.noreply.github.com>
++Date: Sun, 5 Dec 2021 16:58:18 +0000
++Subject: [PATCH 096/144] Avoid loss precision in event time calculations
++
++The current code implicitly converts `epoch` to a float before calculating `time_end` and `time_start` and converting back to a `cl_ulong`. A `float` only has seven or so digits of accuracy meaning this conversion throws away the least significant digits of `epoch` if `epoch` is larger than about 1e8. Conversely, the precision of `diff` is around 1e-3 so multiplying by 1e6 makes all of these digits > 1 and converting this number to a `cl_ulong` will not lose any  digits. The gist below illustrates this in Python.
++
++https://gist.github.com/nchristensen/15ab1fd53ba099accaab780ab6dbad90
++---
++ lib/CL/devices/cuda/pocl-cuda.c | 4 ++--
++ 1 file changed, 2 insertions(+), 2 deletions(-)
++
++diff --git a/lib/CL/devices/cuda/pocl-cuda.c b/lib/CL/devices/cuda/pocl-cuda.c
++index af423655..350fc568 100644
++--- a/lib/CL/devices/cuda/pocl-cuda.c
+++++ b/lib/CL/devices/cuda/pocl-cuda.c
++@@ -1540,14 +1540,14 @@ pocl_cuda_update_event (cl_device_id device, cl_event event)
++           &diff, ((pocl_cuda_device_data_t *)device->data)->epoch_event,
++           event_data->start);
++       CUDA_CHECK (result, "cuEventElapsedTime");
++-      event->time_start = (cl_ulong) (epoch + diff * 1e6);
+++      event->time_start = epoch + (cl_ulong)(diff * 1e6);
++       event->time_start = max (event->time_start, epoch + 1);
++ 
++       result = cuEventElapsedTime (
++           &diff, ((pocl_cuda_device_data_t *)device->data)->epoch_event,
++           event_data->end);
++       CUDA_CHECK (result, "cuEventElapsedTime");
++-      event->time_end = (cl_ulong) (epoch + diff * 1e6);
+++      event->time_end = epoch + (cl_ulong)(diff * 1e6);
++       event->time_end = max (event->time_end, event->time_start + 1);
++     }
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..fd84e6f0de2d69c73329cbcf5c2b8d55c8bff933
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,146 @@@
++From dde408318892477671ede1123de86af7c0794be4 Mon Sep 17 00:00:00 2001
++From: Roman Rusyaev <rusyaev.rm@gmail.com>
++Date: Tue, 27 Apr 2021 14:28:41 +0300
++Subject: [PATCH 097/144] Avoid inheritance from std::vector in ParallelRegion
++ class.
++
++Use composition instead of inheritance.
++---
++ lib/llvmopencl/ParallelRegion.cc |  3 +-
++ lib/llvmopencl/ParallelRegion.h  | 59 ++++++++++++++++++++++++--------
++ 2 files changed, 46 insertions(+), 16 deletions(-)
++
++diff --git a/lib/llvmopencl/ParallelRegion.cc b/lib/llvmopencl/ParallelRegion.cc
++index 9d40c09b..793db704 100644
++--- a/lib/llvmopencl/ParallelRegion.cc
+++++ b/lib/llvmopencl/ParallelRegion.cc
++@@ -55,8 +55,7 @@ using namespace pocl;
++ 
++ int ParallelRegion::idGen = 0;
++ 
++-ParallelRegion::ParallelRegion(int forcedRegionId) : 
++-  std::vector<llvm::BasicBlock *>(), 
+++ParallelRegion::ParallelRegion(int forcedRegionId) :
++   LocalIDXLoadInstr(NULL), LocalIDYLoadInstr(NULL), LocalIDZLoadInstr(NULL),
++   exitIndex_(0), entryIndex_(0), pRegionId(forcedRegionId)
++ {
++diff --git a/lib/llvmopencl/ParallelRegion.h b/lib/llvmopencl/ParallelRegion.h
++index 4e359068..7662b79d 100644
++--- a/lib/llvmopencl/ParallelRegion.h
+++++ b/lib/llvmopencl/ParallelRegion.h
++@@ -1,18 +1,18 @@
++ // Class definition for parallel regions, a group of BasicBlocks that
++ // each kernel should run in parallel.
++-// 
+++//
++ // Copyright (c) 2011 Universidad Rey Juan Carlos
++-// 
+++//
++ // Permission is hereby granted, free of charge, to any person obtaining a copy
++ // of this software and associated documentation files (the "Software"), to deal
++ // in the Software without restriction, including without limitation the rights
++ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ // copies of the Software, and to permit persons to whom the Software is
++ // furnished to do so, subject to the following conditions:
++-// 
+++//
++ // The above copyright notice and this permission notice shall be included in
++ // all copies or substantial portions of the Software.
++-// 
+++//
++ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++@@ -45,15 +45,44 @@ namespace pocl {
++ 
++ class Kernel;
++ 
++-  // TODO Cleanup: this should not inherit vector but contain it.
++-  // It now exposes too much to the clients and leads to hard
++-  // to track errors when the API is changed.
++-  class ParallelRegion : public std::vector<llvm::BasicBlock *> {    
+++  class ParallelRegion {
+++  private:
+++    using BBContainer = std::vector<llvm::BasicBlock *>;
+++
++   public:
++     typedef llvm::SmallVector<ParallelRegion *, 8> ParallelRegionVector;
++ 
+++    using iterator = BBContainer::iterator;
+++    using const_iterator = BBContainer::const_iterator;
+++
++     ParallelRegion(int forcedRegionId=-1);
++ 
+++    iterator begin() { return BBs_.begin(); }
+++    iterator end() { return BBs_.end(); }
+++
+++    const_iterator begin() const { return BBs_.begin(); }
+++    const_iterator end() const { return BBs_.end(); }
+++
+++    llvm::BasicBlock *front() { return BBs_.front(); }
+++    llvm::BasicBlock *back() { return BBs_.back(); }
+++
+++    llvm::BasicBlock *at(size_t index) { return BBs_.at(index); }
+++    llvm::BasicBlock *operator[](size_t index) { return BBs_[index]; }
+++
+++    std::size_t size() const { return BBs_.size(); }
+++    bool empty() const { return BBs_.empty(); }
+++
+++    void push_back(llvm::BasicBlock *BB) { BBs_.push_back(BB); }
+++
+++    void insert(const_iterator pos, llvm::BasicBlock *BB) {
+++      BBs_.insert(pos, BB);
+++    }
+++
+++    template <typename InIteratorT>
+++    void insert(const_iterator pos, InIteratorT first, InIteratorT last) {
+++      BBs_.insert(pos, first, last);
+++    }
+++
++     /* BarrierBlock *getEntryBarrier(); */
++     ParallelRegion *replicate(llvm::ValueToValueMapTy &map,
++                               const llvm::Twine &suffix);
++@@ -75,9 +104,9 @@ class Kernel;
++ 
++     llvm::BasicBlock* exitBB() { return at(exitIndex_); }
++     llvm::BasicBlock* entryBB() { return at(entryIndex_); }
++-    void AddIDMetadata(llvm::LLVMContext& context, 
++-                       std::size_t x = 0, 
++-                       std::size_t y = 0, 
+++    void AddIDMetadata(llvm::LLVMContext& context,
+++                       std::size_t x = 0,
+++                       std::size_t y = 0,
++                        std::size_t z = 0);
++ 
++     void AddParallelLoopMetadata
++@@ -94,7 +123,7 @@ class Kernel;
++          std::vector<llvm::Value*>& params);
++ 
++     static ParallelRegion *
++-      Create(const llvm::SmallPtrSet<llvm::BasicBlock *, 8>& bbs, 
+++      Create(const llvm::SmallPtrSet<llvm::BasicBlock *, 8>& bbs,
++              llvm::BasicBlock *entry, llvm::BasicBlock *exit);
++ 
++     static void GenerateTempNames(llvm::BasicBlock *bb);
++@@ -108,6 +137,8 @@ class Kernel;
++     int GetID() const { return pRegionId; }
++ 
++   private:
+++    BBContainer BBs_;
+++
++     llvm::Instruction* LocalIDXLoadInstr;
++     llvm::Instruction* LocalIDYLoadInstr;
++     llvm::Instruction* LocalIDZLoadInstr;
++@@ -123,7 +154,7 @@ class Kernel;
++     static int idGen;
++ 
++   };
++-    
+++
++ }
++-                              
+++
++ #endif
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2dbae78f7c73f77686ff9b1260f01f98a3fb0b82
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++From 1ecff372fdb9bc3cf94a14c77eb9c8abc8363bf0 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 27 Jan 2021 21:26:51 +0100
++Subject: [PATCH 099/144] restore setting unroll-threshold on LLVM 9
++
++otherwise kernel/test_rotate hangs on avx512 capable cpus
++
++all other llvm releases work fine without this setting
++
++(this partially reverts 459d0bb5241a62af3b5b607a65dcf5e9a34a01ee)
++
++fixes: #915
++---
++ lib/CL/pocl_llvm_utils.cc | 5 +++++
++ 1 file changed, 5 insertions(+)
++
++diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
++index 63037789..bea50041 100644
++--- a/lib/CL/pocl_llvm_utils.cc
+++++ b/lib/CL/pocl_llvm_utils.cc
++@@ -343,6 +343,11 @@ void InitializeLLVM() {
++       assert(O && "could not find LLVM option 'debug'");
++       O->addOccurrence(1, StringRef("debug"), StringRef("true"), false);
++     }
+++#if LLVM_MAJOR == 9
+++    O = opts["unroll-threshold"];
+++    assert(O && "could not find LLVM option 'unroll-threshold'");
+++    O->addOccurrence(1, StringRef("unroll-threshold"), StringRef("1"), false);
+++#endif
++   }
++ }
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ff4479fd253fd376578e6eba224793402dd8b68d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++From 52d62e12049d542653fd9eb83e50b73cb06df27e Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 24 Nov 2021 15:06:54 +0100
++Subject: [PATCH 100/144] link libpocl-devices-pthread.so with -pthread
++
++---
++ lib/CL/devices/pthread/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/pthread/CMakeLists.txt b/lib/CL/devices/pthread/CMakeLists.txt
++index 4b99fc89..d8b1b0e2 100644
++--- a/lib/CL/devices/pthread/CMakeLists.txt
+++++ b/lib/CL/devices/pthread/CMakeLists.txt
++@@ -28,5 +28,5 @@ if(MSVC)
++ endif(MSVC)
++ add_pocl_device_library(pocl-devices-pthread pocl-pthread.h pthread.c pthread_scheduler.c pthread_utils.c)
++ if(ENABLE_LOADABLE_DRIVERS)
++-target_link_libraries(pocl-devices-pthread PRIVATE pocl-devices-basic)
+++target_link_libraries(pocl-devices-pthread PRIVATE pocl-devices-basic ${PTHREAD_LIBRARY})
++ endif()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5ea5b31b79b09244b8389631c7e7b05ced85abdb
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++From 2bdc1fc55479136fac4d2e68a853ba5c378f8c1a Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 29 Nov 2021 21:07:14 +0100
++Subject: [PATCH 101/144] link libpocl-devices-cuda.so with -lLLVM -pthread
++
++---
++ lib/CL/devices/cuda/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/cuda/CMakeLists.txt b/lib/CL/devices/cuda/CMakeLists.txt
++index 40068bd0..8c2ac843 100644
++--- a/lib/CL/devices/cuda/CMakeLists.txt
+++++ b/lib/CL/devices/cuda/CMakeLists.txt
++@@ -32,5 +32,5 @@ include_directories(${LLVM_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ${CMAKE_CURRENT_SO
++ add_pocl_device_library("pocl-devices-cuda" pocl-cuda.c pocl-cuda.h pocl-ptx-gen.cc pocl-ptx-gen.h)
++ target_compile_definitions("pocl-devices-cuda" PRIVATE "-DCUDA_TOOLKIT_ROOT_DIR=\"${CUDA_TOOLKIT_ROOT_DIR}\"")
++ if(ENABLE_LOADABLE_DRIVERS)
++-  target_link_libraries(pocl-devices-cuda PRIVATE cuda)
+++  target_link_libraries(pocl-devices-cuda PRIVATE cuda ${POCL_LLVM_LIBS} ${PTHREAD_LIBRARY})
++ endif()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7ad8c0c086f7d7f487b61efbc41b031bd5d0116f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++From 3c3ea9a2dfd7dc85aa5b48b1b26aa2bad1807d30 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 29 Nov 2021 21:08:29 +0100
++Subject: [PATCH 102/144] link libpocl-devices-hsa.so with -pthread
++
++---
++ lib/CL/devices/hsa/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/hsa/CMakeLists.txt b/lib/CL/devices/hsa/CMakeLists.txt
++index 483efb2d..3550d09b 100644
++--- a/lib/CL/devices/hsa/CMakeLists.txt
+++++ b/lib/CL/devices/hsa/CMakeLists.txt
++@@ -28,5 +28,5 @@ if(MSVC)
++ endif(MSVC)
++ add_pocl_device_library(pocl-devices-hsa pocl-hsa.c pocl-hsa.h)
++ if(ENABLE_LOADABLE_DRIVERS)
++-  target_link_libraries(pocl-devices-hsa PRIVATE ${HSALIB})
+++  target_link_libraries(pocl-devices-hsa PRIVATE ${HSALIB} ${PTHREAD_LIBRARY})
++ endif()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d1ebede59d3199296c17732614985fde6d4e990e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++From 902a01fd9688674106d375f208b268e12f15c374 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 10:44:09 +0100
++Subject: [PATCH 103/144] link libpocl-devices-ttasim.so with -pthread
++
++---
++ lib/CL/devices/tce/CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/lib/CL/devices/tce/CMakeLists.txt b/lib/CL/devices/tce/CMakeLists.txt
++index 4bf34b2e..597848da 100644
++--- a/lib/CL/devices/tce/CMakeLists.txt
+++++ b/lib/CL/devices/tce/CMakeLists.txt
++@@ -33,7 +33,7 @@ install(FILES "tta_device_main.c"
++ 
++ add_pocl_device_library(pocl-devices-ttasim tce_common.h tce_common.cc ttasim/ttasim.h ttasim/ttasim.cc)
++ if(ENABLE_LOADABLE_DRIVERS)
++-  target_link_libraries(pocl-devices-ttasim PRIVATE ${TCE_LIBS})
+++  target_link_libraries(pocl-devices-ttasim PRIVATE ${TCE_LIBS} ${PTHREAD_LIBRARY})
++ endif()
++ 
++ if(MSVC)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..770a59107d4e9658047af6a3473122f41ac30719
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++From 56b126c10a833ca97102a08cdd072ea408354294 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 29 Nov 2021 22:25:10 +0100
++Subject: [PATCH 105/144] hsa: check for clang -target hsail64
++
++---
++ cmake/HSA.cmake | 11 ++++++++++-
++ 1 file changed, 10 insertions(+), 1 deletion(-)
++
++diff --git a/cmake/HSA.cmake b/cmake/HSA.cmake
++index 08eb3ac9..4381461f 100644
++--- a/cmake/HSA.cmake
+++++ b/cmake/HSA.cmake
++@@ -32,7 +32,16 @@ else()
++   if(RESULT)
++     message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
++   endif()
++-  set(HSAIL_ENABLED 1)
+++  # test that Clang supports the hsail64 target
+++  message(CHECK_START "Check if Clang accepts -target hsail64")
+++  custom_try_compile_clangxx("" "return 0;" RESULT "-target" "hsail64" "-emit-llvm" "-S")
+++  if(RESULT)
+++    message(CHECK_FAIL "no")
+++    set(HSAIL_ENABLED 0)
+++  else()
+++    message(CHECK_PASS "yes")
+++    set(HSAIL_ENABLED 1)
+++  endif()
++ endif()
++ 
++ if (NOT DEFINED AMD_HSA)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b2a6fa00769df38e3e4d838ce496bf9d077456c0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,38 @@@
++From 8198facb7b3a1991a1559a88a9ababb583c45dfe Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 30 Nov 2021 14:15:21 +0100
++Subject: [PATCH 106/144] hsa: check for clang -target amdgcn--amdhsa -nogpulib
++
++---
++ cmake/HSA.cmake | 13 ++++++++++++-
++ 1 file changed, 12 insertions(+), 1 deletion(-)
++
++diff --git a/cmake/HSA.cmake b/cmake/HSA.cmake
++index 4381461f..aba27210 100644
++--- a/cmake/HSA.cmake
+++++ b/cmake/HSA.cmake
++@@ -28,9 +28,20 @@ if (DEFINED ENABLE_HSAIL AND NOT ENABLE_HSAIL)
++ else()
++   message(STATUS "Trying HSA support in LLVM")
++   # test that Clang supports the amdgcn--amdhsa target
+++  message(CHECK_START "Check if Clang accepts -target amdgcn--amdhsa")
++   custom_try_compile_clangxx("" "return 0;" RESULT "-target" "amdgcn--amdhsa" "-emit-llvm" "-S")
++   if(RESULT)
++-    message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
+++    message(CHECK_FAIL "no")
+++    message(CHECK_START "Check if Clang accepts -target amdgcn--amdhsa -nogpulib")
+++    custom_try_compile_clangxx("" "return 0;" RESULT "-target" "amdgcn--amdhsa" "-nogpulib" "-emit-llvm" "-S")
+++    if(RESULT)
+++      message(CHECK_FAIL "no")
+++      message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
+++    else()
+++      message(CHECK_PASS "yes")
+++    endif()
+++  else()
+++    message(CHECK_PASS "yes")
++   endif()
++   # test that Clang supports the hsail64 target
++   message(CHECK_START "Check if Clang accepts -target hsail64")
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4be68063d62461446909ff5f0c2c327d2b312a98
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,27 @@@
++From 8c07721d0ddcf0433af3e89f28d4a5d4b0aa1d99 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 19:39:05 +0100
++Subject: [PATCH 107/144] check for .git/rebase-merge to detect ongoing git
++ rebase
++
++.git/ORIG_HEAD may be a stale file
++---
++ tools/scripts/format-last-commit.sh | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/tools/scripts/format-last-commit.sh b/tools/scripts/format-last-commit.sh
++index d1414e48..5bd5e78f 100755
++--- a/tools/scripts/format-last-commit.sh
+++++ b/tools/scripts/format-last-commit.sh
++@@ -28,7 +28,7 @@ if [ "$REPLY" == "y" ]; then
++ 
++   git commit --amend
++ 
++-  if [ -e .git/ORIG_HEAD ]; then
+++  if [ -d .git/rebase-merge ]; then
++ 
++     git rebase --continue
++ 
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..07e2eacd89538b217f13061d36092e6d2c731850
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,47 @@@
++From fe4d63e2e658e30341a60b5584270e6109f392fa Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 19:43:40 +0100
++Subject: [PATCH 108/144] do not reformat if there are uncommitted changes
++
++---
++ tools/scripts/format-branch.sh      | 6 ++++++
++ tools/scripts/format-last-commit.sh | 6 ++++++
++ 2 files changed, 12 insertions(+)
++
++diff --git a/tools/scripts/format-branch.sh b/tools/scripts/format-branch.sh
++index b1bcf8f9..fe532dce 100755
++--- a/tools/scripts/format-branch.sh
+++++ b/tools/scripts/format-branch.sh
++@@ -5,6 +5,12 @@ if [ ! -e .git ]; then
++   exit 1
++ fi
++ 
+++case "$(git describe --always --dirty=-DIRTY)" in
+++  *-DIRTY)
+++    echo "There are uncommitted changes - aborting."
+++    exit 1
+++esac
+++
++ PATCHY=/tmp/p.patch
++ 
++ rm -f $PATCHY
++diff --git a/tools/scripts/format-last-commit.sh b/tools/scripts/format-last-commit.sh
++index 5bd5e78f..3040b93f 100755
++--- a/tools/scripts/format-last-commit.sh
+++++ b/tools/scripts/format-last-commit.sh
++@@ -5,6 +5,12 @@ if [ ! -e .git ]; then
++   exit 1
++ fi
++ 
+++case "$(git describe --always --dirty=-DIRTY)" in
+++  *-DIRTY)
+++    echo "There are uncommitted changes - aborting."
+++    exit 1
+++esac
+++
++ PATCHY=/tmp/p.patch
++ 
++ rm -f $PATCHY
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..477e0906d2f9e9e2ed2e2420f10856769be18e29
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,45 @@@
++From ea177ceff6f75b656b69515387fce896c8fcc266 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 19:48:36 +0100
++Subject: [PATCH 109/144] use proper tempfiles
++
++---
++ tools/scripts/format-branch.sh      | 4 ++--
++ tools/scripts/format-last-commit.sh | 4 ++--
++ 2 files changed, 4 insertions(+), 4 deletions(-)
++
++diff --git a/tools/scripts/format-branch.sh b/tools/scripts/format-branch.sh
++index fe532dce..836aef04 100755
++--- a/tools/scripts/format-branch.sh
+++++ b/tools/scripts/format-branch.sh
++@@ -11,9 +11,9 @@ case "$(git describe --always --dirty=-DIRTY)" in
++     exit 1
++ esac
++ 
++-PATCHY=/tmp/p.patch
+++PATCHY=$(mktemp /tmp/pocl.XXXXXXXX.patch)
+++trap "rm -f $PATCHY" EXIT
++ 
++-rm -f $PATCHY
++ git diff master -U0 --no-color >$PATCHY
++ 
++ SCRIPTPATH=$( realpath "$0"  )
++diff --git a/tools/scripts/format-last-commit.sh b/tools/scripts/format-last-commit.sh
++index 3040b93f..b0ab124a 100755
++--- a/tools/scripts/format-last-commit.sh
+++++ b/tools/scripts/format-last-commit.sh
++@@ -11,9 +11,9 @@ case "$(git describe --always --dirty=-DIRTY)" in
++     exit 1
++ esac
++ 
++-PATCHY=/tmp/p.patch
+++PATCHY=$(mktemp /tmp/pocl.XXXXXXXX.patch)
+++trap "rm -f $PATCHY" EXIT
++ 
++-rm -f $PATCHY
++ git show -U0 --no-color >$PATCHY
++ 
++ SCRIPTPATH=$( realpath "$0"  )
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6f93570ee516077ce88d8337a8a059ff1c2cbecf
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From 7864ff8676f255aff86938a987c7f4f812756529 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 1 Dec 2021 21:42:38 +0100
++Subject: [PATCH 110/144] exit early if reformatting produced no changes
++
++---
++ tools/scripts/format-last-commit.sh | 5 +++++
++ 1 file changed, 5 insertions(+)
++
++diff --git a/tools/scripts/format-last-commit.sh b/tools/scripts/format-last-commit.sh
++index b0ab124a..4c48e998 100755
++--- a/tools/scripts/format-last-commit.sh
+++++ b/tools/scripts/format-last-commit.sh
++@@ -22,6 +22,11 @@ RELPATH=$(dirname "$SCRIPTPATH")
++ $RELPATH/clang-format-diff.py -regex '.*(\.h$|\.c$|\.cl$)' -i -p1 -style GNU <$PATCHY
++ $RELPATH/clang-format-diff.py -regex '(.*(\.hh$|\.cc$))|(lib/llvmopencl/.*\.h)' -i -p1 -style LLVM <$PATCHY
++ 
+++if [ -z "$(git diff)" ]; then
+++  echo "No changes."
+++  exit 0
+++fi
+++
++ git diff
++ 
++ echo "ACCEPT CHANGES ?"
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..443e199200a9748d42c13b1978b99cd0cad5a5f5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,135 @@@
++From 7eaf167967d1f784d567dceab0adf1e1f890cfb6 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Fri, 3 Dec 2021 01:55:51 +0100
++Subject: [PATCH 111/144] import clang-format-diff.py from clang-13
++
++---
++ tools/scripts/clang-format-diff.py | 59 +++++++++++++++++-------------
++ 1 file changed, 33 insertions(+), 26 deletions(-)
++
++diff --git a/tools/scripts/clang-format-diff.py b/tools/scripts/clang-format-diff.py
++index d6d35104..ea483f59 100755
++--- a/tools/scripts/clang-format-diff.py
+++++ b/tools/scripts/clang-format-diff.py
++@@ -1,25 +1,25 @@
++-#!/usr/bin/env python
+++#!/usr/bin/env python3
++ #
++ #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
++ #
++-#                     The LLVM Compiler Infrastructure
++-#
++-# This file is distributed under the University of Illinois Open Source
++-# License. See LICENSE.TXT for details.
+++# 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
++ #
++ #===------------------------------------------------------------------------===#
++ 
++-r"""
++-ClangFormat Diff Reformatter
++-============================
++-
+++"""
++ This script reads input from a unified diff and reformats all the changed
++ lines. This is useful to reformat all the lines touched by a specific patch.
++ Example usage for git/svn users:
++ 
++-  git diff -U0 --no-color HEAD^ | clang-format-diff.py -p1 -i
+++  git diff -U0 --no-color --relative HEAD^ | clang-format-diff.py -p1 -i
++   svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
++ 
+++It should be noted that the filename contained in the diff is used unmodified
+++to determine the source file to update. Users calling this script directly
+++should be careful to ensure that the path in the diff is correct relative to the
+++current working directory.
++ """
++ from __future__ import absolute_import, division, print_function
++ 
++@@ -36,10 +36,9 @@ else:
++ 
++ 
++ def main():
++-  parser = argparse.ArgumentParser(description=
++-                                   'Reformat changed lines in diff. Without -i '
++-                                   'option just output the diff that would be '
++-                                   'introduced.')
+++  parser = argparse.ArgumentParser(description=__doc__,
+++                                   formatter_class=
+++                                           argparse.RawDescriptionHelpFormatter)
++   parser.add_argument('-i', action='store_true', default=False,
++                       help='apply edits to files instead of displaying a diff')
++   parser.add_argument('-p', metavar='NUM', default=0,
++@@ -48,8 +47,8 @@ def main():
++                       help='custom pattern selecting file paths to reformat '
++                       '(case sensitive, overrides -iregex)')
++   parser.add_argument('-iregex', metavar='PATTERN', default=
++-                      r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc|js|ts|proto'
++-                      r'|protodevel|java)',
+++                      r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|hxx|m|mm|inc|js|ts'
+++                      r'|proto|protodevel|java|cs|json)',
++                       help='custom pattern selecting file paths to reformat '
++                       '(case insensitive, overridden by -regex)')
++   parser.add_argument('-sort-includes', action='store_true', default=False,
++@@ -57,8 +56,8 @@ def main():
++   parser.add_argument('-v', '--verbose', action='store_true',
++                       help='be more verbose, ineffective without -i')
++   parser.add_argument('-style',
++-                      help='formatting style to apply (LLVM, Google, Chromium, '
++-                      'Mozilla, WebKit)')
+++                      help='formatting style to apply (LLVM, GNU, Google, Chromium, '
+++                      'Microsoft, Mozilla, WebKit)')
++   parser.add_argument('-binary', default='clang-format',
++                       help='location of binary to use for clang-format')
++   args = parser.parse_args()
++@@ -67,10 +66,10 @@ def main():
++   filename = None
++   lines_by_file = {}
++   for line in sys.stdin:
++-    match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
+++    match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
++     if match:
++       filename = match.group(2)
++-    if filename == None:
+++    if filename is None:
++       continue
++ 
++     if args.regex is not None:
++@@ -80,7 +79,7 @@ def main():
++       if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
++         continue
++ 
++-    match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
+++    match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
++     if match:
++       start_line = int(match.group(1))
++       line_count = 1
++@@ -104,11 +103,19 @@ def main():
++     command.extend(lines)
++     if args.style:
++       command.extend(['-style', args.style])
++-    p = subprocess.Popen(command,
++-                         stdout=subprocess.PIPE,
++-                         stderr=None,
++-                         stdin=subprocess.PIPE,
++-                         universal_newlines=True)
+++
+++    try:
+++      p = subprocess.Popen(command,
+++                           stdout=subprocess.PIPE,
+++                           stderr=None,
+++                           stdin=subprocess.PIPE,
+++                           universal_newlines=True)
+++    except OSError as e:
+++      # Give the user more context when clang-format isn't
+++      # found/isn't executable, etc.
+++      raise RuntimeError(
+++        'Failed to run "%s" - %s"' % (" ".join(command), e.strerror))
+++
++     stdout, stderr = p.communicate()
++     if p.returncode != 0:
++       sys.exit(p.returncode)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8d2d5da4e54398823473a050a44d4d7271f974f5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++From 0fe64a346b4d518b2c1ac68e5a2063509544f69a Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 8 Dec 2021 10:56:57 +0100
++Subject: [PATCH 113/144] drop irrelevant metadata causing warnings on non-x86
++
++fixes: #1006
++---
++ lib/kernel/addrspace_operators.ll | 6 +-----
++ 1 file changed, 1 insertion(+), 5 deletions(-)
++
++diff --git a/lib/kernel/addrspace_operators.ll b/lib/kernel/addrspace_operators.ll
++index cd766c8e..f9ddde8b 100644
++--- a/lib/kernel/addrspace_operators.ll
+++++ b/lib/kernel/addrspace_operators.ll
++@@ -1,7 +1,4 @@
++-; ModuleID = 'test.bc'
++-source_filename = "test.c"
++ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
++-target triple = "x86_64-pc-linux-gnu"
++ 
++ define dso_local i8 addrspace(3)* @__to_local(i8 addrspace(4)* %address) local_unnamed_addr #0 {
++   %1 = addrspacecast i8 addrspace(4)* %address to i8 addrspace(3)*
++@@ -18,7 +15,6 @@ define dso_local i8* @__to_private(i8 addrspace(4)* %address) local_unnamed_addr
++   ret i8* %1
++ }
++ 
++-attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+++attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
++ 
++ !0 = !{i32 1, !"wchar_size", i32 4}
++-!1 = !{!"clang version 8.0.1- (branches/release_80)"}
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..00d9110b9940cad7c16796be30e3edaa776bdf81
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,68 @@@
++From 9c0f812d3f73e7f4c52e95f30b2b215ed8fec859 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 8 Dec 2021 23:32:53 +0100
++Subject: [PATCH 114/144] do not build libllvmopencl.so by default, no longer
++ used since 0.14
++
++---
++ CMakeLists.txt                | 2 +-
++ lib/llvmopencl/CMakeLists.txt | 7 +++++++
++ 2 files changed, 8 insertions(+), 1 deletion(-)
++
++diff --git a/CMakeLists.txt b/CMakeLists.txt
++index 82eca451..7400b3b4 100644
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -349,7 +349,7 @@ endif()
++ # for libpocl.so
++ set(POCL_INSTALL_PUBLIC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "POCL public libdir")
++ 
++-# for llvmopencl.so
+++# for libpocl-devices-*.so
++ set(POCL_INSTALL_PRIVATE_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pocl" CACHE PATH "POCL private libdir")
++ 
++ # for pocl.icd
++diff --git a/lib/llvmopencl/CMakeLists.txt b/lib/llvmopencl/CMakeLists.txt
++index c106b0f2..44211a15 100644
++--- a/lib/llvmopencl/CMakeLists.txt
+++++ b/lib/llvmopencl/CMakeLists.txt
++@@ -101,6 +101,8 @@ endif(MSVC)
++ add_library("llvmpasses" OBJECT ${LLVMPASSES_SOURCES})
++ harden("llvmpasses")
++ 
+++option(ENABLE_LIBLLVMOPENCL "Build separate libllvmopencl.so for use with 'opt'" OFF)
+++if(ENABLE_LIBLLVMOPENCL)
++ # This creates a separate llvmopencl.so that is loaded to 'opt'
++ # for the pocl-workgroup version.
++ #pkglib_LTLIBRARIES = llvmopencl.la
++@@ -114,6 +116,7 @@ if(MSVC)
++ endif(MSVC)
++ 
++ #target_link_libraries("llvmopencl" "${LLVM_SYSLIBS}")
+++endif(ENABLE_LIBLLVMOPENCL)
++  
++ # TODO cmake should handle this, i might me missing something â€¦
++ if(APPLE)
++@@ -122,6 +125,7 @@ else()
++   set(ADD_LD_FLAGS "-Wl,-export-dynamic")
++ endif()
++ 
+++if(ENABLE_LIBLLVMOPENCL)
++ # TODO ENABLE_EXPORTS -> Wl,export_dynamic
++ # https://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:ENABLE_EXPORTS
++ # https://www.cmake.org/pipermail/cmake/2011-November/047708.html
++@@ -136,8 +140,11 @@ install(TARGETS "llvmopencl"
++         ARCHIVE DESTINATION ${POCL_INSTALL_PRIVATE_LIBDIR}/static
++         COMPONENT "dev"
++ )
+++endif(ENABLE_LIBLLVMOPENCL)
++ 
++ if(ENABLE_IPO)
++   set_property(TARGET "llvmpasses" PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+++if(ENABLE_LIBLLVMOPENCL)
++   set_property(TARGET "llvmopencl" PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+++endif(ENABLE_LIBLLVMOPENCL)
++ endif()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b81eb2321bd61184493c8ca42b3c7b36a142f553
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,42 @@@
++From 045c7092706ae1ca5f8995abad828825d15483c4 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 9 Dec 2021 00:11:32 +0100
++Subject: [PATCH 115/144] add a copy of the Boost license for sleef
++
++---
++ lib/kernel/sleef/LICENSE.txt | 23 +++++++++++++++++++++++
++ 1 file changed, 23 insertions(+)
++ create mode 100644 lib/kernel/sleef/LICENSE.txt
++
++diff --git a/lib/kernel/sleef/LICENSE.txt b/lib/kernel/sleef/LICENSE.txt
++new file mode 100644
++index 00000000..36b7cd93
++--- /dev/null
+++++ b/lib/kernel/sleef/LICENSE.txt
++@@ -0,0 +1,23 @@
+++Boost Software License - Version 1.0 - August 17th, 2003
+++
+++Permission is hereby granted, free of charge, to any person or organization
+++obtaining a copy of the software and accompanying documentation covered by
+++this license (the "Software") to use, reproduce, display, distribute,
+++execute, and transmit the Software, and to prepare derivative works of the
+++Software, and to permit third-parties to whom the Software is furnished to
+++do so, all subject to the following:
+++
+++The copyright notices in the Software and this entire statement, including
+++the above license grant, this restriction and the following disclaimer,
+++must be included in all copies of the Software, in whole or in part, and
+++all derivative works of the Software, unless such copies or derivative
+++works are solely in the form of machine-executable object code generated by
+++a source language processor.
+++
+++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+++FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+++SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+++FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+++ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+++DEALINGS IN THE SOFTWARE.
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5309887d86d9831869428c8f48edcc9faaacabc1
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,77 @@@
++From 7ff573788485c0ed0d64831b4e942ec069c839e8 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 9 Dec 2021 00:17:03 +0100
++Subject: [PATCH 116/144] add a copy of the ROCm-Device-Libs license (NCSA) for
++ ocml
++
++---
++ lib/kernel/ocml/LICENSE.TXT | 43 +++++++++++++++++++++++++++++++++++++
++ lib/kernel/ocml/README      |  4 ++--
++ 2 files changed, 45 insertions(+), 2 deletions(-)
++ create mode 100644 lib/kernel/ocml/LICENSE.TXT
++
++diff --git a/lib/kernel/ocml/LICENSE.TXT b/lib/kernel/ocml/LICENSE.TXT
++new file mode 100644
++index 00000000..bcfb226f
++--- /dev/null
+++++ b/lib/kernel/ocml/LICENSE.TXT
++@@ -0,0 +1,43 @@
+++==============================================================================
+++ROCm-Device-Libs Release License
+++==============================================================================
+++University of Illinois/NCSA
+++Open Source License
+++
+++Copyright (c) 2014-2016, Advanced Micro Devices, Inc.
+++All rights reserved.
+++
+++Developed by:
+++
+++    AMD Research and AMD HSA Software Development
+++
+++    Advanced Micro Devices, Inc.
+++
+++    www.amd.com
+++
+++Permission is hereby granted, free of charge, to any person obtaining a copy of
+++this software and associated documentation files (the "Software"), to deal with
+++the Software without restriction, including without limitation the rights to
+++use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+++of the Software, and to permit persons to whom the Software is furnished to do
+++so, subject to the following conditions:
+++
+++    * Redistributions of source code must retain the above copyright notice,
+++      this list of conditions and the following disclaimers.
+++
+++    * Redistributions in binary form must reproduce the above copyright notice,
+++      this list of conditions and the following disclaimers in the
+++      documentation and/or other materials provided with the distribution.
+++
+++    * Neither the names of the LLVM Team, University of Illinois at
+++      Urbana-Champaign, nor the names of its contributors may be used to
+++      endorse or promote products derived from this Software without specific
+++      prior written permission.
+++
+++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+++FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+++CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+++SOFTWARE.
++diff --git a/lib/kernel/ocml/README b/lib/kernel/ocml/README
++index 1c549d49..630e177d 100644
++--- a/lib/kernel/ocml/README
+++++ b/lib/kernel/ocml/README
++@@ -1,6 +1,6 @@
++-This is a partial mirror copy of
+++This is a partial mirror copy of the ocml subtree from
++ 
++-  https://github.com/RadeonOpenCompute/ROCm-Device-Libs/ocml
+++  https://github.com/RadeonOpenCompute/ROCm-Device-Libs
++ 
++ Its purpose is to make it easy for device drivers to utilize
++ these builtin implementations if desired.
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3f934125a95a5b07aa11dfbc76a5c636be048e54
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,69 @@@
++From 69e1f86306d1a7741b0396a36e1a5a060051d3e8 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 9 Dec 2021 00:35:56 +0100
++Subject: [PATCH 117/144] drop the "clangxx works" check from the vecmathlib
++ age
++
++---
++ cmake/LLVM.cmake | 45 ---------------------------------------------
++ 1 file changed, 45 deletions(-)
++
++diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
++index 2aa4d923..926b9776 100644
++--- a/cmake/LLVM.cmake
+++++ b/cmake/LLVM.cmake
++@@ -574,51 +574,6 @@ ${TYPEDEF}" "typedef struct { char x; ${TYPE} y; } ac__type_alignof_;
++ 
++ endmacro()
++ 
++-####################################################################
++-#
++-# clangxx works check 
++-#
++-
++-# TODO clang + vecmathlib doesn't work on Windows yet...
++-if(CLANGXX AND (NOT WIN32) AND ENABLE_HOST_CPU_DEVICES)
++-
++-  message(STATUS "Checking if clang++ works (required by vecmathlib)")
++-
++-  set(CXX_WORKS 0)
++-  set(CXX_STDLIB "")
++-
++-  if(NOT DEFINED CLANGXX_WORKS)
++-
++-    custom_try_compile_clangxx("namespace std { class type_info; } \n  #include <iostream> \n  #include <type_traits>" "std::cout << \"Hello clang++ world!\" << std::endl;" _STATUS_FAIL "-std=c++11")
++-
++-    if(NOT _STATUS_FAIL)
++-      set(CXX_WORKS 1)
++-    else()
++-      custom_try_compile_clangxx("namespace std { class type_info; } \n  #include <iostream> \n  #include <type_traits>" "std::cout << \"Hello clang++ world!\" << std::endl;" _STATUS_FAIL "-stdlib=libstdc++" "-std=c++11")
++-      if (NOT _STATUS_FAIL)
++-        set(CXX_STDLIB "-stdlib=libstdc++")
++-        set(CXX_WORKS 1)
++-      else()
++-        custom_try_compile_clangxx("namespace std { class type_info; } \n  #include <iostream> \n  #include <type_traits>" "std::cout << \"Hello clang++ world!\" << std::endl;" _STATUS_FAIL "-stdlib=libc++" "-std=c++11")
++-        if(NOT _STATUS_FAIL)
++-          set(CXX_STDLIB "-stdlib=libc++")
++-          set(CXX_WORKS 1)
++-        endif()
++-      endif()
++-    endif()
++-
++-    set(CLANGXX_WORKS ${CXX_WORKS} CACHE INTERNAL "Clang++ ")
++-    set(CLANGXX_STDLIB ${CXX_STDLIB} CACHE INTERNAL "Clang++ stdlib")
++-  endif()
++-
++-
++-endif()
++-
++-if(CLANGXX_STDLIB AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
++-  set(LLVM_CXXFLAGS "${CLANGXX_STDLIB} ${LLVM_CXXFLAGS}")
++-  set(LLVM_LDFLAGS "${CLANGXX_STDLIB} ${LLVM_LDFLAGS}")
++-endif()
++-
++ ####################################################################
++ #
++ # - '-DNDEBUG' is a work-around for llvm bug 18253
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..85b48590eea69553debe53cb601dcc6a77a2aa02
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++From 1887b34009c557f2de3c2bf4c3069c24d72331a5 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 9 Dec 2021 00:45:45 +0100
++Subject: [PATCH 118/144] cmake policy CMP0025 was introduced in CMake 3.0
++
++---
++ CMakeLists.txt | 5 -----
++ 1 file changed, 5 deletions(-)
++
++diff --git a/CMakeLists.txt b/CMakeLists.txt
++index 7400b3b4..b675d29a 100644
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -38,11 +38,6 @@ else()
++      set(CMAKE_CXX_STANDARD "${SUPPORTED_CXX_STD_VERSION}")
++ endif()
++ 
++-# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
++-if(POLICY CMP0025)
++-  cmake_policy(SET CMP0025 NEW)
++-endif()
++-
++ include(CheckCCompilerFlag)
++ include(CPackComponent)
++ macro(pass_through_cpack_vars)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..88af5a6067ba68500c72b5268900218f78946d91
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,128 @@@
++From ab0d3dc60fca348a3e7c1595a936fc06d63490f3 Mon Sep 17 00:00:00 2001
++From: Tom Rix <trix@redhat.com>
++Date: Sat, 1 Jan 2022 10:30:55 -0500
++Subject: [PATCH 122/144] llvm 13: handle deprecated CreateLoad
++
++As of llvm 13, CreateLoad prefers to have a type arguement as it's
++first parameter, deprecating the old api.
++
++For readablity, seperated out the CreateConstGEP* calls which have
++a similar deprecation.
++
++Signed-off-by: Tom Rix <trix@redhat.com>
++---
++ lib/llvmopencl/ParallelRegion.cc | 27 ++++++++++++++++++---------
++ lib/llvmopencl/Workgroup.cc      | 23 ++++++++++++++---------
++ 2 files changed, 32 insertions(+), 18 deletions(-)
++
++diff --git a/lib/llvmopencl/ParallelRegion.cc b/lib/llvmopencl/ParallelRegion.cc
++index 793db704..c4654288 100644
++--- a/lib/llvmopencl/ParallelRegion.cc
+++++ b/lib/llvmopencl/ParallelRegion.cc
++@@ -622,9 +622,12 @@ ParallelRegion::LocalIDZLoad()
++ {
++   if (LocalIDZLoadInstr != NULL) return LocalIDZLoadInstr;
++   IRBuilder<> builder(&*(entryBB()->getFirstInsertionPt()));
++-  return LocalIDZLoadInstr =
++-    builder.CreateLoad
++-    (entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_Z_GLOBAL));
+++  Value *Ptr = entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_Z_GLOBAL);
+++  return LocalIDZLoadInstr = builder.CreateLoad(
+++#ifndef LLVM_OLDER_THAN_13_0
+++    Ptr->getType()->getPointerElementType(),
+++#endif
+++    Ptr);
++ }
++ 
++ /**
++@@ -636,9 +639,12 @@ ParallelRegion::LocalIDYLoad()
++ {
++   if (LocalIDYLoadInstr != NULL) return LocalIDYLoadInstr;
++   IRBuilder<> builder(&*(entryBB()->getFirstInsertionPt()));
++-  return LocalIDYLoadInstr = 
++-    builder.CreateLoad
++-    (entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_Y_GLOBAL));
+++  Value *Ptr = entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_Y_GLOBAL);
+++  return LocalIDYLoadInstr = builder.CreateLoad(
+++#ifndef LLVM_OLDER_THAN_13_0
+++    Ptr->getType()->getPointerElementType(),
+++#endif
+++    Ptr);
++ }
++ 
++ /**
++@@ -650,9 +656,12 @@ ParallelRegion::LocalIDXLoad()
++ {
++   if (LocalIDXLoadInstr != NULL) return LocalIDXLoadInstr;
++   IRBuilder<> builder(&*(entryBB()->getFirstInsertionPt()));
++-  return LocalIDXLoadInstr = 
++-    builder.CreateLoad
++-    (entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_X_GLOBAL));
+++  Value *Ptr = entryBB()->getParent()->getParent()->getGlobalVariable(POCL_LOCAL_ID_X_GLOBAL);
+++  return LocalIDXLoadInstr = builder.CreateLoad(
+++#ifndef LLVM_OLDER_THAN_13_0
+++    Ptr->getType()->getPointerElementType(),
+++#endif
+++    Ptr);
++ }
++ 
++ void
++diff --git a/lib/llvmopencl/Workgroup.cc b/lib/llvmopencl/Workgroup.cc
++index f71c8bc5..b29e81a3 100644
++--- a/lib/llvmopencl/Workgroup.cc
+++++ b/lib/llvmopencl/Workgroup.cc
++@@ -405,7 +405,7 @@ llvm::Value *
++ Workgroup::createLoadFromContext(
++   IRBuilder<> &Builder, int StructFieldIndex, int FieldIndex=-1) {
++ 
++-  Value *GEP;
+++  Value *GEP, *Ptr;
++   Type *ContextType = ContextArg->getType()->getPointerElementType();
++   GEP = Builder.CreateStructGEP(ContextType, ContextArg, StructFieldIndex);
++   Type *GEPType = GEP->getType()->getPointerElementType();
++@@ -413,29 +413,34 @@ Workgroup::createLoadFromContext(
++   llvm::LoadInst *Load = nullptr;
++   if (SizeTWidth == 64) {
++     if (FieldIndex == -1)
++-      Load = Builder.CreateLoad(Builder.CreateConstGEP1_64(
+++      Ptr = Builder.CreateConstGEP1_64(
++ #ifndef LLVM_OLDER_THAN_13_0
++           GEPType,
++ #endif
++-          GEP, 0));
+++          GEP, 0);
++     else
++-      Load = Builder.CreateLoad(Builder.CreateConstGEP2_64(
+++      Ptr = Builder.CreateConstGEP2_64(
++ #ifndef LLVM_OLDER_THAN_13_0
++           GEPType,
++ #endif
++-          GEP, 0, FieldIndex));
+++          GEP, 0, FieldIndex);
++   } else {
++     if (FieldIndex == -1)
++-      Load = Builder.CreateLoad(Builder.CreateConstGEP1_32(
+++      Ptr = Builder.CreateConstGEP1_32(
++ #ifndef LLVM_OLDER_THAN_13_0
++           GEPType,
++ #endif
++-          GEP, 0));
+++          GEP, 0);
++     else
++-      Load = Builder.CreateLoad(Builder.CreateConstGEP2_32(
+++      Ptr = Builder.CreateConstGEP2_32(
++           GEPType,
++-          GEP, 0, FieldIndex));
+++          GEP, 0, FieldIndex);
++   }
+++  Load = Builder.CreateLoad(
+++#ifndef LLVM_OLDER_THAN_13_0
+++       Ptr->getType()->getPointerElementType(),
+++#endif
+++       Ptr);
++   addRangeMetadataForPCField(Load, StructFieldIndex, FieldIndex);
++   return Load;
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3f5ec8426ff0eacbabf4871d030fb1a980120192
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++From 53d7e776e3a44538d12fb41d18ee5cb348a29887 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 9 Dec 2021 17:20:31 +0100
++Subject: [PATCH 127/144] really enable VISIBILITY_HIDDEN by default
++
++---
++ CMakeLists.txt | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/CMakeLists.txt b/CMakeLists.txt
++index b675d29a..51276c9f 100644
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -199,7 +199,7 @@ if (ENABLE_PROXY_DEVICE)
++ else()
++   set(VISIBILITY_HIDDEN_DEFAULT ON)
++ endif()
++-option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" VISIBILITY_HIDDEN_DEFAULT)
+++option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" ${VISIBILITY_HIDDEN_DEFAULT})
++ if(VISIBILITY_HIDDEN)
++   add_compile_options(-fvisibility=hidden)
++   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fvisibility-inlines-hidden>)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..76cba07b72c6f788a8f5f78927ca31430429500d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,41 @@@
++From 2ca9d89cd8b2860591c8f5bcdf78da85776023a2 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 16 Dec 2021 16:06:14 +0100
++Subject: [PATCH 128/144] add POCL_EXPORT to additional symbols needed by the
++ vulkan device
++
++---
++ include/pocl_cache.h | 3 +++
++ 2 files changed, 5 insertions(+)
++
++diff --git a/include/pocl_cache.h b/include/pocl_cache.h
++index 18601e8c..f3678b8b 100644
++--- a/include/pocl_cache.h
+++++ b/include/pocl_cache.h
++@@ -38,6 +38,7 @@ extern "C" {
++ 
++ int pocl_cache_init_topdir ();
++ 
+++POCL_EXPORT
++ int
++ pocl_cache_create_program_cachedir(cl_program program, unsigned device_i,
++                                    const char* preprocessed_source, size_t source_len,
++@@ -45,6 +46,7 @@ pocl_cache_create_program_cachedir(cl_program program, unsigned device_i,
++ 
++ void pocl_cache_cleanup_cachedir(cl_program program);
++ 
+++POCL_EXPORT
++ int pocl_cache_tempname (char *path_template, const char *suffix, int *fd);
++ 
++ int pocl_cache_create_tempdir(char* path);
++@@ -107,6 +109,7 @@ void pocl_cache_kernel_cachedir (char *kernel_cachedir_path,
++ 
++ // these two required by llvm API
++ 
+++POCL_EXPORT
++ void pocl_cache_program_bc_path(char*       program_bc_path,
++                                cl_program   program,
++                                unsigned     device_i);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..28d3f24646ed185bd82d941e8e4032df462576a2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,417 @@@
++From 4e2d3327f35837b0eab05e2e8b6c007c14b5113b Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 23 Nov 2021 18:03:10 +0100
++Subject: [PATCH 130/144] tests: use EXIT_SUCCESS/EXIT_FAILURE in most tests
++
++---
++ tests/kernel/image_query_funcs.c                 |  2 +-
++ tests/kernel/kernel.c                            |  3 +--
++ tests/kernel/sampler_address_clamp.c             |  4 ++--
++ .../test_alignment_with_dynamic_wg.cpp           | 10 +++++-----
++ .../test_alignment_with_dynamic_wg2.cpp          |  2 ++
++ .../test_alignment_with_dynamic_wg3.cpp          |  9 +++++----
++ ...ign_loop_variable_to_privvar_makes_it_local.c |  8 +++++++-
++ tests/regression/test_flatten_barrier_subs.cpp   |  3 ++-
++ tests/regression/test_issue_231.cpp              |  2 ++
++ tests/regression/test_issue_445.cpp              | 12 ++++++++++--
++ tests/regression/test_issue_553.cpp              |  2 ++
++ tests/regression/test_issue_577.cpp              |  4 ++--
++ tests/regression/test_locals.cpp                 |  8 +++++---
++ .../test_program_from_binary_with_local_1_1_1.c  |  5 +++--
++ tests/runtime/test_clCreateKernel.c              |  5 +----
++ tests/runtime/test_clCreateSubDevices.c          |  4 +---
++ tests/runtime/test_enqueue_kernel_from_binary.c  | 16 +++++++++-------
++ tests/runtime/test_fill-buffer.c                 |  6 +++---
++ tests/runtime/test_kernel_cache_includes.c       |  2 +-
++ tests/workgroup/run_kernel.c                     |  6 +++++-
++ 20 files changed, 69 insertions(+), 44 deletions(-)
++
++diff --git a/tests/kernel/image_query_funcs.c b/tests/kernel/image_query_funcs.c
++index 464299ef..7a9734e9 100644
++--- a/tests/kernel/image_query_funcs.c
+++++ b/tests/kernel/image_query_funcs.c
++@@ -139,5 +139,5 @@ int main(int argc, char **argv)
++   free (imageData);
++ 
++   printf("OK\n");
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/kernel/kernel.c b/tests/kernel/kernel.c
++index 834505a2..25dd4d53 100644
++--- a/tests/kernel/kernel.c
+++++ b/tests/kernel/kernel.c
++@@ -166,6 +166,5 @@ int main(int argc, char **argv)
++     printf("OK\n");
++   fflush(stdout);
++   fflush(stderr);
++-  return (retval ? 1 : 0);
+++  return (retval ? EXIT_FAILURE : EXIT_SUCCESS);
++ }
++-
++diff --git a/tests/kernel/sampler_address_clamp.c b/tests/kernel/sampler_address_clamp.c
++index 68a691cb..347249a4 100644
++--- a/tests/kernel/sampler_address_clamp.c
+++++ b/tests/kernel/sampler_address_clamp.c
++@@ -182,9 +182,9 @@ error:
++   if (retval) 
++     {
++       printf("FAIL\n");
++-      return 1;
+++      return EXIT_FAILURE;
++     }
++  
++   printf("OK\n");
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_alignment_with_dynamic_wg.cpp b/tests/regression/test_alignment_with_dynamic_wg.cpp
++index 65b5d665..ae1b429d 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg.cpp
++@@ -112,7 +112,7 @@ int main(int argc, char *argv[]) {
++ 
++   if (argc < 4) {
++     std::cout << "USAGE: $0 X Y Z\n";
++-    return 1;
+++    return EXIT_FAILURE;
++   }
++ 
++   std::string arg_x(argv[1]);
++@@ -124,13 +124,13 @@ int main(int argc, char *argv[]) {
++   unsigned z = std::stoi(argv[3]);
++ 
++   if (!test_invocation(x, y, z, arg_x, arg_y, arg_z, queue))
++-    return 1;
+++    return EXIT_FAILURE;
++ 
++   if (!test_invocation(y, z, x, arg_y, arg_z, arg_x, queue))
++-    return 1;
+++    return EXIT_FAILURE;
++ 
++   if (!test_invocation(z, x, y, arg_z, arg_x, arg_y, queue))
++-    return 1;
+++    return EXIT_FAILURE;
++ 
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_alignment_with_dynamic_wg2.cpp b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++index 51235238..32021fc8 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg2.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++@@ -84,4 +84,6 @@ int main(int argc, char *argv[]) {
++   printf("Value: %le \n", out[0]);
++   printf("Value: %le \n", out[1]);
++   printf("Value: %le \n", out[2]);
+++
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_alignment_with_dynamic_wg3.cpp b/tests/regression/test_alignment_with_dynamic_wg3.cpp
++index fcfd2bd7..becfc0b8 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg3.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg3.cpp
++@@ -58,10 +58,11 @@ int main(int argc, char *argv[]) {
++ 
++   queue.finish();
++ 
++-  if (out[0] == 1.0f)
+++  if (out[0] == 1.0f) {
++     printf("OK\n");
++-  else
+++    return EXIT_SUCCESS;
+++  } else {
++     printf("FAIL\n");
++-
++-  return (out[0] == 1.0f) ? 0 : 1;
+++    return EXIT_FAILURE;
+++  }
++ }
++diff --git a/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c b/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
++index dbc978ad..ec323e63 100644
++--- a/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
+++++ b/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
++@@ -25,6 +25,7 @@
++ 
++ #include <CL/cl.h>
++ #include "poclu.h"
+++#include <stdlib.h>
++ #include <string.h>
++ 
++ const char* kernel_src = 
++@@ -82,5 +83,10 @@ int main() {
++     
++     clFinish(command_queue);
++     ret |= clReleaseKernel(kernel);
++-    return ret;
+++
+++    if (ret == 0)
+++      {
+++        return EXIT_SUCCESS;
+++      }
+++    return EXIT_FAILURE;
++ }
++diff --git a/tests/regression/test_flatten_barrier_subs.cpp b/tests/regression/test_flatten_barrier_subs.cpp
++index c0b4835f..70bb9a1f 100644
++--- a/tests/regression/test_flatten_barrier_subs.cpp
+++++ b/tests/regression/test_flatten_barrier_subs.cpp
++@@ -242,7 +242,8 @@ int main()
++     {
++         std::cout << "CL gave wrong results" << std::endl;
++         print_vec(cl_indices);
+++        return EXIT_FAILURE;
++     }
++ 
++-    return 0;
+++    return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_231.cpp b/tests/regression/test_issue_231.cpp
++index 640fcdc7..25f16d01 100644
++--- a/tests/regression/test_issue_231.cpp
+++++ b/tests/regression/test_issue_231.cpp
++@@ -101,4 +101,6 @@ int main(int argc, char *argv[])
++ 
++   queue.finish();
++   cl::Platform::getDefault().unloadCompiler();
+++
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_445.cpp b/tests/regression/test_issue_445.cpp
++index 3c74c78c..abc1b261 100644
++--- a/tests/regression/test_issue_445.cpp
+++++ b/tests/regression/test_issue_445.cpp
++@@ -31,6 +31,7 @@ private_local_array(__global int *__restrict__ out)
++ 
++ int main(int, char **)
++ {
+++  bool success = true;
++   try {
++     int N = 9;
++ 
++@@ -48,9 +49,11 @@ int main(int, char **)
++     cl_int *output = (cl_int*)queue.enqueueMapBuffer(
++       buffer, CL_TRUE, CL_MAP_READ, 0, N*sizeof(int));
++     for (int i = 0; i < N; i++) {
++-      if ((int)output[i] != i + 1)
+++      if ((int)output[i] != i + 1) {
++         std::cout << "FAIL: " << output[i] << " should be " << i + 1
++                << std::endl;
+++        success = false;
+++      }
++     }
++     queue.enqueueUnmapMemObject(buffer, output);
++     queue.finish();
++@@ -58,6 +61,11 @@ int main(int, char **)
++   }
++   catch (cl::Error& err) {
++     std::cout << "FAIL with OpenCL error = " << err.err() << std::endl;
+++    return EXIT_FAILURE;
++   }
++-  return 0;
+++
+++  if (success) {
+++    return EXIT_SUCCESS;
+++  }
+++  return EXIT_FAILURE;
++ }
++diff --git a/tests/regression/test_issue_553.cpp b/tests/regression/test_issue_553.cpp
++index ba3671e9..0b518288 100644
++--- a/tests/regression/test_issue_553.cpp
+++++ b/tests/regression/test_issue_553.cpp
++@@ -73,4 +73,6 @@ int main(int argc, char *argv[])
++ 
++   queue.finish();
++   cl::Platform::getDefault().unloadCompiler();
+++
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_577.cpp b/tests/regression/test_issue_577.cpp
++index 84b6d500..568a2b36 100644
++--- a/tests/regression/test_issue_577.cpp
+++++ b/tests/regression/test_issue_577.cpp
++@@ -36,9 +36,9 @@ int main(int argc, char *argv[]) {
++ 
++   if (error_count == 2) {
++     std::cout << "OK\n";
++-    return 0;
+++    return EXIT_SUCCESS;
++   } else {
++     std::cout << "FAIL\n";
++-    return 1;
+++    return EXIT_FAILURE;
++   }
++ }
++diff --git a/tests/regression/test_locals.cpp b/tests/regression/test_locals.cpp
++index 4735b68f..c00f9cee 100644
++--- a/tests/regression/test_locals.cpp
+++++ b/tests/regression/test_locals.cpp
++@@ -137,6 +137,10 @@
++             aBuffer, (void *) res);\r
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
+++\r
+++        if (success) {\r
+++            return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -146,9 +150,7 @@
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return success ? EXIT_SUCCESS : EXIT_FAILURE;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_program_from_binary_with_local_1_1_1.c b/tests/regression/test_program_from_binary_with_local_1_1_1.c
++index 653d1cac..41de70a8 100644
++--- a/tests/regression/test_program_from_binary_with_local_1_1_1.c
+++++ b/tests/regression/test_program_from_binary_with_local_1_1_1.c
++@@ -136,7 +136,7 @@ int main ()
++             {
++               printf("Error at %u %u : %u != %u\n", k, i,
++                      output_buffer[k*vec_size+i], expected);
++-              return 1;
+++              return EXIT_FAILURE;
++             }
++         }
++     }
++@@ -149,5 +149,6 @@ int main ()
++   clReleaseContext(context);
++   clReleaseDevice(device);
++   clUnloadPlatformCompiler(platform);
++-  return 0;
+++
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_clCreateKernel.c b/tests/runtime/test_clCreateKernel.c
++index 8cf648cf..5dbac2e2 100644
++--- a/tests/runtime/test_clCreateKernel.c
+++++ b/tests/runtime/test_clCreateKernel.c
++@@ -45,8 +45,5 @@ int main(int argc, char **argv)
++   free ((void *)krn_src);
++ 
++   printf("OK\n");
++-
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++-
++-
++diff --git a/tests/runtime/test_clCreateSubDevices.c b/tests/runtime/test_clCreateSubDevices.c
++index bfaff142..fd80fd4f 100644
++--- a/tests/runtime/test_clCreateSubDevices.c
+++++ b/tests/runtime/test_clCreateSubDevices.c
++@@ -405,7 +405,5 @@ int main(int argc, char **argv)
++   free (dev_pt);
++ 
++   printf ("OK\n");
++-
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++-
++diff --git a/tests/runtime/test_enqueue_kernel_from_binary.c b/tests/runtime/test_enqueue_kernel_from_binary.c
++index 279e22e7..883682e8 100644
++--- a/tests/runtime/test_enqueue_kernel_from_binary.c
+++++ b/tests/runtime/test_enqueue_kernel_from_binary.c
++@@ -364,20 +364,20 @@ int main(void)
++     if(h_c1[i] != h_c2[i])
++     {
++       printf("[1] Check failed at offset %d, %i instead of %i\n", i, h_c2[i], h_c1[i]);
++-      ++errors;
++-      if (errors > 10) exit(1);
+++      if (++errors > 10)
+++        return EXIT_FAILURE;
++     }
++     if ((((i/128)%2) && (h_c1[i]-16 != h_c3[i])))
++     {
++       printf("[2] Check failed at offset %d, %i instead of %i\n", i, h_c3[i], h_c1[i]-16);
++-      ++errors;
++-      if (errors > 10) exit(1);
+++      if (++errors > 10)
+++        return EXIT_FAILURE;
++     }
++     if (!((i/128)%2) && (h_c1[i] != h_c3[i]))
++     {
++       printf("[3] Check failed at offset %d, %i instead of %i\n", i, h_c3[i], h_c1[i]);
++-      ++errors;
++-      if (errors > 10) exit(1);
+++      if (++errors > 10)
+++        return EXIT_FAILURE;
++     }
++   }
++ 
++@@ -436,5 +436,7 @@ int main(void)
++   free (static_wg_binary);
++   free (static_wg_buf);
++ 
++-  return 0;
+++  if (errors)
+++    return EXIT_FAILURE;
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_fill-buffer.c b/tests/runtime/test_fill-buffer.c
++index 0bf4b21a..257df2e0 100644
++--- a/tests/runtime/test_fill-buffer.c
+++++ b/tests/runtime/test_fill-buffer.c
++@@ -113,7 +113,7 @@ main (void)
++                     {
++                       printf ("Expected value at %d: 1, actual value: %d\n", i,
++                               host_buf1[i]);
++-                      exit (1);
+++                      return EXIT_FAILURE;
++                     }
++                 }
++               for (int i = buf_size - pattern_size; i < buf_size; i++)
++@@ -122,7 +122,7 @@ main (void)
++                     {
++                       printf ("Expected value at %d: 1, actual value: %d\n", i,
++                               host_buf1[i]);
++-                      exit (1);
+++                      return EXIT_FAILURE;
++                     }
++                 }
++               for (int i = pattern_size * 2; i < buf_size - pattern_size;
++@@ -136,7 +136,7 @@ main (void)
++                           printf (
++                               "Expected value at %d: %d, actual value: %d\n",
++                               i + j, expected_value, host_buf1[i + j]);
++-                          exit (1);
+++                          return EXIT_FAILURE;
++                         }
++                     }
++                 }
++diff --git a/tests/runtime/test_kernel_cache_includes.c b/tests/runtime/test_kernel_cache_includes.c
++index f6fda000..c1bc75c8 100644
++--- a/tests/runtime/test_kernel_cache_includes.c
+++++ b/tests/runtime/test_kernel_cache_includes.c
++@@ -85,5 +85,5 @@ int main(int argc, char **argv)
++ 
++   free ((void *)krn_src);
++ 
++-  return 0;
+++  return EXIT_SUCCESS;
++ }
++diff --git a/tests/workgroup/run_kernel.c b/tests/workgroup/run_kernel.c
++index 9281f7b5..f8d4b95c 100644
++--- a/tests/workgroup/run_kernel.c
+++++ b/tests/workgroup/run_kernel.c
++@@ -150,5 +150,9 @@ ERROR:
++   if (context)
++     clReleaseContext (context);
++ 
++-  return (err == CL_SUCCESS) ? 0 : 1;
+++  if (err == CL_SUCCESS)
+++    {
+++      return EXIT_SUCCESS;
+++    }
+++  return EXIT_FAILURE;
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c0eaddfd8c9a69266e4b8390b95da16311a55523
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,394 @@@
++From ec124646cdf132ba6c28fa30e3a9567db9684c58 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 23 Nov 2021 18:17:11 +0100
++Subject: [PATCH 131/144] tests: simplify EXIT_SUCCESS/EXIT_FAILURE usage
++
++---
++ tests/regression/test_barrier_before_return.cpp          | 8 ++------
++ tests/regression/test_barrier_between_for_loops.cpp      | 6 +-----
++ tests/regression/test_constant_array.cpp                 | 4 +---
++ tests/regression/test_early_return.cpp                   | 6 +-----
++ tests/regression/test_for_with_var_iteration_count.cpp   | 8 ++------
++ tests/regression/test_fors_with_var_iteration_counts.cpp | 4 +---
++ tests/regression/test_id_dependent_computation.cpp       | 6 +-----
++ tests/regression/test_infinite_loop.cpp                  | 4 +---
++ tests/regression/test_loop_phi_replication.cpp           | 6 +-----
++ .../regression/test_multi_level_loops_with_barriers.cpp  | 8 ++------
++ tests/regression/test_null_arg.cpp                       | 9 ++-------
++ tests/regression/test_simple_for_with_a_barrier.cpp      | 9 ++-------
++ tests/regression/test_structs_as_args.cpp                | 8 ++------
++ tests/regression/test_undominated_variable.cpp           | 8 ++------
++ tests/regression/test_vectors_as_args.cpp                | 9 ++-------
++ tests/runtime/test_clCreateProgramWithBinary.c           | 6 +++++-
++ 16 files changed, 28 insertions(+), 81 deletions(-)
++
++diff --git a/tests/regression/test_barrier_before_return.cpp b/tests/regression/test_barrier_before_return.cpp
++index 7f6033b9..d0e81fe4 100644
++--- a/tests/regression/test_barrier_before_return.cpp
+++++ b/tests/regression/test_barrier_before_return.cpp
++@@ -148,9 +148,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok)\r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
+++            return EXIT_SUCCESS;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -160,9 +158,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_barrier_between_for_loops.cpp b/tests/regression/test_barrier_between_for_loops.cpp
++index 12d1f1f8..577b85ad 100644
++--- a/tests/regression/test_barrier_between_for_loops.cpp
+++++ b/tests/regression/test_barrier_between_for_loops.cpp
++@@ -187,8 +187,6 @@ main(void)
++ \r
++         if (ok)\r
++             return EXIT_SUCCESS;\r
++-        else\r
++-            return EXIT_FAILURE;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -198,9 +196,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_constant_array.cpp b/tests/regression/test_constant_array.cpp
++index a3bd084e..afb111d7 100644
++--- a/tests/regression/test_constant_array.cpp
+++++ b/tests/regression/test_constant_array.cpp
++@@ -136,9 +136,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_early_return.cpp b/tests/regression/test_early_return.cpp
++index d1c62f37..0df2cb87 100644
++--- a/tests/regression/test_early_return.cpp
+++++ b/tests/regression/test_early_return.cpp
++@@ -145,8 +145,6 @@ main(void)
++ \r
++         if (ok)\r
++             return EXIT_SUCCESS;\r
++-        else\r
++-            return EXIT_FAILURE;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -156,9 +154,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_for_with_var_iteration_count.cpp b/tests/regression/test_for_with_var_iteration_count.cpp
++index bca6d2c2..d31defc8 100644
++--- a/tests/regression/test_for_with_var_iteration_count.cpp
+++++ b/tests/regression/test_for_with_var_iteration_count.cpp
++@@ -153,9 +153,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok)\r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
+++           return EXIT_SUCCESS;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -165,9 +163,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_fors_with_var_iteration_counts.cpp b/tests/regression/test_fors_with_var_iteration_counts.cpp
++index c8854b48..7fe02319 100644
++--- a/tests/regression/test_fors_with_var_iteration_counts.cpp
+++++ b/tests/regression/test_fors_with_var_iteration_counts.cpp
++@@ -151,9 +151,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_id_dependent_computation.cpp b/tests/regression/test_id_dependent_computation.cpp
++index 31728d75..362a273a 100644
++--- a/tests/regression/test_id_dependent_computation.cpp
+++++ b/tests/regression/test_id_dependent_computation.cpp
++@@ -169,8 +169,6 @@ main(void)
++ \r
++         if (ok)\r
++             return EXIT_SUCCESS;\r
++-        else\r
++-            return EXIT_FAILURE;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -180,9 +178,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_infinite_loop.cpp b/tests/regression/test_infinite_loop.cpp
++index f9c6e833..c477e2de 100644
++--- a/tests/regression/test_infinite_loop.cpp
+++++ b/tests/regression/test_infinite_loop.cpp
++@@ -131,9 +131,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_loop_phi_replication.cpp b/tests/regression/test_loop_phi_replication.cpp
++index 32a59846..93b4020b 100644
++--- a/tests/regression/test_loop_phi_replication.cpp
+++++ b/tests/regression/test_loop_phi_replication.cpp
++@@ -153,8 +153,6 @@ main(void)
++ \r
++         if (ok)\r
++             return EXIT_SUCCESS;\r
++-        else\r
++-            return EXIT_FAILURE;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -164,9 +162,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_multi_level_loops_with_barriers.cpp b/tests/regression/test_multi_level_loops_with_barriers.cpp
++index f12e6f55..90c86202 100644
++--- a/tests/regression/test_multi_level_loops_with_barriers.cpp
+++++ b/tests/regression/test_multi_level_loops_with_barriers.cpp
++@@ -162,9 +162,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok)\r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
+++            return EXIT_SUCCESS;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -174,9 +172,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_null_arg.cpp b/tests/regression/test_null_arg.cpp
++index 87a50e25..ac207462 100644
++--- a/tests/regression/test_null_arg.cpp
+++++ b/tests/regression/test_null_arg.cpp
++@@ -137,10 +137,7 @@ main(void)
++         platformList[0].unloadCompiler();
++ 
++         if (ok)
++-          return EXIT_SUCCESS;
++-        else
++-          return EXIT_FAILURE;
++-
+++            return EXIT_SUCCESS;
++     }
++     catch (cl::Error &err) {
++          std::cerr
++@@ -150,9 +147,7 @@ main(void)
++              << err.err()
++              << ")"
++              << std::endl;
++-
++-         return EXIT_FAILURE;
++     }
++ 
++-    return EXIT_SUCCESS;
+++    return EXIT_FAILURE;
++ }
++diff --git a/tests/regression/test_simple_for_with_a_barrier.cpp b/tests/regression/test_simple_for_with_a_barrier.cpp
++index 47fd2332..1202e1a6 100644
++--- a/tests/regression/test_simple_for_with_a_barrier.cpp
+++++ b/tests/regression/test_simple_for_with_a_barrier.cpp
++@@ -157,10 +157,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok)\r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
++- \r
+++           return EXIT_SUCCESS;\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -170,9 +167,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_structs_as_args.cpp b/tests/regression/test_structs_as_args.cpp
++index 444a3597..2fb90e16 100644
++--- a/tests/regression/test_structs_as_args.cpp
+++++ b/tests/regression/test_structs_as_args.cpp
++@@ -281,9 +281,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok) \r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
+++            return EXIT_SUCCESS;\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -293,9 +291,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_undominated_variable.cpp b/tests/regression/test_undominated_variable.cpp
++index 71f56175..429672d3 100644
++--- a/tests/regression/test_undominated_variable.cpp
+++++ b/tests/regression/test_undominated_variable.cpp
++@@ -155,9 +155,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok)\r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
+++            return EXIT_SUCCESS;\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -167,9 +165,7 @@ main(void)
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/regression/test_vectors_as_args.cpp b/tests/regression/test_vectors_as_args.cpp
++index 80e11882..2e64ea64 100644
++--- a/tests/regression/test_vectors_as_args.cpp
+++++ b/tests/regression/test_vectors_as_args.cpp
++@@ -172,10 +172,7 @@ int main() {
++         platformList[0].unloadCompiler();\r
++ \r
++         if (ok) \r
++-          return EXIT_SUCCESS;\r
++-        else\r
++-          return EXIT_FAILURE;\r
++-\r
+++            return EXIT_SUCCESS;\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++@@ -185,9 +182,7 @@ int main() {
++              << err.err()\r
++              << ")"\r
++              << std::endl;\r
++-\r
++-         return EXIT_FAILURE;\r
++     }\r
++ \r
++-    return EXIT_SUCCESS;\r
+++    return EXIT_FAILURE;\r
++ }\r
++diff --git a/tests/runtime/test_clCreateProgramWithBinary.c b/tests/runtime/test_clCreateProgramWithBinary.c
++index 234879f3..90b2be78 100644
++--- a/tests/runtime/test_clCreateProgramWithBinary.c
+++++ b/tests/runtime/test_clCreateProgramWithBinary.c
++@@ -209,5 +209,9 @@ main(void){
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
++-  return err == CL_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
+++  if (err == CL_SUCCESS)
+++    {
+++      return EXIT_SUCCESS;
+++    }
+++  return EXIT_FAILURE;
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8ae92b31a581d3438426347f50e45394ff84c65c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,778 @@@
++From 799153cb52c11265655304011a1d76111be44f00 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 23 Nov 2021 18:21:16 +0100
++Subject: [PATCH 132/144] tests: emit "OK" along EXIT_SUCCESS
++
++---
++ tests/regression/test_alignment_with_dynamic_wg2.cpp          | 1 +
++ .../test_assign_loop_variable_to_privvar_makes_it_local.c     | 2 ++
++ tests/regression/test_autolocals_in_constexprs.cpp            | 1 +
++ tests/regression/test_barrier_before_return.cpp               | 4 +++-
++ tests/regression/test_barrier_between_for_loops.cpp           | 4 +++-
++ tests/regression/test_constant_array.cpp                      | 2 ++
++ tests/regression/test_early_return.cpp                        | 4 +++-
++ tests/regression/test_flatten_barrier_subs.cpp                | 1 +
++ tests/regression/test_flatten_barrier_subs.output             | 1 +
++ tests/regression/test_for_with_var_iteration_count.cpp        | 4 +++-
++ tests/regression/test_fors_with_var_iteration_counts.cpp      | 1 +
++ tests/regression/test_id_dependent_computation.cpp            | 4 +++-
++ tests/regression/test_infinite_loop.cpp                       | 2 ++
++ tests/regression/test_issue_231.cpp                           | 1 +
++ tests/regression/test_issue_445.cpp                           | 1 +
++ tests/regression/test_issue_553.cpp                           | 1 +
++ tests/regression/test_issue_757.cpp                           | 1 +
++ tests/regression/test_issue_893.cpp                           | 3 +++
++ tests/regression/test_locals.cpp                              | 1 +
++ tests/regression/test_loop_phi_replication.cpp                | 4 +++-
++ tests/regression/test_multi_level_loops_with_barriers.cpp     | 4 +++-
++ tests/regression/test_null_arg.cpp                            | 4 +++-
++ tests/regression/test_program_from_binary_with_local_1_1_1.c  | 1 +
++ tests/regression/test_setargs.cpp                             | 1 +
++ tests/regression/test_simple_for_with_a_barrier.cpp           | 4 +++-
++ tests/regression/test_structs_as_args.cpp                     | 4 +++-
++ tests/regression/test_undominated_variable.cpp                | 4 +++-
++ tests/regression/test_vectors_as_args.cpp                     | 4 +++-
++ tests/runtime/test_buffer-image-copy.c                        | 2 ++
++ tests/runtime/test_clCreateProgramWithBinary.c                | 1 +
++ tests/runtime/test_clEnqueueNativeKernel.c                    | 1 +
++ tests/runtime/test_clGetSupportedImageFormats.c               | 1 +
++ tests/runtime/test_clSetEventCallback.c                       | 2 +-
++ tests/runtime/test_clSetEventCallback_expout.txt              | 1 +
++ tests/runtime/test_enqueue_kernel_from_binary.c               | 1 +
++ tests/runtime/test_event_cycle.c                              | 2 ++
++ tests/runtime/test_event_double_wait.c                        | 2 +-
++ tests/runtime/test_event_free.c                               | 2 +-
++ tests/runtime/test_fill-buffer.c                              | 1 +
++ tests/runtime/test_link_error.c                               | 1 +
++ tests/runtime/test_read-copy-write-buffer.c                   | 1 +
++ tests/runtime/test_user_event.c                               | 2 +-
++ tests/workgroup/basic_barriers_2_2_2_2.stdout                 | 1 +
++ tests/workgroup/cond_barriers_1_2_1_1.stdout                  | 1 +
++ tests/workgroup/cond_barriers_in_for_2_4_1_1.stdout           | 1 +
++ tests/workgroup/for_bug_1_2_1_1.stdout                        | 1 +
++ tests/workgroup/for_with_divergent_return_1_6_1_1.stdout      | 1 +
++ tests/workgroup/forloops_2_2_1_1.stdout                       | 1 +
++ tests/workgroup/implicit_barriers_1_2_1_1.stdout              | 1 +
++ tests/workgroup/issue_548_1_2_1_1.stdout                      | 1 +
++ tests/workgroup/loopbarriers_1_4_1_1.stdout                   | 1 +
++ tests/workgroup/multilatch_bloop_1_3_1_1.stdout               | 1 +
++ tests/workgroup/outerlooppar_2_2_1_1.stdout                   | 1 +
++ tests/workgroup/print_all_ids_114114.txt                      | 1 +
++ tests/workgroup/range_md.stdout                               | 1 +
++ tests/workgroup/range_md_small_grid.stdout                    | 1 +
++ tests/workgroup/run_kernel.c                                  | 1 +
++ tests/workgroup/switch_case_1_4_1_1.stdout                    | 1 +
++ tests/workgroup/tricky_for_1_2_1_1.stdout                     | 1 +
++ 59 files changed, 90 insertions(+), 16 deletions(-)
++
++diff --git a/tests/regression/test_alignment_with_dynamic_wg2.cpp b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++index 32021fc8..296131ae 100644
++--- a/tests/regression/test_alignment_with_dynamic_wg2.cpp
+++++ b/tests/regression/test_alignment_with_dynamic_wg2.cpp
++@@ -85,5 +85,6 @@ int main(int argc, char *argv[]) {
++   printf("Value: %le \n", out[1]);
++   printf("Value: %le \n", out[2]);
++ 
+++  printf("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c b/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
++index ec323e63..e4f24071 100644
++--- a/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
+++++ b/tests/regression/test_assign_loop_variable_to_privvar_makes_it_local.c
++@@ -25,6 +25,7 @@
++ 
++ #include <CL/cl.h>
++ #include "poclu.h"
+++#include <stdio.h>
++ #include <stdlib.h>
++ #include <string.h>
++ 
++@@ -86,6 +87,7 @@ int main() {
++ 
++     if (ret == 0)
++       {
+++        printf ("OK\n");
++         return EXIT_SUCCESS;
++       }
++     return EXIT_FAILURE;
++diff --git a/tests/regression/test_autolocals_in_constexprs.cpp b/tests/regression/test_autolocals_in_constexprs.cpp
++index 48573cfa..28511092 100644
++--- a/tests/regression/test_autolocals_in_constexprs.cpp
+++++ b/tests/regression/test_autolocals_in_constexprs.cpp
++@@ -112,5 +112,6 @@ main(void)
++     return EXIT_FAILURE;
++   }
++ 
+++  std::cout << "OK" << std::endl;
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_barrier_before_return.cpp b/tests/regression/test_barrier_before_return.cpp
++index d0e81fe4..d64d75d5 100644
++--- a/tests/regression/test_barrier_before_return.cpp
+++++ b/tests/regression/test_barrier_before_return.cpp
++@@ -147,8 +147,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_barrier_between_for_loops.cpp b/tests/regression/test_barrier_between_for_loops.cpp
++index 577b85ad..0e81c263 100644
++--- a/tests/regression/test_barrier_between_for_loops.cpp
+++++ b/tests/regression/test_barrier_between_for_loops.cpp
++@@ -185,8 +185,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_constant_array.cpp b/tests/regression/test_constant_array.cpp
++index afb111d7..8ac26b6f 100644
++--- a/tests/regression/test_constant_array.cpp
+++++ b/tests/regression/test_constant_array.cpp
++@@ -124,6 +124,8 @@ main(void)
++ \r
++         /* The call should return cleanly, the compiler should not crash. */\r
++ \r
+++        std::cout << "OK" << std::endl;\r
+++\r
++         /* Force exit of the process regardless of the running kernel thread\r
++            by replacing the process with a dummy process. */\r
++         execlp("true", "true", NULL);\r
++diff --git a/tests/regression/test_early_return.cpp b/tests/regression/test_early_return.cpp
++index 0df2cb87..404bd80b 100644
++--- a/tests/regression/test_early_return.cpp
+++++ b/tests/regression/test_early_return.cpp
++@@ -143,8 +143,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_flatten_barrier_subs.cpp b/tests/regression/test_flatten_barrier_subs.cpp
++index 70bb9a1f..fed0f26d 100644
++--- a/tests/regression/test_flatten_barrier_subs.cpp
+++++ b/tests/regression/test_flatten_barrier_subs.cpp
++@@ -245,5 +245,6 @@ int main()
++         return EXIT_FAILURE;
++     }
++ 
+++    std::cout << "OK" << std::endl;
++     return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_flatten_barrier_subs.output b/tests/regression/test_flatten_barrier_subs.output
++index 29b9b0cf..d74d8b3d 100644
++--- a/tests/regression/test_flatten_barrier_subs.output
+++++ b/tests/regression/test_flatten_barrier_subs.output
++@@ -2,3 +2,4 @@
++ 0, 1, 1, 2, 3, 4, 5, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10, 11, 11, 12, 13, 13, 13, 13, 14, 15, 16, 17, 17, 17, 17, 18, 19, 20, 20, 21, 21, 22, 23, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 37, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42, 43, 43, 43, 43, 43, 43, 44, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47
++ 0: Portable Computing Language
++ CL gave correct results
+++OK
++diff --git a/tests/regression/test_for_with_var_iteration_count.cpp b/tests/regression/test_for_with_var_iteration_count.cpp
++index d31defc8..2a6081ea 100644
++--- a/tests/regression/test_for_with_var_iteration_count.cpp
+++++ b/tests/regression/test_for_with_var_iteration_count.cpp
++@@ -152,8 +152,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++           std::cout << "OK" << std::endl;\r
++            return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_fors_with_var_iteration_counts.cpp b/tests/regression/test_fors_with_var_iteration_counts.cpp
++index 7fe02319..845b70f1 100644
++--- a/tests/regression/test_fors_with_var_iteration_counts.cpp
+++++ b/tests/regression/test_fors_with_var_iteration_counts.cpp
++@@ -141,6 +141,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         // If the kernel compiler succeeds, we are happy for now.\r
+++        std::cout << "OK" << std::endl;\r
++         return EXIT_SUCCESS;\r
++     } \r
++     catch (cl::Error &err) {\r
++diff --git a/tests/regression/test_id_dependent_computation.cpp b/tests/regression/test_id_dependent_computation.cpp
++index 362a273a..698584f6 100644
++--- a/tests/regression/test_id_dependent_computation.cpp
+++++ b/tests/regression/test_id_dependent_computation.cpp
++@@ -167,8 +167,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_infinite_loop.cpp b/tests/regression/test_infinite_loop.cpp
++index c477e2de..48ae2285 100644
++--- a/tests/regression/test_infinite_loop.cpp
+++++ b/tests/regression/test_infinite_loop.cpp
++@@ -119,6 +119,8 @@ main(void)
++ \r
++         /* The call should return cleanly, the compiler should not crash. */\r
++ \r
+++        std::cout << "OK" << std::endl;\r
+++\r
++         /* Force exit of the process regardless of the running kernel thread\r
++            by replacing the process with a dummy process. */\r
++         execlp("true", "true", NULL);\r
++diff --git a/tests/regression/test_issue_231.cpp b/tests/regression/test_issue_231.cpp
++index 25f16d01..f749388c 100644
++--- a/tests/regression/test_issue_231.cpp
+++++ b/tests/regression/test_issue_231.cpp
++@@ -102,5 +102,6 @@ int main(int argc, char *argv[])
++   queue.finish();
++   cl::Platform::getDefault().unloadCompiler();
++ 
+++  std::cout << "OK" << std::endl;
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_445.cpp b/tests/regression/test_issue_445.cpp
++index abc1b261..a37d1ee8 100644
++--- a/tests/regression/test_issue_445.cpp
+++++ b/tests/regression/test_issue_445.cpp
++@@ -65,6 +65,7 @@ int main(int, char **)
++   }
++ 
++   if (success) {
+++    std::cout << "OK" << std::endl;
++     return EXIT_SUCCESS;
++   }
++   return EXIT_FAILURE;
++diff --git a/tests/regression/test_issue_553.cpp b/tests/regression/test_issue_553.cpp
++index 0b518288..4db3e80b 100644
++--- a/tests/regression/test_issue_553.cpp
+++++ b/tests/regression/test_issue_553.cpp
++@@ -74,5 +74,6 @@ int main(int argc, char *argv[])
++   queue.finish();
++   cl::Platform::getDefault().unloadCompiler();
++ 
+++  std::cout << "OK" << std::endl;
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_757.cpp b/tests/regression/test_issue_757.cpp
++index aa1a2956..f1cea887 100644
++--- a/tests/regression/test_issue_757.cpp
+++++ b/tests/regression/test_issue_757.cpp
++@@ -73,5 +73,6 @@ int main(int argc, char *argv[]) {
++     }
++   }
++   
+++  std::cout << "OK" << std::endl;
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_issue_893.cpp b/tests/regression/test_issue_893.cpp
++index 1a6af56b..2f5cda8d 100644
++--- a/tests/regression/test_issue_893.cpp
+++++ b/tests/regression/test_issue_893.cpp
++@@ -42,6 +42,7 @@
++ #define CL_HPP_MINIMUM_OPENCL_VERSION 120
++ #define CL_HPP_TARGET_OPENCL_VERSION 120
++ #include <CL/cl2.hpp>
+++#include <iostream>
++ 
++ const char *SOURCE = R"RAW(
++ #define lid(N) ((int) get_local_id(N))
++@@ -81,5 +82,7 @@ int main() {
++     cl::NDRange(n),
++     cl::NDRange(n));
++   queue.finish();
+++
+++  std::cout << "OK" << std::endl;
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_locals.cpp b/tests/regression/test_locals.cpp
++index c00f9cee..1197803e 100644
++--- a/tests/regression/test_locals.cpp
+++++ b/tests/regression/test_locals.cpp
++@@ -139,6 +139,7 @@ main(void)
++         platformList[0].unloadCompiler();\r
++ \r
++         if (success) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
++         }\r
++     }\r
++--- a/tests/regression/test_loop_phi_replication.cpp
+++++ b/tests/regression/test_loop_phi_replication.cpp
++@@ -151,8 +151,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_multi_level_loops_with_barriers.cpp b/tests/regression/test_multi_level_loops_with_barriers.cpp
++index 90c86202..a56d7f84 100644
++--- a/tests/regression/test_multi_level_loops_with_barriers.cpp
+++++ b/tests/regression/test_multi_level_loops_with_barriers.cpp
++@@ -161,8 +161,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_null_arg.cpp b/tests/regression/test_null_arg.cpp
++index ac207462..0a90c268 100644
++--- a/tests/regression/test_null_arg.cpp
+++++ b/tests/regression/test_null_arg.cpp
++@@ -136,8 +136,10 @@ main(void)
++         queue.finish();
++         platformList[0].unloadCompiler();
++ 
++-        if (ok)
+++        if (ok) {
+++            std::cout << "OK" << std::endl;
++             return EXIT_SUCCESS;
+++        }
++     }
++     catch (cl::Error &err) {
++          std::cerr
++diff --git a/tests/regression/test_program_from_binary_with_local_1_1_1.c b/tests/regression/test_program_from_binary_with_local_1_1_1.c
++index 41de70a8..1aaeba4e 100644
++--- a/tests/regression/test_program_from_binary_with_local_1_1_1.c
+++++ b/tests/regression/test_program_from_binary_with_local_1_1_1.c
++@@ -150,5 +150,6 @@ int main ()
++   clReleaseDevice(device);
++   clUnloadPlatformCompiler(platform);
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/regression/test_setargs.cpp b/tests/regression/test_setargs.cpp
++index cb9be507..97b5a831 100644
++--- a/tests/regression/test_setargs.cpp
+++++ b/tests/regression/test_setargs.cpp
++@@ -136,5 +136,6 @@ main(void)
++          return EXIT_FAILURE;\r
++     }\r
++ \r
+++    std::cout << "OK" << std::endl;\r
++     return EXIT_SUCCESS;\r
++ }\r
++diff --git a/tests/regression/test_simple_for_with_a_barrier.cpp b/tests/regression/test_simple_for_with_a_barrier.cpp
++index 1202e1a6..9b522224 100644
++--- a/tests/regression/test_simple_for_with_a_barrier.cpp
+++++ b/tests/regression/test_simple_for_with_a_barrier.cpp
++@@ -156,8 +156,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++           std::cout << "OK" << std::endl;\r
++            return EXIT_SUCCESS;\r
+++        }\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_structs_as_args.cpp b/tests/regression/test_structs_as_args.cpp
++index 2fb90e16..c57ccc6e 100644
++--- a/tests/regression/test_structs_as_args.cpp
+++++ b/tests/regression/test_structs_as_args.cpp
++@@ -280,8 +280,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok) \r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_undominated_variable.cpp b/tests/regression/test_undominated_variable.cpp
++index 429672d3..3595d71b 100644
++--- a/tests/regression/test_undominated_variable.cpp
+++++ b/tests/regression/test_undominated_variable.cpp
++@@ -154,8 +154,10 @@ main(void)
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok)\r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     }\r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/regression/test_vectors_as_args.cpp b/tests/regression/test_vectors_as_args.cpp
++index 2e64ea64..df5afe6a 100644
++--- a/tests/regression/test_vectors_as_args.cpp
+++++ b/tests/regression/test_vectors_as_args.cpp
++@@ -171,8 +171,10 @@ int main() {
++         queue.finish();\r
++         platformList[0].unloadCompiler();\r
++ \r
++-        if (ok) \r
+++        if (ok) {\r
+++            std::cout << "OK" << std::endl;\r
++             return EXIT_SUCCESS;\r
+++        }\r
++     } \r
++     catch (cl::Error &err) {\r
++          std::cerr\r
++diff --git a/tests/runtime/test_buffer-image-copy.c b/tests/runtime/test_buffer-image-copy.c
++index 08a86d1e..6c34fd9a 100644
++--- a/tests/runtime/test_buffer-image-copy.c
+++++ b/tests/runtime/test_buffer-image-copy.c
++@@ -203,5 +203,7 @@ main(void)
++   }
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
+++
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_clCreateProgramWithBinary.c b/tests/runtime/test_clCreateProgramWithBinary.c
++index 90b2be78..47d2900e 100644
++--- a/tests/runtime/test_clCreateProgramWithBinary.c
+++++ b/tests/runtime/test_clCreateProgramWithBinary.c
++@@ -211,6 +211,7 @@ main(void){
++ 
++   if (err == CL_SUCCESS)
++     {
+++      printf ("OK\n");
++       return EXIT_SUCCESS;
++     }
++   return EXIT_FAILURE;
++diff --git a/tests/runtime/test_clEnqueueNativeKernel.c b/tests/runtime/test_clEnqueueNativeKernel.c
++index 90bb3de2..0457b664 100644
++--- a/tests/runtime/test_clEnqueueNativeKernel.c
+++++ b/tests/runtime/test_clEnqueueNativeKernel.c
++@@ -139,6 +139,7 @@ int main(int argc, char **argv) {
++   free(h_b);
++   free(h_c);
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ 
++ error:
++diff --git a/tests/runtime/test_clGetSupportedImageFormats.c b/tests/runtime/test_clGetSupportedImageFormats.c
++index 7161589b..19055dd0 100644
++--- a/tests/runtime/test_clGetSupportedImageFormats.c
+++++ b/tests/runtime/test_clGetSupportedImageFormats.c
++@@ -49,5 +49,6 @@ main(void)
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_clSetEventCallback.c b/tests/runtime/test_clSetEventCallback.c
++index a8ead4f8..76c598e2 100644
++--- a/tests/runtime/test_clSetEventCallback.c
+++++ b/tests/runtime/test_clSetEventCallback.c
++@@ -162,6 +162,6 @@ int main()
++   CHECK_CL_ERROR (clReleaseContext (context));
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++-
++ }
++diff --git a/tests/runtime/test_clSetEventCallback_expout.txt b/tests/runtime/test_clSetEventCallback_expout.txt
++index 1e54c4ea..3e8ac377 100644
++--- a/tests/runtime/test_clSetEventCallback_expout.txt
+++++ b/tests/runtime/test_clSetEventCallback_expout.txt
++@@ -1,3 +1,4 @@
++ Callback function: event status: CL_SUBMITTED
++ Callback function: event status: CL_RUNNING
++ Callback function: event status: CL_COMPLETE
+++OK
++diff --git a/tests/runtime/test_enqueue_kernel_from_binary.c b/tests/runtime/test_enqueue_kernel_from_binary.c
++index 883682e8..a2a25c9f 100644
++--- a/tests/runtime/test_enqueue_kernel_from_binary.c
+++++ b/tests/runtime/test_enqueue_kernel_from_binary.c
++@@ -438,5 +438,6 @@ int main(void)
++ 
++   if (errors)
++     return EXIT_FAILURE;
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_event_cycle.c b/tests/runtime/test_event_cycle.c
++index 37a087bb..6f85af46 100644
++--- a/tests/runtime/test_event_cycle.c
+++++ b/tests/runtime/test_event_cycle.c
++@@ -139,5 +139,7 @@ main(void)
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ #endif
+++
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_event_double_wait.c b/tests/runtime/test_event_double_wait.c
++index 3531659e..5346cb7e 100644
++--- a/tests/runtime/test_event_double_wait.c
+++++ b/tests/runtime/test_event_double_wait.c
++@@ -65,8 +65,8 @@ int main(int argc, char **argv)
++   CHECK_CL_ERROR (clReleaseContext (ctx));
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++-
++ }
++ 
++ 
++diff --git a/tests/runtime/test_event_free.c b/tests/runtime/test_event_free.c
++index 85d5af19..198a80ba 100644
++--- a/tests/runtime/test_event_free.c
+++++ b/tests/runtime/test_event_free.c
++@@ -230,8 +230,8 @@ int main(int argc, char **argv)
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++-
++ }
++ 
++ 
++diff --git a/tests/runtime/test_fill-buffer.c b/tests/runtime/test_fill-buffer.c
++index 257df2e0..1e719882 100644
++--- a/tests/runtime/test_fill-buffer.c
+++++ b/tests/runtime/test_fill-buffer.c
++@@ -153,5 +153,6 @@ main (void)
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_link_error.c b/tests/runtime/test_link_error.c
++index 3d48ecb5..5ffd34fa 100644
++--- a/tests/runtime/test_link_error.c
+++++ b/tests/runtime/test_link_error.c
++@@ -68,5 +68,6 @@ main(void){
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_read-copy-write-buffer.c b/tests/runtime/test_read-copy-write-buffer.c
++index 61ead4db..6b69bda6 100644
++--- a/tests/runtime/test_read-copy-write-buffer.c
+++++ b/tests/runtime/test_read-copy-write-buffer.c
++@@ -137,5 +137,6 @@ main(void)
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++ }
++diff --git a/tests/runtime/test_user_event.c b/tests/runtime/test_user_event.c
++index 454e4b4d..2a1d8af2 100644
++--- a/tests/runtime/test_user_event.c
+++++ b/tests/runtime/test_user_event.c
++@@ -83,6 +83,6 @@ int main()
++ 
++   CHECK_CL_ERROR (clUnloadCompiler ());
++ 
+++  printf ("OK\n");
++   return EXIT_SUCCESS;
++-
++ }
++diff --git a/tests/workgroup/basic_barriers_2_2_2_2.stdout b/tests/workgroup/basic_barriers_2_2_2_2.stdout
++index 3f04e021..0338d8bc 100644
++--- a/tests/workgroup/basic_barriers_2_2_2_2.stdout
+++++ b/tests/workgroup/basic_barriers_2_2_2_2.stdout
++@@ -46,3 +46,4 @@
++ 3 0 1: after barriers
++ 2 1 1: after barriers
++ 3 1 1: after barriers
+++OK
++diff --git a/tests/workgroup/cond_barriers_1_2_1_1.stdout b/tests/workgroup/cond_barriers_1_2_1_1.stdout
++index fbc76377..3df3a1a6 100644
++--- a/tests/workgroup/cond_barriers_1_2_1_1.stdout
+++++ b/tests/workgroup/cond_barriers_1_2_1_1.stdout
++@@ -4,3 +4,4 @@ LOCAL_ID=0 inside if
++ LOCAL_ID=1 inside if
++ LOCAL_ID=0 after if
++ LOCAL_ID=1 after if
+++OK
++diff --git a/tests/workgroup/cond_barriers_in_for_2_4_1_1.stdout b/tests/workgroup/cond_barriers_in_for_2_4_1_1.stdout
++index 3421353b..0c229519 100644
++--- a/tests/workgroup/cond_barriers_in_for_2_4_1_1.stdout
+++++ b/tests/workgroup/cond_barriers_in_for_2_4_1_1.stdout
++@@ -6,3 +6,4 @@
++ 5: 17
++ 6: 18
++ 7: 19
+++OK
++diff --git a/tests/workgroup/for_bug_1_2_1_1.stdout b/tests/workgroup/for_bug_1_2_1_1.stdout
++index baeb8ec2..b3851d4e 100644
++--- a/tests/workgroup/for_bug_1_2_1_1.stdout
+++++ b/tests/workgroup/for_bug_1_2_1_1.stdout
++@@ -31,3 +31,4 @@ gid_x 1 after barrier at iteration 2
++ gid_x 0 after barrier at iteration 1
++ gid_x 1 after barrier at iteration 1
++ OK
+++OK
++diff --git a/tests/workgroup/for_with_divergent_return_1_6_1_1.stdout b/tests/workgroup/for_with_divergent_return_1_6_1_1.stdout
++index 344aae10..a43deded 100644
++--- a/tests/workgroup/for_with_divergent_return_1_6_1_1.stdout
+++++ b/tests/workgroup/for_with_divergent_return_1_6_1_1.stdout
++@@ -4,3 +4,4 @@
++ 3: -2
++ 4: 100
++ 5: 100
+++OK
++diff --git a/tests/workgroup/forloops_2_2_1_1.stdout b/tests/workgroup/forloops_2_2_1_1.stdout
++index afc5a303..9e3dab30 100644
++--- a/tests/workgroup/forloops_2_2_1_1.stdout
+++++ b/tests/workgroup/forloops_2_2_1_1.stdout
++@@ -2,3 +2,4 @@
++ 1: 1
++ 2: 2
++ 3: 3
+++OK
++diff --git a/tests/workgroup/implicit_barriers_1_2_1_1.stdout b/tests/workgroup/implicit_barriers_1_2_1_1.stdout
++index 02bf5ba1..f4d157d2 100644
++--- a/tests/workgroup/implicit_barriers_1_2_1_1.stdout
+++++ b/tests/workgroup/implicit_barriers_1_2_1_1.stdout
++@@ -8,3 +8,4 @@ LOCAL_ID=0 inside for, iteration 1, value 1
++ LOCAL_ID=1 inside for, iteration 1, value 1
++ LOCAL_ID=0 after if
++ LOCAL_ID=1 after if
+++OK
++diff --git a/tests/workgroup/issue_548_1_2_1_1.stdout b/tests/workgroup/issue_548_1_2_1_1.stdout
++index e9a4cfc3..d26d71b1 100644
++--- a/tests/workgroup/issue_548_1_2_1_1.stdout
+++++ b/tests/workgroup/issue_548_1_2_1_1.stdout
++@@ -6,3 +6,4 @@ id=1: CCC.
++ auxfunc
++ id=0: EEE.
++ id=1: EEE.
+++OK
++diff --git a/tests/workgroup/loopbarriers_1_4_1_1.stdout b/tests/workgroup/loopbarriers_1_4_1_1.stdout
++index a61b0fee..50361810 100644
++--- a/tests/workgroup/loopbarriers_1_4_1_1.stdout
+++++ b/tests/workgroup/loopbarriers_1_4_1_1.stdout
++@@ -2,3 +2,4 @@
++ 1: 2002
++ 2: 3002
++ 3: 2
+++OK
++diff --git a/tests/workgroup/multilatch_bloop_1_3_1_1.stdout b/tests/workgroup/multilatch_bloop_1_3_1_1.stdout
++index 5fdfcde2..0e088243 100644
++--- a/tests/workgroup/multilatch_bloop_1_3_1_1.stdout
+++++ b/tests/workgroup/multilatch_bloop_1_3_1_1.stdout
++@@ -16,3 +16,4 @@ i:1 1 0 0 after latch 1
++ i:1 2 0 0 after barrier
++ i:1 2 0 0 after latch 1
++ i:1 2 0 0 after latch 2
+++OK
++diff --git a/tests/workgroup/outerlooppar_2_2_1_1.stdout b/tests/workgroup/outerlooppar_2_2_1_1.stdout
++index abdf59c6..9a79b23b 100644
++--- a/tests/workgroup/outerlooppar_2_2_1_1.stdout
+++++ b/tests/workgroup/outerlooppar_2_2_1_1.stdout
++@@ -24,3 +24,4 @@ i: 0 gid: 2
++ i: 1 gid: 2
++ i: 0 gid: 3
++ i: 1 gid: 3
+++OK
++diff --git a/tests/workgroup/print_all_ids_114114.txt b/tests/workgroup/print_all_ids_114114.txt
++index 9bb138d0..f25640e0 100644
++--- a/tests/workgroup/print_all_ids_114114.txt
+++++ b/tests/workgroup/print_all_ids_114114.txt
++@@ -1,3 +1,4 @@
+++OK
++ global: 0-0-0
++ global: 0-0-1
++ global: 0-0-2
++diff --git a/tests/workgroup/range_md.stdout b/tests/workgroup/range_md.stdout
++index 89e85a87..18f19c1a 100644
++--- a/tests/workgroup/range_md.stdout
+++++ b/tests/workgroup/range_md.stdout
++@@ -9,3 +9,4 @@
++ 7: 0
++ 8: 0
++ 9: 0
+++OK
++diff --git a/tests/workgroup/range_md_small_grid.stdout b/tests/workgroup/range_md_small_grid.stdout
++index 4550decc..fd55a10a 100644
++--- a/tests/workgroup/range_md_small_grid.stdout
+++++ b/tests/workgroup/range_md_small_grid.stdout
++@@ -11,3 +11,4 @@
++ 10: 0
++ 11: 0
++ 12: 0
+++OK
++diff --git a/tests/workgroup/run_kernel.c b/tests/workgroup/run_kernel.c
++index f8d4b95c..92ef7f04 100644
++--- a/tests/workgroup/run_kernel.c
+++++ b/tests/workgroup/run_kernel.c
++@@ -152,6 +152,7 @@ ERROR:
++ 
++   if (err == CL_SUCCESS)
++     {
+++      printf ("OK\n");
++       return EXIT_SUCCESS;
++     }
++   return EXIT_FAILURE;
++diff --git a/tests/workgroup/switch_case_1_4_1_1.stdout b/tests/workgroup/switch_case_1_4_1_1.stdout
++index 15882c24..c1bef1e6 100644
++--- a/tests/workgroup/switch_case_1_4_1_1.stdout
+++++ b/tests/workgroup/switch_case_1_4_1_1.stdout
++@@ -2,3 +2,4 @@
++ 1: 101
++ 2: 99
++ 3: 303
+++OK
++diff --git a/tests/workgroup/tricky_for_1_2_1_1.stdout b/tests/workgroup/tricky_for_1_2_1_1.stdout
++index 7b6f3ced..4b4b5ee4 100644
++--- a/tests/workgroup/tricky_for_1_2_1_1.stdout
+++++ b/tests/workgroup/tricky_for_1_2_1_1.stdout
++@@ -1,2 +1,3 @@
++ 0: 1000
++ 1: 2000
+++OK
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..da1561d9f23bd0c9153850b54795d8a868117872
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,161 @@@
++From 25b6099564d27e7872a3275e6a3eedc585e6630e Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 25 Nov 2021 00:35:49 +0100
++Subject: [PATCH 133/144] consistently use add_test(NAME ... COMMAND ...)
++
++---
++ examples/boxadd/CMakeLists.txt    | 2 +-
++ examples/example0/CMakeLists.txt  | 4 ++--
++ examples/example1/CMakeLists.txt  | 4 ++--
++ examples/example2/CMakeLists.txt  | 2 +-
++ examples/example2a/CMakeLists.txt | 2 +-
++ examples/matadd/CMakeLists.txt    | 2 +-
++ examples/matrix1/CMakeLists.txt   | 4 ++--
++ examples/trig/CMakeLists.txt      | 2 +-
++ examples/vecadd/CMakeLists.txt    | 4 ++--
++ 9 files changed, 13 insertions(+), 13 deletions(-)
++
++diff --git a/examples/boxadd/CMakeLists.txt b/examples/boxadd/CMakeLists.txt
++index a7a758d0..10b4a65b 100644
++--- a/examples/boxadd/CMakeLists.txt
+++++ b/examples/boxadd/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("boxadd" boxadd.c boxadd_exec.c boxadd.cl)
++ 
++ target_link_libraries("boxadd" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/boxadd" "boxadd")
+++add_test(NAME "examples/boxadd" COMMAND "boxadd")
++ 
++ set(PROPS)
++ if(NOT ENABLE_ANYSAN)
++diff --git a/examples/example0/CMakeLists.txt b/examples/example0/CMakeLists.txt
++index 4f527d0d..f4f9f0a6 100644
++--- a/examples/example0/CMakeLists.txt
+++++ b/examples/example0/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("example0" example0.c example0_exec.c example0.cl)
++ 
++ target_link_libraries("example0" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/example0" "example0")
+++add_test(NAME "examples/example0" COMMAND "example0")
++ 
++ if (ENABLE_SPIR)
++   add_test(NAME "examples/example0_spir"
++@@ -46,7 +46,7 @@ if (ENABLE_SPIR)
++ endif()
++ 
++ if (ENABLE_SPIRV)
++-  add_test("examples/example0_spirv" "example0" "v")
+++  add_test(NAME "examples/example0_spirv" COMMAND "example0" "v")
++   list(APPEND SPIREX "examples/example0_spirv")
++ endif()
++ 
++diff --git a/examples/example1/CMakeLists.txt b/examples/example1/CMakeLists.txt
++index ccdf09de..e7e3dbf6 100644
++--- a/examples/example1/CMakeLists.txt
+++++ b/examples/example1/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("example1" example1.c example1_exec.c example1.cl)
++ 
++ target_link_libraries("example1" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/example1_dot_product" "example1")
+++add_test(NAME "examples/example1_dot_product" COMMAND "example1")
++ 
++ if (ENABLE_SPIR)
++   add_test(NAME "examples/example1_spir"
++@@ -46,7 +46,7 @@ if (ENABLE_SPIR)
++ endif()
++ 
++ if (ENABLE_SPIRV)
++-  add_test("examples/example1_spirv" "example1" "v")
+++     add_test(NAME "examples/example1_spirv" COMMAND "example1" "v")
++   list(APPEND SPIREX "examples/example1_spirv")
++ endif()
++ 
++diff --git a/examples/example2/CMakeLists.txt b/examples/example2/CMakeLists.txt
++index 81f6b08a..731d6d3b 100644
++--- a/examples/example2/CMakeLists.txt
+++++ b/examples/example2/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("example2" example2.c example2.cl)
++ 
++ target_link_libraries("example2" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/example2" "example2")
+++add_test(NAME "examples/example2" COMMAND "example2")
++ 
++ if (ENABLE_SPIR)
++   add_test(NAME "examples/example2_spir"
++diff --git a/examples/example2a/CMakeLists.txt b/examples/example2a/CMakeLists.txt
++index 57e5d033..8637e539 100644
++--- a/examples/example2a/CMakeLists.txt
+++++ b/examples/example2a/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("example2a" example2a.c example2a.cl)
++ 
++ target_link_libraries("example2a" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/example2a" "example2a")
+++add_test(NAME "examples/example2a" COMMAND "example2a")
++ 
++ if (ENABLE_SPIR)
++   add_test(NAME "examples/example2a_spir"
++diff --git a/examples/matadd/CMakeLists.txt b/examples/matadd/CMakeLists.txt
++index 3c7c98c6..21ea20ba 100644
++--- a/examples/matadd/CMakeLists.txt
+++++ b/examples/matadd/CMakeLists.txt
++@@ -32,7 +32,7 @@ add_executable("matadd" matadd.c matadd_exec.c matadd.cl)
++ 
++ target_link_libraries("matadd" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/matadd" "matadd")
+++add_test(NAME "examples/matadd" COMMAND "matadd")
++ 
++ set(PROPS)
++ if(NOT ENABLE_ANYSAN)
++diff --git a/examples/matrix1/CMakeLists.txt b/examples/matrix1/CMakeLists.txt
++index 447162ff..9710fe65 100644
++--- a/examples/matrix1/CMakeLists.txt
+++++ b/examples/matrix1/CMakeLists.txt
++@@ -32,9 +32,9 @@ add_executable("matrix1" matrix1.c matrix1.cl)
++ 
++ target_link_libraries("matrix1" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/matrix1" "matrix1" 512)
+++add_test(NAME "examples/matrix1" COMMAND "matrix1" 512)
++ 
++-add_test("examples/matrix1_local" "matrix1" 512 -l)
+++add_test(NAME "examples/matrix1_local" COMMAND "matrix1" 512 -l)
++ 
++ if (ENABLE_SPIR)
++   add_test(NAME "examples/matrix1_spir"
++diff --git a/examples/trig/CMakeLists.txt b/examples/trig/CMakeLists.txt
++index a650ab97..da910766 100644
++--- a/examples/trig/CMakeLists.txt
+++++ b/examples/trig/CMakeLists.txt
++@@ -34,7 +34,7 @@ add_executable("trig" trig.c trig.cl trig_exec.c)
++ 
++ target_link_libraries("trig" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/trig" "trig")
+++add_test(NAME "examples/trig" COMMAND "trig")
++ 
++ set(PROPS)
++ if(NOT ENABLE_ANYSAN)
++diff --git a/examples/vecadd/CMakeLists.txt b/examples/vecadd/CMakeLists.txt
++index 03a5d05c..1cea2fae 100644
++--- a/examples/vecadd/CMakeLists.txt
+++++ b/examples/vecadd/CMakeLists.txt
++@@ -32,9 +32,9 @@ add_executable("vecadd" vecadd.c vecadd_exec.c vecadd.cl)
++ 
++ target_link_libraries("vecadd" ${POCLU_LINK_OPTIONS})
++ 
++-add_test("examples/vecadd" "vecadd")
+++add_test(NAME "examples/vecadd" COMMAND "vecadd")
++ 
++-add_test("examples/vecadd_large_grid" "vecadd" "128000" "128" "10000" "100" "1" "1")
+++add_test(NAME "examples/vecadd_large_grid" COMMAND "vecadd" "128000" "128" "10000" "100" "1" "1")
++ 
++ set(PROPS)
++ if(NOT ENABLE_ANYSAN)
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..74877f0c8f493859c7056c2fe32fdb0cd8116ed6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,94 @@@
++From a9b4308ffe3e0787a8172d5ac25ed73df67b5f8e Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Thu, 25 Nov 2021 01:30:54 +0100
++Subject: [PATCH 134/144] fix unlabeled tests
++
++---
++ tests/CMakeLists.txt           | 9 ++++++++-
++ tests/runtime/CMakeLists.txt   | 2 ++
++ tests/workgroup/CMakeLists.txt | 1 +
++ 3 files changed, 11 insertions(+), 1 deletion(-)
++
++diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
++index ae3f9f26..fe8a207a 100644
++--- a/tests/CMakeLists.txt
+++++ b/tests/CMakeLists.txt
++@@ -40,42 +40,49 @@ endif()
++ if (UNIX AND ENABLE_LOADABLE_DRIVERS)
++ 
++ add_test(NAME pocl_test_dlopen_libpocl COMMAND test_dlopen)
+++set_tests_properties("pocl_test_dlopen_libpocl" PROPERTIES LABELS "internal;dlopen;vulkan")
++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_libpocl")
++ 
++ if(BUILD_BASIC)
++   add_test(NAME pocl_test_dlopen_device_basic COMMAND test_dlopen basic)
+++  set_tests_properties("pocl_test_dlopen_device_basic" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_basic")
++ endif()
++ 
++ if(BUILD_PTHREAD)
++   add_test(NAME pocl_test_dlopen_device_pthread COMMAND test_dlopen pthread)
+++  set_tests_properties("pocl_test_dlopen_device_pthread" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_pthread")
++ endif()
++ 
++ if(BUILD_ACCEL)
++   add_test(NAME pocl_test_dlopen_device_accel COMMAND test_dlopen accel)
+++  set_tests_properties("pocl_test_dlopen_device_accel" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_accel")
++ endif()
++ 
++ if(ENABLE_TCE)
++   add_test(NAME pocl_test_dlopen_device_tce COMMAND test_dlopen tce)
+++  set_tests_properties("pocl_test_dlopen_device_tce" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_tce")
++ endif()
++ 
++ if(ENABLE_HSA)
++   add_test(NAME pocl_test_dlopen_device_hsa COMMAND test_dlopen hsa)
+++  set_tests_properties("pocl_test_dlopen_device_hsa" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_hsa")
++ endif()
++ 
++ if(ENABLE_CUDA)
++   add_test(NAME pocl_test_dlopen_device_cuda COMMAND test_dlopen cuda)
+++  set_tests_properties("pocl_test_dlopen_device_cuda" PROPERTIES LABELS "internal;dlopen")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_cuda")
++ endif()
++ 
++ if(ENABLE_VULKAN)
++   add_test(NAME pocl_test_dlopen_device_vulkan COMMAND test_dlopen vulkan)
+++  set_tests_properties("pocl_test_dlopen_device_vulkan" PROPERTIES LABELS "internal;dlopen;vulkan")
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_vulkan")
++-  set_property(TEST "pocl_version_check" "pocl_test_dlopen_libpocl" "pocl_test_dlopen_device_vulkan" APPEND PROPERTY LABELS "vulkan")
++ endif()
++ 
++ endif ()
++diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt
++index fb4bc362..7c733429 100644
++--- a/tests/runtime/CMakeLists.txt
+++++ b/tests/runtime/CMakeLists.txt
++@@ -126,6 +126,8 @@ set_tests_properties( "runtime/clGetDeviceInfo" "runtime/clEnqueueNativeKernel"
++   "runtime/test_fill-buffer"
++   "runtime/test_event_free" "runtime/test_event_double_wait" "runtime/clCreateSubDevices"
++   "runtime/test_enqueue_kernel_from_binary" "runtime/test_user_event"
+++  "runtime/test_buffer_migration"
+++  "runtime/test_buffer_ping_pong"
++   "runtime/clSetMemObjectDestructorCallback" "runtime/test_link_error"
++   "runtime/test_cl_pocl_content_size"
++ 
++diff --git a/tests/workgroup/CMakeLists.txt b/tests/workgroup/CMakeLists.txt
++index 3126b22e..cd730a66 100644
++--- a/tests/workgroup/CMakeLists.txt
+++++ b/tests/workgroup/CMakeLists.txt
++@@ -72,6 +72,7 @@ set_tests_properties(
++   "workgroup/switch_case"
++   "workgroup/b_loop_with_none_of_the_WIs_reaching_the_barrier"
++   "workgroup/for_with_divergent_return"
+++  "workgroup/cond_barriers_in_for"
++   PROPERTIES
++     COST 2.0
++     PROCESSORS 1
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..794dbdfc985b003093fe22644f32fba726581b24
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,91 @@@
++From 11e2b36c2d55f07eb05fc101bf6c14df443610f5 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 24 Nov 2021 10:29:45 +0100
++Subject: [PATCH 135/144] skip tests that require unavailable devices
++
++do not silently let them "pass"
++77 is the return code used by GNU autotest to indicate SKIP
++---
++ tests/runtime/CMakeLists.txt              | 12 +++++++++---
++ tests/runtime/test_buffer_migration.c     |  2 +-
++ tests/runtime/test_buffer_ping_pong.c     |  2 +-
++ tests/runtime/test_cl_pocl_content_size.c |  3 +--
++ 4 files changed, 12 insertions(+), 7 deletions(-)
++
++diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt
++index 7c733429..1bd90c97 100644
++--- a/tests/runtime/CMakeLists.txt
+++++ b/tests/runtime/CMakeLists.txt
++@@ -106,13 +106,13 @@ add_test_pocl(NAME "runtime/test_enqueue_kernel_from_binary" COMMAND "test_enque
++ 
++ add_test_pocl(NAME "runtime/test_user_event" COMMAND  "test_user_event")
++ 
++-add_test_pocl(NAME "runtime/test_buffer_migration" COMMAND  "test_buffer_migration")
+++add_test(NAME "runtime/test_buffer_migration" COMMAND "test_buffer_migration")
++ 
++-add_test_pocl(NAME "runtime/test_buffer_ping_pong" COMMAND  "test_buffer_ping_pong")
+++add_test(NAME "runtime/test_buffer_ping_pong" COMMAND "test_buffer_ping_pong")
++ 
++ add_test_pocl(NAME "runtime/clSetMemObjectDestructorCallback" COMMAND  "test_clSetMemObjectDestructorCallback")
++ 
++-add_test_pocl(NAME "runtime/test_cl_pocl_content_size" COMMAND "test_cl_pocl_content_size")
+++add_test(NAME "runtime/test_cl_pocl_content_size" COMMAND "test_cl_pocl_content_size")
++ 
++ set_tests_properties( "runtime/clGetDeviceInfo" "runtime/clEnqueueNativeKernel"
++   "runtime/clGetEventInfo" "runtime/clCreateProgramWithBinary"
++@@ -136,6 +136,12 @@ set_tests_properties( "runtime/clGetDeviceInfo" "runtime/clEnqueueNativeKernel"
++     DEPENDS "pocl_version_check"
++     LABELS "internal;runtime")
++ 
+++set_tests_properties(
+++  "runtime/test_buffer_migration"
+++  "runtime/test_buffer_ping_pong"
+++  "runtime/test_cl_pocl_content_size"
+++  PROPERTIES SKIP_RETURN_CODE 77)
+++
++ if(NOT ENABLE_ANYSAN)
++   set_tests_properties("runtime/clCreateKernelsInProgram"
++   PROPERTIES
++diff --git a/tests/runtime/test_buffer_migration.c b/tests/runtime/test_buffer_migration.c
++index 69efba91..b0ed2fc4 100644
++--- a/tests/runtime/test_buffer_migration.c
+++++ b/tests/runtime/test_buffer_migration.c
++@@ -61,7 +61,7 @@ main (int argc, char **argv)
++   if (num_devices < 2)
++     {
++       printf ("NOT ENOUGH DEVICES! (need 2)\n");
++-      exit(0);
+++      return 77;
++     }
++ 
++   const char *basename = "migration_test";
++diff --git a/tests/runtime/test_buffer_ping_pong.c b/tests/runtime/test_buffer_ping_pong.c
++index 215c093c..f42e413f 100644
++--- a/tests/runtime/test_buffer_ping_pong.c
+++++ b/tests/runtime/test_buffer_ping_pong.c
++@@ -107,7 +107,7 @@ main (int argc, char **argv)
++   if (num_devices < 2)
++     {
++       printf ("NOT ENOUGH DEVICES! (need 2)\n");
++-      exit(0);
+++      return 77;
++     }
++ 
++   err = clSetKernelArg (kernel_a, 0, sizeof (cl_mem), &buf);
++diff --git a/tests/runtime/test_cl_pocl_content_size.c b/tests/runtime/test_cl_pocl_content_size.c
++index 638f0bf3..e5171f40 100644
++--- a/tests/runtime/test_cl_pocl_content_size.c
+++++ b/tests/runtime/test_cl_pocl_content_size.c
++@@ -57,8 +57,7 @@ main (void)
++   if (strstr (devname, "basic") == NULL && strstr (devname, "pthread") == NULL)
++     {
++       printf ("Device is not basic/pthread -> skipping test\n");
++-      printf ("OK");
++-      return 0;
+++      return 77;
++     }
++ 
++   buf_content_src
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d85540a4f1d6790c098e259d272a2d87f5ebf27a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,85 @@@
++From 88091f07e8f6289b33178e14c18aef036399e277 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 24 Nov 2021 10:46:50 +0100
++Subject: [PATCH 136/144] skip subdevice tests on devices with only 1 compute
++ unit
++
++do not let them fail
++---
++ examples/EinsteinToolkit/CMakeLists.txt    |  1 +
++ examples/EinsteinToolkit/EinsteinToolkit.c | 12 ++++++++++++
++ tests/runtime/CMakeLists.txt               |  3 ++-
++ tests/runtime/test_clCreateSubDevices.c    |  2 +-
++ 4 files changed, 16 insertions(+), 2 deletions(-)
++
++diff --git a/examples/EinsteinToolkit/CMakeLists.txt b/examples/EinsteinToolkit/CMakeLists.txt
++index 704a02e7..139d1c61 100644
++--- a/examples/EinsteinToolkit/CMakeLists.txt
+++++ b/examples/EinsteinToolkit/CMakeLists.txt
++@@ -54,5 +54,6 @@ if(NOT MIPS)
++     COST 15.0
++     LABELS "EinsteinToolkit"
++     ENVIRONMENT "POCL_AFFINITY=1"
+++    SKIP_RETURN_CODE 77
++     DEPENDS "pocl_version_check")
++ endif()
++diff --git a/examples/EinsteinToolkit/EinsteinToolkit.c b/examples/EinsteinToolkit/EinsteinToolkit.c
++index b0476017..6fd8789e 100644
++--- a/examples/EinsteinToolkit/EinsteinToolkit.c
+++++ b/examples/EinsteinToolkit/EinsteinToolkit.c
++@@ -524,6 +524,18 @@ void setup(const char* program_source1, const char* program_source2)
++ 
++   if (use_subdev)
++     {
+++      {
+++        cl_uint max_cus;
+++        int err = clGetDeviceInfo (main_device_id, CL_DEVICE_MAX_COMPUTE_UNITS,
+++                                   sizeof (max_cus), &max_cus, NULL);
+++        assert (err == CL_SUCCESS);
+++        if (max_cus < 2)
+++          {
+++            fprintf (stderr,
+++                     "Insufficient compute units for subdevice creation\n");
+++            exit (77);
+++          }
+++      }
++       const cl_device_partition_property props[]
++           = { CL_DEVICE_PARTITION_EQUALLY, 2, 0 };
++       cl_device_id subdevs[128];
++diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt
++index 1bd90c97..6c4314b9 100644
++--- a/tests/runtime/CMakeLists.txt
+++++ b/tests/runtime/CMakeLists.txt
++@@ -96,7 +96,7 @@ add_test_pocl(NAME "runtime/clGetSupportedImageFormats" COMMAND "test_clGetSuppo
++ 
++ add_test_pocl(NAME "runtime/clCreateKernelsInProgram" COMMAND "test_clCreateKernelsInProgram")
++ 
++-add_test_pocl(NAME "runtime/clCreateSubDevices" COMMAND  "test_clCreateSubDevices")
+++add_test(NAME "runtime/clCreateSubDevices" COMMAND  "test_clCreateSubDevices")
++ 
++ add_test_pocl(NAME "runtime/test_event_free" COMMAND  "test_event_free")
++ 
++@@ -137,6 +137,7 @@ set_tests_properties( "runtime/clGetDeviceInfo" "runtime/clEnqueueNativeKernel"
++     LABELS "internal;runtime")
++ 
++ set_tests_properties(
+++  "runtime/clCreateSubDevices"
++   "runtime/test_buffer_migration"
++   "runtime/test_buffer_ping_pong"
++   "runtime/test_cl_pocl_content_size"
++diff --git a/tests/runtime/test_clCreateSubDevices.c b/tests/runtime/test_clCreateSubDevices.c
++index fd80fd4f..95412d1c 100644
++--- a/tests/runtime/test_clCreateSubDevices.c
+++++ b/tests/runtime/test_clCreateSubDevices.c
++@@ -140,7 +140,7 @@ int main(int argc, char **argv)
++     {
++       printf("This test requires a cl device with at least 2 compute units"
++              " (a dual-core or better CPU)\n");
++-      return 1;
+++      return 77;
++     }
++ 
++   err = clGetDeviceInfo(rootdev, CL_DEVICE_PARTITION_MAX_SUB_DEVICES,
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c9251cc8d2c895635c2ec9c09860ce42e26ad74b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,103 @@@
++From 43e6cab5ec719b9773441562a6de1cd701700e14 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 30 Nov 2021 23:04:21 +0100
++Subject: [PATCH 137/144] add poclu_show_program_build_log(cl_program)
++
++---
++ include/poclu.h  |  2 ++
++ lib/poclu/misc.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++
++ 2 files changed, 68 insertions(+)
++
++diff --git a/include/poclu.h b/include/poclu.h
++index 8ffb2b14..d5c7526e 100644
++--- a/include/poclu.h
+++++ b/include/poclu.h
++@@ -124,6 +124,8 @@ int poclu_load_program_multidev (cl_context context, cl_device_id *devices,
++                                  const char *explicit_binary,
++                                  const char *extra_build_opts, cl_program *p);
++ 
+++POCLU_API cl_int POCLU_CALL poclu_show_program_build_log (cl_program program);
+++
++ /* In case cl_err != CL_SUCCESS, prints out the error +
++  * function : line to stderr, and returns 1, otherwise
++  * returns 0
++diff --git a/lib/poclu/misc.c b/lib/poclu/misc.c
++index 697a99cf..967db3f0 100644
++--- a/lib/poclu/misc.c
+++++ b/lib/poclu/misc.c
++@@ -198,6 +198,72 @@ poclu_write_file (const char *filemane, char *content, size_t size)
++   return 0;
++ }
++ 
+++cl_int
+++poclu_show_program_build_log (cl_program program)
+++{
+++  cl_int err;
+++  cl_uint num_devices;
+++  cl_device_id *devices;
+++
+++  err = clGetProgramInfo (program, CL_PROGRAM_NUM_DEVICES,
+++                          sizeof (num_devices), &num_devices, NULL);
+++  if (err != CL_SUCCESS)
+++    goto fail;
+++
+++  devices = (cl_device_id *)malloc (sizeof (cl_device_id) * num_devices);
+++  if (!devices)
+++    {
+++      err = CL_OUT_OF_HOST_MEMORY;
+++      goto fail;
+++    }
+++
+++  err = clGetProgramInfo (program, CL_PROGRAM_DEVICES,
+++                          sizeof (cl_device_id) * num_devices, devices, NULL);
+++  if (err != CL_SUCCESS)
+++    goto fail2;
+++
+++  for (cl_uint i = 0; i < num_devices; ++i)
+++    {
+++      char *log;
+++      size_t log_size;
+++
+++      err = clGetProgramBuildInfo (program, devices[i], CL_PROGRAM_BUILD_LOG,
+++                                   0, NULL, &log_size);
+++      if (err != CL_SUCCESS)
+++        goto fail2;
+++
+++      log = (char *)malloc (log_size);
+++      if (!log)
+++        {
+++          err = CL_OUT_OF_HOST_MEMORY;
+++          goto fail2;
+++        }
+++
+++      err = clGetProgramBuildInfo (program, devices[i], CL_PROGRAM_BUILD_LOG,
+++                                   log_size, log, NULL);
+++      if (err != CL_SUCCESS)
+++        {
+++          free (log);
+++          goto fail2;
+++        }
+++
+++      if (num_devices > 1)
+++        fprintf (stderr, "device %d/%d:\n", i, num_devices);
+++      fprintf (stderr, "%s\n", log);
+++
+++      free (log);
+++    }
+++
+++  err = CL_SUCCESS;
+++
+++fail2:
+++  free (devices);
+++
+++fail:
+++  check_cl_error (err, __LINE__, __PRETTY_FUNCTION__);
+++  return err;
+++}
+++
++ #define OPENCL_ERROR_CASE(ERR) \
++   case ERR:                                                             \
++   { fprintf (stderr, "" #ERR " in %s on line %i\n", func_name, line);   \
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3a206556c6ec77928aed6d181981629ea10f89bf
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++From f0870f8c92eda1c29ccc531f4cd84842ee001024 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 30 Nov 2021 23:16:11 +0100
++Subject: [PATCH 138/144] tests: (run_)kernel.c: show build log after
++ clBuildProgram() failed
++
++---
++ tests/kernel/kernel.c        | 1 +
++ tests/workgroup/run_kernel.c | 2 ++
++ 2 files changed, 3 insertions(+)
++
++diff --git a/tests/kernel/kernel.c b/tests/kernel/kernel.c
++index 25dd4d53..fbf504d4 100644
++--- a/tests/kernel/kernel.c
+++++ b/tests/kernel/kernel.c
++@@ -75,6 +75,7 @@ int call_test(const char *name)
++   result = clBuildProgram(program, 0, NULL, "-I" SRCDIR, NULL, NULL);
++   if (result != CL_SUCCESS) {
++     puts("clBuildProgram call failed\n");
+++    poclu_show_program_build_log (program);
++     goto error;
++   }
++ 
++diff --git a/tests/workgroup/run_kernel.c b/tests/workgroup/run_kernel.c
++index 92ef7f04..7a7da4a5 100644
++--- a/tests/workgroup/run_kernel.c
+++++ b/tests/workgroup/run_kernel.c
++@@ -95,6 +95,8 @@ main (int argc, char **argv)
++   CHECK_CL_ERROR2 (err);
++ 
++   err = clBuildProgram (program, 0, NULL, NULL, NULL, NULL);
+++  if (err != CL_SUCCESS)
+++    poclu_show_program_build_log (program);
++   CHECK_CL_ERROR2 (err);
++ 
++   kernel = clCreateKernel (program, "test_kernel", &err);
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f05a7527f6acbd68493eb366f3df7481d1c23389
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,76 @@@
++From 2e5a82f8ed1d3edb2ab30bd36df81f25be27182f Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 6 Dec 2021 18:03:05 +0100
++Subject: [PATCH 139/144] do not dlopen(libpocl.so) without ENABLE_ICD
++
++---
++ tests/CMakeLists.txt        | 10 ++++++++--
++ tests/runtime/test_dlopen.c |  4 ++++
++ 2 files changed, 12 insertions(+), 2 deletions(-)
++
++diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
++index fe8a207a..8b185a65 100644
++--- a/tests/CMakeLists.txt
+++++ b/tests/CMakeLists.txt
++@@ -37,11 +37,15 @@ if(ENABLE_HOST_CPU_DEVICES)
++ endif()
++ 
++ #######################################################################
++-if (UNIX AND ENABLE_LOADABLE_DRIVERS)
+++if(UNIX AND HAVE_DLFCN_H)
++ 
+++if(ENABLE_ICD)
++ add_test(NAME pocl_test_dlopen_libpocl COMMAND test_dlopen)
++ set_tests_properties("pocl_test_dlopen_libpocl" PROPERTIES LABELS "internal;dlopen;vulkan")
++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_libpocl")
+++endif()
+++
+++if(ENABLE_LOADABLE_DRIVERS)
++ 
++ if(BUILD_BASIC)
++   add_test(NAME pocl_test_dlopen_device_basic COMMAND test_dlopen basic)
++@@ -85,7 +89,9 @@ if(ENABLE_VULKAN)
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_vulkan")
++ endif()
++ 
++-endif ()
+++endif()
+++
+++endif()
++ #######################################################################
++ 
++ add_subdirectory("kernel")
++diff --git a/tests/runtime/test_dlopen.c b/tests/runtime/test_dlopen.c
++index f586c1f4..b3b525e1 100644
++--- a/tests/runtime/test_dlopen.c
+++++ b/tests/runtime/test_dlopen.c
++@@ -43,6 +43,7 @@ main (int argc, char **argv)
++               SHLIB_ORIGIN "/../../lib/CL/devices/%s/libpocl-devices-%s.so", argv[1],
++               argv[1]);
++ 
+++#ifdef ENABLE_ICD
++   void *handle_libpocl = dlopen (libpocl, RTLD_NOW | RTLD_GLOBAL);
++   if (!handle_libpocl)
++     {
++@@ -50,6 +51,7 @@ main (int argc, char **argv)
++                libpocl, dlerror ());
++       ret = 1;
++     }
+++#endif
++ 
++   if (ret == 0 && argc > 1)
++     {
++@@ -64,8 +66,10 @@ main (int argc, char **argv)
++         dlclose (handle_device);
++     }
++ 
+++#ifdef ENABLE_ICD
++   if (handle_libpocl)
++     dlclose (handle_libpocl);
+++#endif
++ 
++   return ret;
++ }
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5bfb63bcce44779b1f7a9e259568fa5fdb71772a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,29 @@@
++From 6acf712c8e30734a3c1d6185b6ccd150889484a0 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 6 Dec 2021 20:09:29 +0100
++Subject: [PATCH 140/144] add dlopen test for the proxy device
++
++---
++ tests/CMakeLists.txt | 6 ++++++
++ 1 file changed, 6 insertions(+)
++
++diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
++index 8b185a65..6ff01527 100644
++--- a/tests/CMakeLists.txt
+++++ b/tests/CMakeLists.txt
++@@ -83,6 +83,12 @@ if(ENABLE_CUDA)
++   set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_cuda")
++ endif()
++ 
+++if(ENABLE_PROXY)
+++  add_test(NAME pocl_test_dlopen_device_proxy COMMAND test_dlopen proxy)
+++  set_tests_properties("pocl_test_dlopen_device_proxy" PROPERTIES LABELS "internal;dlopen")
+++  set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_proxy")
+++endif()
+++
++ if(ENABLE_VULKAN)
++   add_test(NAME pocl_test_dlopen_device_vulkan COMMAND test_dlopen vulkan)
++   set_tests_properties("pocl_test_dlopen_device_vulkan" PROPERTIES LABELS "internal;dlopen;vulkan")
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..998a136bd530297bacdefddd07409ffced7144f2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,212 @@@
++From 263323db16158cd28b5337e90b9100441c104ef8 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 24 Nov 2021 22:39:43 +0100
++Subject: [PATCH 141/144] add testcase for llvm segfault (issue #889)
++
++The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
++and seems to be fixed in llvm-13. It happens on the architectures armhf
++and armel (both 32-bit) always and on x86_64 sporadically.
++The test segfaults only on the first run (i.e. the kernel is not yet in
++pocl's kernel cache) while it passes on subsequent execution (with
++something already in the kernel cache), emitting only some llvm
++diagnostics:
++
++inlinable function call in a function with debug info must have a !dbg location
++  %11 = call i32 @_Z12get_local_idj(i32 0)
++inlinable function call in a function with debug info must have a !dbg location
++  %19 = call i32 @_Z12get_local_idj(i32 1)
++inlinable function call in a function with debug info must have a !dbg location
++  %27 = call i32 @_Z12get_local_idj(i32 2)
++
++The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
++ #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
++ #1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
++ #2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
++ #3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
++ #4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
++ #5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
++ #6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
++ #7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
++ #8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
++ #9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
++ #10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
++ #11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
++     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
++ #12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
++ #13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
++ #14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
++ #15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
++ #16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
++ #17 0x00473070 in main () at 975931.c:238
++
++https://github.com/pocl/pocl/issues/889
++https://bugs.debian.org/975931
++---
++ tests/regression/CMakeLists.txt               |   7 +-
++ .../regression/test_llvm_segfault_issue_889.c | 122 ++++++++++++++++++
++ 2 files changed, 128 insertions(+), 1 deletion(-)
++ create mode 100644 tests/regression/test_llvm_segfault_issue_889.c
++
++diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt
++index 4f66ade0..a1e0994a 100644
++--- a/tests/regression/CMakeLists.txt
+++++ b/tests/regression/CMakeLists.txt
++@@ -26,7 +26,9 @@
++ 
++ set(C_PROGRAMS_TO_BUILD test_assign_loop_variable_to_privvar_makes_it_local
++      test_program_from_binary_with_local_1_1_1
++-     test_assign_loop_variable_to_privvar_makes_it_local_2)
+++     test_assign_loop_variable_to_privvar_makes_it_local_2
+++  test_llvm_segfault_issue_889
+++)
++ foreach(PROG ${C_PROGRAMS_TO_BUILD})
++   if(MSVC)
++     set_source_files_properties( "${PROG}.c" PROPERTIES LANGUAGE CXX )
++@@ -76,6 +78,8 @@ add_test_pocl(NAME "regression/test_issue_577" COMMAND "test_issue_577")
++ 
++ add_test_pocl(NAME "regression/test_issue_757" COMMAND "test_issue_757")
++ 
+++add_test_pocl(NAME "regression/test_llvm_segfault_issue_889" COMMAND "test_llvm_segfault_issue_889")
+++
++ add_test_pocl(NAME "regression/test_issue_893" COMMAND "test_issue_893")
++ 
++ add_test_pocl(NAME "regression/test_flatten_barrier_subs" COMMAND "test_flatten_barrier_subs" EXPECTED_OUTPUT "test_flatten_barrier_subs.output")
++@@ -270,6 +274,7 @@ set_tests_properties("regression/setting_a_buffer_argument_to_NULL_causes_a_segf
++   "regression/autolocals_in_constexprs" "regression/test_issue_231"
++   "regression/test_issue_445" "regression/test_issue_553"
++   "regression/test_issue_577" "regression/test_issue_757"
+++  "regression/test_llvm_segfault_issue_889"
++   "regression/test_issue_893"
++   "regression/test_flatten_barrier_subs"
++   ${TCE_TESTS}
++diff --git a/tests/regression/test_llvm_segfault_issue_889.c b/tests/regression/test_llvm_segfault_issue_889.c
++new file mode 100644
++index 00000000..7ed2c1b0
++--- /dev/null
+++++ b/tests/regression/test_llvm_segfault_issue_889.c
++@@ -0,0 +1,122 @@
+++/* This reduced kernel (originally from clblas invoked by libgpuarray
+++   tests) triggers a segmentation fault in llvm (10-12) on some platforms.
+++   https://bugs.debian.org/975931
+++
+++   Copyright (c) 2021 pocl developers
+++
+++   Permission is hereby granted, free of charge, to any person obtaining a copy
+++   of this software and associated documentation files (the "Software"), to
+++   deal in the Software without restriction, including without limitation the
+++   rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+++   sell copies of the Software, and to permit persons to whom the Software is
+++   furnished to do so, subject to the following conditions:
+++
+++   The above copyright notice and this permission notice shall be included in
+++   all copies or substantial portions of the Software.
+++
+++   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+++   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+++   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+++   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+++   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+++   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+++   IN THE SOFTWARE.
+++*/
+++
+++#include "poclu.h"
+++#include <CL/cl.h>
+++#include <stdio.h>
+++#include <stdlib.h>
+++
+++const char* source =
+++"__kernel void Sdot_kernel(__global float *_X, __global float *_Y, __global float *scratchBuff,\n"
+++"                          uint N, uint offx, int incx, uint offy, int incy, int doConj)\n"
+++"{\n"
+++"__global float *X = _X + offx;\n"
+++"__global float *Y = _Y + offy;\n"
+++"float dotP = (float) 0.0;\n"
+++"if ( incx < 0 ) {\n"
+++"X = X + (N - 1) * abs(incx);\n"
+++"}\n"
+++"if ( incy < 0 ) {\n"
+++"Y = Y + (N - 1) * abs(incy);\n"
+++"}\n"
+++"int gOffset;\n"
+++"for( gOffset=(get_global_id(0) * 4); (gOffset + 4 - 1)<N; gOffset+=( get_global_size(0) * 4 ) )\n"
+++"{\n"
+++"float4 vReg1, vReg2, res;\n"
+++"vReg1 = (float4)(  (X + (gOffset*incx))[0 + ( incx * 0)],  (X + (gOffset*incx))[0 + ( incx * 1)],  (X + (gOffset*incx))[0 + ( incx * 2)],  (X + (gOffset*incx))[0 + ( incx * 3)]);\n"
+++"vReg2 = (float4)(  (Y + (gOffset*incy))[0 + ( incy * 0)],  (Y + (gOffset*incy))[0 + ( incy * 1)],  (Y + (gOffset*incy))[0 + ( incy * 2)],  (Y + (gOffset*incy))[0 + ( incy * 3)]);\n"
+++"res =  vReg1 *  vReg2 ;\n"
+++"dotP +=  res .S0 +  res .S1 +  res .S2 +  res .S3;\n"
+++"}\n"
+++"for( ; gOffset<N; gOffset++ )\n"
+++"{\n"
+++"float sReg1, sReg2, res;\n"
+++"sReg1 = X[gOffset * incx];\n"
+++"sReg2 = Y[gOffset * incy];\n"
+++"res =  sReg1 *  sReg2 ;\n"
+++"dotP =  dotP +  res ;\n"
+++"}\n"
+++"__local float p1753 [ 64 ];\n"
+++"uint QKiD0 = get_local_id(0);\n"
+++"p1753 [ QKiD0 ] =  dotP ;\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 < 32 ) {\n"
+++"p1753 [ QKiD0 ] = p1753 [ QKiD0 ] + p1753 [ QKiD0 + 32 ];\n"
+++"}\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 < 16 ) {\n"
+++"p1753 [ QKiD0 ] = p1753 [ QKiD0 ] + p1753 [ QKiD0 + 16 ];\n"
+++"}\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 < 8 ) {\n"
+++"p1753 [ QKiD0 ] = p1753 [ QKiD0 ] + p1753 [ QKiD0 + 8 ];\n"
+++"}\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 < 4 ) {\n"
+++"p1753 [ QKiD0 ] = p1753 [ QKiD0 ] + p1753 [ QKiD0 + 4 ];\n"
+++"}\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 < 2 ) {\n"
+++"p1753 [ QKiD0 ] = p1753 [ QKiD0 ] + p1753 [ QKiD0 + 2 ];\n"
+++"}\n"
+++"barrier(CLK_LOCAL_MEM_FENCE);\n"
+++"if( QKiD0 == 0 ) {\n"
+++"dotP  = p1753 [0] + p1753 [1];\n"
+++"}\n"
+++"if( (get_local_id(0)) == 0 ) {\n"
+++"scratchBuff[ get_group_id(0) ] = dotP;\n"
+++"}\n"
+++"}\n"
+++;
+++
+++int
+++main ()
+++{
+++  cl_int err;
+++  cl_context context;
+++  cl_device_id device;
+++  cl_command_queue command_queue;
+++  poclu_get_any_device (&context, &device, &command_queue);
+++
+++  cl_program program
+++      = clCreateProgramWithSource (context, 1, &source, NULL, &err);
+++  CHECK_OPENCL_ERROR_IN ("clCreateProgramWithSource");
+++
+++  CHECK_CL_ERROR (clBuildProgram (program, 1, &device, "-g", NULL, NULL));
+++
+++  size_t binsizes[32];
+++  size_t nbinaries;
+++  CHECK_CL_ERROR (clGetProgramInfo (program, CL_PROGRAM_BINARY_SIZES,
+++                                    sizeof (binsizes), binsizes, &nbinaries));
+++  for (size_t i = 0; i < nbinaries; ++i)
+++    printf ("binary size [%zd]: %zd\n", i, binsizes[i]);
+++
+++  CHECK_CL_ERROR (clReleaseProgram (program));
+++
+++  CHECK_CL_ERROR (clReleaseContext (context));
+++
+++  printf ("OK\n");
+++  return EXIT_SUCCESS;
+++}
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5404f7a12024f812b952eb0ddbc1287074042d29
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,53 @@@
++From 8552e0750b7cdcbff998ed64ab81de8b2c7ea0f5 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Tue, 7 Dec 2021 17:33:23 +0100
++Subject: [PATCH 142/144] ignore known llvm segfault test failures
++
++mark as WILL_FAIL where reproducible
++mark as DISABLED where flaky
++---
++ CMakeLists.txt                  |  3 ++-
++ tests/regression/CMakeLists.txt | 13 +++++++++++++
++ 2 files changed, 15 insertions(+), 1 deletion(-)
++
++diff --git a/CMakeLists.txt b/CMakeLists.txt
++index 51276c9f..f7036174 100644
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -23,7 +23,8 @@
++ #
++ #=============================================================================
++ 
++-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+++cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
+++cmake_policy(SET CMP0067 OLD)
++ 
++ project(pocl)
++ set(CMAKE_PROJECT_DESCRIPTION "pocl is a portable OpenCl runtime.")
++diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt
++index a1e0994a..f685a06a 100644
++--- a/tests/regression/CMakeLists.txt
+++++ b/tests/regression/CMakeLists.txt
++@@ -84,6 +84,19 @@ add_test_pocl(NAME "regression/test_issue_893" COMMAND "test_issue_893")
++ 
++ add_test_pocl(NAME "regression/test_flatten_barrier_subs" COMMAND "test_flatten_barrier_subs" EXPECTED_OUTPUT "test_flatten_barrier_subs.output")
++ 
+++if(LLVM_VERSION_MAJOR GREATER 9 AND LLVM_VERSION_MAJOR LESS 13)
+++  # reproducibly segfaults on 32-bit ARM
+++  if(ARM32)
+++    set_tests_properties("regression/test_llvm_segfault_issue_889" PROPERTIES WILL_FAIL 1)
+++  endif()
+++  # (sporadically?) segfaults on AMD CPUs
+++  # in distro builds, we don't know whether we target a failing or a
+++  # passing CPU during the tests
+++  if(X86_64 AND (KERNELLIB_HOST_DISTRO_VARIANTS OR LLC_HOST_CPU MATCHES "^znver.*"))
+++    set_tests_properties("regression/test_llvm_segfault_issue_889" PROPERTIES DISABLED 1)
+++  endif()
+++endif()
+++
++ # repl
++ 
++ add_test_pocl(NAME "regression/phi_nodes_not_replicated_REPL" COMMAND "test_loop_phi_replication")
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c92c05ab9b1e2753133f313e49350b034d83e8a8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,243 @@@
++From a9e0fae09baac39e30f28022c2992a5e5b074fa6 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Mon, 6 Dec 2021 18:49:48 +0100
++Subject: [PATCH 143/144] add printf and parameter passing test for ulongn
++ vector types only
++
++another test primarily for inspecting the disassembled kernel
++as a debugging aid for the vector type printf issues
++---
++ tests/kernel/CMakeLists.txt                   |   6 +
++ tests/kernel/test_printf_vectors_ulongn.cl    | 153 ++++++++++++++++++
++ .../test_printf_vectors_ulongn_expout.txt     |  29 ++++
++ 3 files changed, 188 insertions(+)
++ create mode 100644 tests/kernel/test_printf_vectors_ulongn.cl
++ create mode 100644 tests/kernel/test_printf_vectors_ulongn_expout.txt
++
++diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt
++index 4612f15c..fc25df1d 100644
++--- a/tests/kernel/CMakeLists.txt
+++++ b/tests/kernel/CMakeLists.txt
++@@ -230,12 +230,17 @@ add_test_pocl(NAME "kernel/test_printf_vectors"
++               EXPECTED_OUTPUT "test_printf_vectors_expout.txt"
++               COMMAND "kernel" "test_printf_vectors")
++ 
+++add_test_pocl(NAME "kernel/test_printf_vectors_ulongn"
+++              EXPECTED_OUTPUT "test_printf_vectors_ulongn_expout.txt"
+++              COMMAND "kernel" "test_printf_vectors_ulongn")
+++
++ # on most platforms, the printf tests for vector types expose bugs in the
++ # pocl printf implementation (passing of variadic arguments containing OpenCL
++ # vector types) and maybe also related bugs in llvm (issue #682, #1007)
++ if(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR
++         CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x"))
++   set_tests_properties("kernel/test_printf_vectors"
+++    "kernel/test_printf_vectors_ulongn"
++     PROPERTIES WILL_FAIL 1)
++ endif()
++ 
++@@ -256,6 +261,7 @@ set_tests_properties("kernel/test_shuffle_char"
++   "kernel/test_shuffle_float" ${EXTRA_TESTS}
++   "kernel/test_printf"
++   "kernel/test_printf_vectors"
+++  "kernel/test_printf_vectors_ulongn"
++   "kernel/test_sizeof_uint"
++ 
++   PROPERTIES
++diff --git a/tests/kernel/test_printf_vectors_ulongn.cl b/tests/kernel/test_printf_vectors_ulongn.cl
++new file mode 100644
++index 00000000..d67c73af
++--- /dev/null
+++++ b/tests/kernel/test_printf_vectors_ulongn.cl
++@@ -0,0 +1,153 @@
+++ulong f2(ulong2 ul2, ulong z) __attribute__((noinline));
+++ulong f2(ulong2 ul2, ulong z)
+++{
+++ulong s = ul2.x + ul2.y;
+++return s ^ z;
+++}
+++
+++ulong g2() __attribute__((noinline));
+++ulong g2()
+++{
+++ulong2 ul2 = (ulong2)(0x18, 0x29);
+++return -f2(ul2, 0x123456789abcdef1UL);
+++}
+++
+++ulong f3(ulong3 ul3, ulong z) __attribute__((noinline));
+++ulong f3(ulong3 ul3, ulong z)
+++{
+++ulong s = ul3.x + ul3.y + ul3.z;
+++return s ^ z;
+++}
+++
+++ulong g3() __attribute__((noinline));
+++ulong g3()
+++{
+++ulong3 ul3 = (ulong3)(0x18, 0x29, 0x3a);
+++return -f3(ul3, 0x123456789abcdef1UL);
+++}
+++
+++ulong f4(ulong4 ul4, ulong z) __attribute__((noinline));
+++ulong f4(ulong4 ul4, ulong z)
+++{
+++ulong s = ul4.x + ul4.y + ul4.z + ul4.w;
+++return s ^ z;
+++}
+++
+++ulong g4() __attribute__((noinline));
+++ulong g4()
+++{
+++ulong4 ul4 = (ulong4)(0x18, 0x29, 0x3a, 0x4b);
+++return -f4(ul4, 0x123456789abcdef1UL);
+++}
+++
+++ulong f8(ulong8 ul8, ulong z) __attribute__((noinline));
+++ulong f8(ulong8 ul8, ulong z)
+++{
+++ulong s = ul8.s0 + ul8.s1 + ul8.s2 + ul8.s3 + ul8.s4 + ul8.s5 + ul8.s6 + ul8.s7;
+++return s ^ z;
+++}
+++
+++ulong g8() __attribute__((noinline));
+++ulong g8()
+++{
+++ulong8 ul8 = (ulong8)(0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x8f);
+++return -f8(ul8, 0x123456789abcdef1UL);
+++}
+++
+++ulong f16(ulong16 ul16, ulong z) __attribute__((noinline));
+++ulong f16(ulong16 ul16, ulong z)
+++{
+++ulong s = ul16.s0 + ul16.s1 + ul16.s2 + ul16.s3 + ul16.s4 + ul16.s5 + ul16.s6 + ul16.s7 + ul16.s8 + ul16.s9 + ul16.sa + ul16.sb + ul16.sc + ul16.sd + ul16.se + ul16.sf;
+++return s ^ z;
+++}
+++
+++ulong g16() __attribute__((noinline));
+++ulong g16()
+++{
+++ulong16 ul16 = (ulong16)(0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x8f, 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0xf6, 0x17, 0x28);
+++return -f16(ul16, 0x123456789abcdef1UL);
+++}
+++
+++int pl2() __attribute__((noinline));
+++int pl2()
+++{
+++  printf("ulong2   %#v2lx\n", (ulong2)(0xa1a2a3a4a5a6a7a8UL, 0xa9aaabacadaeafb1UL));
+++  return 0;
+++}
+++
+++int pl3() __attribute__((noinline));
+++int pl3()
+++{
+++  printf("ulong3   %#v3lx\n", (ulong3)(0xc1c2c3c4c5c6c7c8UL, 0xc9cacbcccdcecfd1UL, 0xd2d3d4d5d6d7d8d9UL));
+++  return 0;
+++}
+++
+++int pl4() __attribute__((noinline));
+++int pl4()
+++{
+++  printf("ulong4   %#v4lx\n", (ulong4)(0xe1e2e3e4e5e6e7e8UL, 0xe9eaebecedeeeff1UL, 0xf2f3f4f5f6f7f8f9UL, 0xfafbfcfdfeff1112UL));
+++  return 0;
+++}
+++
+++int pl8() __attribute__((noinline));
+++int pl8()
+++{
+++  printf("ulong8   %#v8lx\n", (ulong8)(0x2122232425262728UL, 0x292a2b2c2d2e2f31UL, 0x3233343536373839UL, 0x3a3b3c3d3e3f4142UL, 0x434445464748494aUL, 0x4b4c4d4e4f515253UL, 0x5455565758595a5bUL, 0x5c5d5e5f61626364UL));
+++  return 0;
+++}
+++
+++int pl16() __attribute__((noinline));
+++int pl16()
+++{
+++  printf("ulong16  %#v16lx\n", (ulong16)(0x7172737475767778UL, 0x797a7b7c7d7e7f81UL, 0x8283848586878889UL, 0x8a8b8c8d8e8f9192UL, 0x939495969798999aUL, 0x9b9c9d9e9fa1a2a3UL, 0xa4a5a6a7a8a9aaabUL, 0xacadaeafb1b2b3b4UL,
+++                                         0xb5b6b7b8b9babbbcUL, 0xbdbebfc1c2c3c4c5UL, 0xc6c7c8c9cacbcccdUL, 0xcecfd1d2d3d4d5d6UL, 0xd7d8d9dadbdcdddeUL, 0xdfe1e2e3e4e5e6e7UL, 0xe8e9eaebecedeeefUL, 0xf1f2f3f4f5f6f7f8UL));
+++  return 0;
+++}
+++
+++kernel void test_printf_vectors_ulongn()
+++{
+++  printf("ulong2   %#v2lx\n", (ulong2)(0xa1a2a3a4a5a6a7a8UL, 0xa9aaabacadaeafb1UL));
+++  printf("ulong3   %#v3lx\n", (ulong3)(0xc1c2c3c4c5c6c7c8UL, 0xc9cacbcccdcecfd1UL, 0xd2d3d4d5d6d7d8d9UL));
+++  printf("ulong4   %#v4lx\n", (ulong4)(0xe1e2e3e4e5e6e7e8UL, 0xe9eaebecedeeeff1UL, 0xf2f3f4f5f6f7f8f9UL, 0xfafbfcfdfeff1112UL));
+++  printf("ulong8   %#v8lx\n", (ulong8)(0x2122232425262728UL, 0x292a2b2c2d2e2f31UL, 0x3233343536373839UL, 0x3a3b3c3d3e3f4142UL, 0x434445464748494aUL, 0x4b4c4d4e4f515253UL, 0x5455565758595a5bUL, 0x5c5d5e5f61626364UL));
+++  printf("ulong16  %#v16lx\n", (ulong16)(0x7172737475767778UL, 0x797a7b7c7d7e7f81UL, 0x8283848586878889UL, 0x8a8b8c8d8e8f9192UL, 0x939495969798999aUL, 0x9b9c9d9e9fa1a2a3UL, 0xa4a5a6a7a8a9aaabUL, 0xacadaeafb1b2b3b4UL,
+++                                         0xb5b6b7b8b9babbbcUL, 0xbdbebfc1c2c3c4c5UL, 0xc6c7c8c9cacbcccdUL, 0xcecfd1d2d3d4d5d6UL, 0xd7d8d9dadbdcdddeUL, 0xdfe1e2e3e4e5e6e7UL, 0xe8e9eaebecedeeefUL, 0xf1f2f3f4f5f6f7f8UL));
+++
+++  pl2();
+++  pl3();
+++  pl4();
+++  pl8();
+++  pl16();
+++
+++  printf("\n");
+++  printf("%c %#v2lx %#v2lx %c\n", 'l',
+++         (ulong2)(0xa1a2a3a4a5a6a7a8UL, 0xa9aaabacadaeafb1UL),
+++         (ulong2)(0xb2b3b4b5b6b7b8b9UL, 0xbabbbcbdbebfc1c2UL), '.');
+++  printf("%c %#v3lx %#v3lx %c\n", 'l',
+++         (ulong3)(0xd1d2d3d4d5d6d7d8UL, 0xd9dadbdcdddedfe1UL, 0xe2e3e4e5e6e7e8e9UL),
+++         (ulong3)(0xeaebecedeeeff1f2UL, 0xf3f4f5f6f7f8f9faUL, 0xfbfcfdfeff111213UL), '.');
+++  printf("%c %#v4lx %#v4lx %c\n", 'l',
+++         (ulong4)(0x2122232425262728UL, 0x292a2b2c2d2e2f31UL, 0x3233343536373839UL, 0x3a3b3c3d3e3f4142UL),
+++         (ulong4)(0x434445464748494aUL, 0x4b4c4d4e4f515253UL, 0x5455565758595a5bUL, 0x5c5d5e5f61626364UL), '.');
+++  printf("%c %#v8lx %#v8lx %c\n", 'l',
+++         (ulong8)(0x7172737475767778UL, 0x797a7b7c7d7e7f81UL, 0x8283848586878889UL, 0x8a8b8c8d8e8f9192UL, 0x939495969798999aUL, 0x9b9c9d9e9fa1a2a3UL, 0xa4a5a6a7a8a9aaabUL, 0xacadaeafb1b2b3b4UL),
+++         (ulong8)(0xb5b6b7b8b9babbbcUL, 0xbdbebfc1c2c3c4c5UL, 0xc6c7c8c9cacbcccdUL, 0xcecfd1d2d3d4d5d6UL, 0xd7d8d9dadbdcdddeUL, 0xdfe1e2e3e4e5e6e7UL, 0xe8e9eaebecedeeefUL, 0xf1f2f3f4f5f6f7f8UL), '.');
+++  printf("%c %#v16lx %#v16lx %c\n", 'l',
+++         (ulong16)(0x1112131415161718UL, 0x191a1b1c1d1e1f21UL, 0x2223242526272829UL, 0x2a2b2c2d2e2f3132UL, 0x333435363738393aUL, 0x3b3c3d3e3f414243UL, 0x4445464748494a4bUL, 0x4c4d4e4f51525354UL,
+++                   0x55565758595a5b5cUL, 0x5d5e5f6162636465UL, 0x666768696a6b6c6dUL, 0x6e6f717273747576UL, 0x7778797a7b7c7d7eUL, 0x7f81828384858687UL, 0x88898a8b8c8d8e8fUL, 0x9192939495969798UL),
+++         (ulong16)(0x999a9b9c9d9e9fa1UL, 0xa2a3a4a5a6a7a8a9UL, 0xaaabacadaeafb1b2UL, 0xb3b4b5b6b7b8b9baUL, 0xbbbcbdbebfc1c2c3UL, 0xc4c5c6c7c8c9cacbUL, 0xcccdcecfd1d2d3d4UL, 0xd5d6d7d8d9dadbdcUL,
+++                   0xdddedfe1e2e3e4e5UL, 0xe6e7e8e9eaebecedUL, 0xeeeff1f2f3f4f5f6UL, 0xf7f8f9fafbfcfdfeUL, 0xff11121314151617UL, 0x18191a1b1c1d1e1fUL, 0x2122232425262728UL, 0x292a2b2c2d2e2f31UL), '.');
+++
+++  printf("\n");
+++  printf("ulong2  %16lx\n", f2((ulong2)(0), 0));
+++  printf("ulong3  %16lx\n", f3((ulong3)(0), 0));
+++  printf("ulong4  %16lx\n", f4((ulong4)(0), 0));
+++  printf("ulong8  %16lx\n", f8((ulong8)(0), 0));
+++  printf("ulong16 %16lx\n", f16((ulong16)(0), 0));
+++
+++  printf("ulong2  %16lx\n", g2());
+++  printf("ulong3  %16lx\n", g3());
+++  printf("ulong4  %16lx\n", g4());
+++  printf("ulong8  %16lx\n", g8());
+++  printf("ulong16 %16lx\n", g16());
+++}
++diff --git a/tests/kernel/test_printf_vectors_ulongn_expout.txt b/tests/kernel/test_printf_vectors_ulongn_expout.txt
++new file mode 100644
++index 00000000..166fbec8
++--- /dev/null
+++++ b/tests/kernel/test_printf_vectors_ulongn_expout.txt
++@@ -0,0 +1,29 @@
+++Running test test_printf_vectors_ulongn...
+++ulong2   0xa1a2a3a4a5a6a7a8,0xa9aaabacadaeafb1
+++ulong3   0xc1c2c3c4c5c6c7c8,0xc9cacbcccdcecfd1,0xd2d3d4d5d6d7d8d9
+++ulong4   0xe1e2e3e4e5e6e7e8,0xe9eaebecedeeeff1,0xf2f3f4f5f6f7f8f9,0xfafbfcfdfeff1112
+++ulong8   0x2122232425262728,0x292a2b2c2d2e2f31,0x3233343536373839,0x3a3b3c3d3e3f4142,0x434445464748494a,0x4b4c4d4e4f515253,0x5455565758595a5b,0x5c5d5e5f61626364
+++ulong16  0x7172737475767778,0x797a7b7c7d7e7f81,0x8283848586878889,0x8a8b8c8d8e8f9192,0x939495969798999a,0x9b9c9d9e9fa1a2a3,0xa4a5a6a7a8a9aaab,0xacadaeafb1b2b3b4,0xb5b6b7b8b9babbbc,0xbdbebfc1c2c3c4c5,0xc6c7c8c9cacbcccd,0xcecfd1d2d3d4d5d6,0xd7d8d9dadbdcddde,0xdfe1e2e3e4e5e6e7,0xe8e9eaebecedeeef,0xf1f2f3f4f5f6f7f8
+++ulong2   0xa1a2a3a4a5a6a7a8,0xa9aaabacadaeafb1
+++ulong3   0xc1c2c3c4c5c6c7c8,0xc9cacbcccdcecfd1,0xd2d3d4d5d6d7d8d9
+++ulong4   0xe1e2e3e4e5e6e7e8,0xe9eaebecedeeeff1,0xf2f3f4f5f6f7f8f9,0xfafbfcfdfeff1112
+++ulong8   0x2122232425262728,0x292a2b2c2d2e2f31,0x3233343536373839,0x3a3b3c3d3e3f4142,0x434445464748494a,0x4b4c4d4e4f515253,0x5455565758595a5b,0x5c5d5e5f61626364
+++ulong16  0x7172737475767778,0x797a7b7c7d7e7f81,0x8283848586878889,0x8a8b8c8d8e8f9192,0x939495969798999a,0x9b9c9d9e9fa1a2a3,0xa4a5a6a7a8a9aaab,0xacadaeafb1b2b3b4,0xb5b6b7b8b9babbbc,0xbdbebfc1c2c3c4c5,0xc6c7c8c9cacbcccd,0xcecfd1d2d3d4d5d6,0xd7d8d9dadbdcddde,0xdfe1e2e3e4e5e6e7,0xe8e9eaebecedeeef,0xf1f2f3f4f5f6f7f8
+++
+++l 0xa1a2a3a4a5a6a7a8,0xa9aaabacadaeafb1 0xb2b3b4b5b6b7b8b9,0xbabbbcbdbebfc1c2 .
+++l 0xd1d2d3d4d5d6d7d8,0xd9dadbdcdddedfe1,0xe2e3e4e5e6e7e8e9 0xeaebecedeeeff1f2,0xf3f4f5f6f7f8f9fa,0xfbfcfdfeff111213 .
+++l 0x2122232425262728,0x292a2b2c2d2e2f31,0x3233343536373839,0x3a3b3c3d3e3f4142 0x434445464748494a,0x4b4c4d4e4f515253,0x5455565758595a5b,0x5c5d5e5f61626364 .
+++l 0x7172737475767778,0x797a7b7c7d7e7f81,0x8283848586878889,0x8a8b8c8d8e8f9192,0x939495969798999a,0x9b9c9d9e9fa1a2a3,0xa4a5a6a7a8a9aaab,0xacadaeafb1b2b3b4 0xb5b6b7b8b9babbbc,0xbdbebfc1c2c3c4c5,0xc6c7c8c9cacbcccd,0xcecfd1d2d3d4d5d6,0xd7d8d9dadbdcddde,0xdfe1e2e3e4e5e6e7,0xe8e9eaebecedeeef,0xf1f2f3f4f5f6f7f8 .
+++l 0x1112131415161718,0x191a1b1c1d1e1f21,0x2223242526272829,0x2a2b2c2d2e2f3132,0x333435363738393a,0x3b3c3d3e3f414243,0x4445464748494a4b,0x4c4d4e4f51525354,0x55565758595a5b5c,0x5d5e5f6162636465,0x666768696a6b6c6d,0x6e6f717273747576,0x7778797a7b7c7d7e,0x7f81828384858687,0x88898a8b8c8d8e8f,0x9192939495969798 0x999a9b9c9d9e9fa1,0xa2a3a4a5a6a7a8a9,0xaaabacadaeafb1b2,0xb3b4b5b6b7b8b9ba,0xbbbcbdbebfc1c2c3,0xc4c5c6c7c8c9cacb,0xcccdcecfd1d2d3d4,0xd5d6d7d8d9dadbdc,0xdddedfe1e2e3e4e5,0xe6e7e8e9eaebeced,0xeeeff1f2f3f4f5f6,0xf7f8f9fafbfcfdfe,0xff11121314151617,0x18191a1b1c1d1e1f,0x2122232425262728,0x292a2b2c2d2e2f31 .
+++
+++ulong2                 0
+++ulong3                 0
+++ulong4                 0
+++ulong8                 0
+++ulong16                0
+++ulong2  edcba98765432150
+++ulong3  edcba98765432176
+++ulong4  edcba987654321c9
+++ulong8  edcba98765432393
+++ulong16 edcba987654326af
+++OK
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4facd62e4b7109ba4149580c64df56157706ce78
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,43 @@@
++From adfd647ce31ec17a7d768b3e843773a47fb5fe47 Mon Sep 17 00:00:00 2001
++From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?=
++ <pekka.jaaskelainen@tuni.fi>
++Date: Thu, 6 Jan 2022 16:02:55 +0200
++Subject: [PATCH 144/144] test_dlopen fix for ICD enabled
++
++---
++ tests/runtime/test_dlopen.c | 5 +++--
++ 1 file changed, 3 insertions(+), 2 deletions(-)
++
++diff --git a/tests/runtime/test_dlopen.c b/tests/runtime/test_dlopen.c
++index b3b525e1..df0c2ff1 100644
++--- a/tests/runtime/test_dlopen.c
+++++ b/tests/runtime/test_dlopen.c
++@@ -23,6 +23,7 @@
++ 
++ #include <dlfcn.h>
++ #include <stdio.h>
+++#include <config.h>
++ 
++ #ifdef __APPLE__
++ #define SHLIB_EXT "dylib"
++@@ -43,7 +44,7 @@ main (int argc, char **argv)
++               SHLIB_ORIGIN "/../../lib/CL/devices/%s/libpocl-devices-%s.so", argv[1],
++               argv[1]);
++ 
++-#ifdef ENABLE_ICD
+++#ifdef BUILD_ICD
++   void *handle_libpocl = dlopen (libpocl, RTLD_NOW | RTLD_GLOBAL);
++   if (!handle_libpocl)
++     {
++@@ -66,7 +67,7 @@ main (int argc, char **argv)
++         dlclose (handle_device);
++     }
++ 
++-#ifdef ENABLE_ICD
+++#ifdef BUILD_ICD
++   if (handle_libpocl)
++     dlclose (handle_libpocl);
++ #endif
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..cef1ecd69c9d203de3e0d51a32a744b2ff8825a4
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,37 @@@
++From 4c98e36ab636dd799772e3c8a2d9ddaaebaf64e2 Mon Sep 17 00:00:00 2001
++From: Andreas Beckmann <anbe@debian.org>
++Date: Wed, 8 Apr 2020 01:33:12 +0200
++Subject: [PATCH 02/10] link against single shared libclang-cpp when building
++ with llvm 9, too
++
++---
++ cmake/LLVM.cmake | 6 +++---
++ 1 file changed, 3 insertions(+), 3 deletions(-)
++
++diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
++index 51b051c2..cc66096d 100644
++--- a/cmake/LLVM.cmake
+++++ b/cmake/LLVM.cmake
++@@ -243,8 +243,8 @@ string(STRIP "${LLVM_SYSLIBS}" LLVM_SYSLIBS)
++ ####################################################################
++ 
++ # llvm-config does not include clang libs
++-if((9 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
++-  # For Clang 10+, link against a single shared library instead of multiple component shared
+++if((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
+++  # For Clang 9+, link against a single shared library instead of multiple component shared
++   # libraries.
++   if("${LLVM_LIBNAMES}" MATCHES "LLVMTCE")
++     set(CLANG_LIBNAMES clangTCE-cpp)
++@@ -261,7 +261,7 @@ endif()
++ foreach(LIBNAME ${CLANG_LIBNAMES})
++   find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}")
++   list(APPEND CLANG_LIBFILES "${C_LIBFILE_${LIBNAME}}")
++-  if(UNIX AND (NOT APPLE))
+++  if(UNIX AND (NOT APPLE) AND (NOT ((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))))
++     set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,--exclude-libs,lib${LIBNAME}")
++   endif()
++ endforeach()
++-- 
++2.20.1
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8440fd296bc0c0204d506aff59bdd5ee3046d8a2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,24 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: the pocl cl extensions are not yet in the upstream cl headers
++Forwarded: no-needed
++
++--- a/lib/CL/pocl_cl.h
+++++ b/lib/CL/pocl_cl.h
++@@ -61,6 +61,7 @@ typedef pthread_t pocl_thread_t;
++ #include "pocl_hash.h"
++ #include "pocl_runtime_config.h"
++ #include "common.h"
+++#include "_CL/cl_ext_pocl.h"
++ 
++ #if __STDC_VERSION__ < 199901L
++ # if __GNUC__ >= 2
++--- a/tests/runtime/test_cl_pocl_content_size.c
+++++ b/tests/runtime/test_cl_pocl_content_size.c
++@@ -25,6 +25,7 @@
++ #include <stdio.h>
++ #include <stdlib.h>
++ #include <string.h>
+++#include <_CL/cl_ext_pocl.h>
++ 
++ #define SRC_CHAR 1
++ #define DST_CHAR 2
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0d0e5b4872e17ff96b20656fad8395f24b787fc5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: tune distro mode
++Forwarded: no-needed
++
++--- a/lib/kernel/host/CMakeLists.txt
+++++ b/lib/kernel/host/CMakeLists.txt
++@@ -317,8 +317,8 @@ separate_arguments(DEVICE_C_FLAGS)
++ function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS)
++ 
++   if("${VARIANT}" STREQUAL "sse2")
++-    set(CLANG_F "${CLANG_MARCH_FLAG}athlon64")
++-    set(LLC_F "-mcpu=athlon64")
+++    set(CLANG_F "${CLANG_MARCH_FLAG}x86-64")
+++    set(LLC_F "-mcpu=x86-64")
++ 
++   elseif("${VARIANT}" STREQUAL "ssse3")
++     set(CLANG_F "${CLANG_MARCH_FLAG}core2")
++--- a/CMakeLists.txt
+++++ b/CMakeLists.txt
++@@ -1041,6 +1041,9 @@ endif()
++ 
++ set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
++ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
+++  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+++    set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
+++  endif()
++   if(HOST_CPU_FORCED)
++     message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one")
++   endif()
++@@ -1051,6 +1054,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL
++   else()
++     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
++   endif()
+++  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
+++    list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
+++  endif()
++   set(KERNELLIB_HOST_DISTRO_VARIANTS 1)
++ endif()
++ 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..167b55f9466ef94d8233e85d4d32353f94aaa6eb
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,10 @@@
++--- a/lib/CL/devices/accel/accel.cc
+++++ b/lib/CL/devices/accel/accel.cc
++@@ -28,6 +28,7 @@
++ #include "common_driver.h"
++ #include "devices.h"
++ #include "pocl_cl.h"
+++#include "pocl_llvm.h"
++ #include "pocl_util.h"
++ 
++ #include <errno.h>
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..01b8f4501b7b14632233056aa26a97c1749eacec
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,71 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: add support for a GENERIC cpu type that uses llvm defaults
++Forwarded: not-needed
++
++--- a/lib/kernel/host/CMakeLists.txt
+++++ b/lib/kernel/host/CMakeLists.txt
++@@ -472,6 +472,11 @@ else()
++   set(LLC_CPUFLAGS "-mcpu=${VARIANT}")
++ endif()
++ 
+++if("${VARIANT}" STREQUAL "GENERIC")
+++  set(CLANG_CPUFLAGS "")
+++  set(LLC_CPUFLAGS "")
+++endif()
+++
++ separate_arguments(CLANG_CPUFLAGS)
++ separate_arguments(LLC_CPUFLAGS)
++ set(CLANG_FLAGS ${HOST_CLANG_FLAGS} ${CLANG_CPUFLAGS}
++--- a/lib/CL/devices/common.c
+++++ b/lib/CL/devices/common.c
++@@ -1515,6 +1515,9 @@
++   dev->llvm_cpu = pocl_get_llvm_cpu_name ();
++ #endif
++ 
+++  if(dev->llvm_cpu && (!strcmp(dev->llvm_cpu, "GENERIC")))
+++    dev->llvm_cpu = NULL;
+++
++   dev->spirv_version = "SPIR-V_1.2";
++ #else /* No compiler, no CPU info */
++   dev->llvm_cpu = NULL;
++--- a/lib/CL/pocl_llvm_build.cc
+++++ b/lib/CL/pocl_llvm_build.cc
++@@ -879,7 +879,7 @@ static llvm::Module* getKernelLibrary(cl
++     kernellib_fallback = kernellib;
++     kernellib_fallback += OCL_KERNEL_TARGET_CPU;
++     kernellib_fallback += ".bc";
++-    kernellib += device->llvm_cpu;
+++    kernellib += device->llvm_cpu ? device->llvm_cpu : "GENERIC";
++ #endif
++   }
++   kernellib += ".bc";
++--- a/cmake/LLVM.cmake
+++++ b/cmake/LLVM.cmake
++@@ -720,17 +720,25 @@ endif()
++ 
++ if(NOT DEFINED CLANG_MARCH_FLAG)
++   message(STATUS "Checking clang -march vs. -mcpu flag")
++-  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU})
+++ if(LLC_HOST_CPU STREQUAL "GENERIC" AND NOT KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
+++  set(CLANG_MARCH_FLAG "-None=")
+++ else()
+++  set(LLC_HOST_CPU_TEST "${LLC_HOST_CPU}")
+++  if(LLC_HOST_CPU STREQUAL "GENERIC")
+++    set(LLC_HOST_CPU_TEST "${LLC_HOST_CPU_AUTO}")
+++  endif()
+++  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU_TEST})
++   if(NOT RES)
++     set(CLANG_MARCH_FLAG "-march=")
++   else()
++-    custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU})
+++    custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU_TEST})
++     if(NOT RES)
++       set(CLANG_MARCH_FLAG "-mcpu=")
++     else()
++       message(FATAL_ERROR "Could not determine whether to use -march or -mcpu with clang")
++     endif()
++   endif()
+++ endif()
++   message(STATUS "  Using ${CLANG_MARCH_FLAG}")
++ 
++   set(CLANG_MARCH_FLAG ${CLANG_MARCH_FLAG} CACHE INTERNAL "Clang option used to specify the target cpu")
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e7fa27570d00ff5c86f42542ce9ef01fc8301df2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,90 @@@
++0004-Tweaks.patch
++0011-Random-fix-for-accel-driver.patch
++0013-Fix-data-race-in-compile_and_link_program.patch
++0014-Fix-uninitialized-variable-in-tests-regression-test_.patch
++0015-Enable-test_dlopen-only-if-DLFCN-is-available.patch
++0016-Move-pocl_cmd_max_grid_dim_width-outside-HAVE_DLFCN_.patch
++0017-Fix-missing-define-in-OpenCL-CTS.patch
++0018-Fix-tests-regression-test_alignment_with_dynamic_wg..patch
++0030-Add-missing-cl_ext_pocl.h-to-install.patch
++0035-CUDA-don-t-leak-the-epoch_event.patch
++0041-CUDA-const-correctness-in-get-free-device-name-strin.patch
++0043-MapBuffer-MapImage-allocate-the-cl_mem-backing-buffe.patch
++0052-vulkan-label-tests-that-work-with-vulkan-driver.patch
++0058-run_test-show-diff-if-test-output-does-not-match-the.patch
++0059-move-vector-type-printf-tests-to-a-separate-test.patch
++0060-add-printf-tests-for-all-unsigned-fp-vector-types-an.patch
++0061-test_printf_vectors-fails-on-most-platforms.patch
++0062-add-test-test_ucharn.cl.patch
++0063-hsa-add-PTHREAD_CHECK-to-the-remaining-pthread_-call.patch
++0064-cuda-add-PTHREAD_CHECK-to-all-pthread_-calls.patch
++0066-pthread-add-PTHREAD_CHECK-to-all-pthread_-calls.patch
++0068-move-PTHREAD_CHECK-to-pocl_cl.h.patch
++0069-add-PTHREAD_CHECK2-accepting-an-additional-non-zero-.patch
++0071-add-PTHREAD_CHECK-to-all-macros-wrapping-pthread_-ca.patch
++0072-pthread-add-return-code-to-pthread_scheduler_init.patch
++0073-pthread-add-barrier-after-worker-thread-initializati.patch
++0074-pthread-cleanup-fail-pthread_scheduler_init-if-any-w.patch
++0075-be-more-verbose-on-pthread-errors.patch
++0076-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
++0077-add-POCL_EXPORT-to-additional-symbols-needed-if-hard.patch
++0078-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
++0079-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
++0080-rename-get_llvm_cpu_name-to-pocl_get_llvm_cpu_name.patch
++0081-rename-alloc_buffer_from_region-to-pocl_alloc_buffer.patch
++0082-rename-free_chunk-to-pocl_free_chunk.patch
++0083-rename-init_mem_region-to-pocl_init_mem_region.patch
++0084-rename-byteswap_uint32_t-to-pocl_byteswap_uint32_t.patch
++0086-enable-VISIBILITY_HIDDEN-by-default.patch
++0087-rename-pocl_basic_alloc_mem_obj-to-pocl_driver_alloc.patch
++0088-rename-pocl_basic_free-to-pocl_driver_free.patch
++0089-rename-pocl_basic_svm_fill-to-pocl_driver_svm_fill.patch
++0090-do-not-link-libpocl-devices-hsa.so-against-libpocl-d.patch
++0096-Avoid-loss-precision-in-event-time-calculations.patch
++0097-Avoid-inheritance-from-std-vector-in-ParallelRegion-.patch
++0099-restore-setting-unroll-threshold-on-LLVM-9.patch
++0100-link-libpocl-devices-pthread.so-with-pthread.patch
++0101-link-libpocl-devices-cuda.so-with-lLLVM-pthread.patch
++0102-link-libpocl-devices-hsa.so-with-pthread.patch
++0103-link-libpocl-devices-ttasim.so-with-pthread.patch
++0105-hsa-check-for-clang-target-hsail64.patch
++0106-hsa-check-for-clang-target-amdgcn-amdhsa-nogpulib.patch
++0107-check-for-.git-rebase-merge-to-detect-ongoing-git-re.patch
++0108-do-not-reformat-if-there-are-uncommitted-changes.patch
++0109-use-proper-tempfiles.patch
++0110-exit-early-if-reformatting-produced-no-changes.patch
++0111-import-clang-format-diff.py-from-clang-13.patch
++0113-drop-irrelevant-metadata-causing-warnings-on-non-x86.patch
++0114-do-not-build-libllvmopencl.so-by-default-no-longer-u.patch
++0115-add-a-copy-of-the-Boost-license-for-sleef.patch
++0116-add-a-copy-of-the-ROCm-Device-Libs-license-NCSA-for-.patch
++0117-drop-the-clangxx-works-check-from-the-vecmathlib-age.patch
++0118-cmake-policy-CMP0025-was-introduced-in-CMake-3.0.patch
++0122-llvm-13-handle-deprecated-CreateLoad.patch
++0127-really-enable-VISIBILITY_HIDDEN-by-default.patch
++0128-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch
++0130-tests-use-EXIT_SUCCESS-EXIT_FAILURE-in-most-tests.patch
++0131-tests-simplify-EXIT_SUCCESS-EXIT_FAILURE-usage.patch
++0132-tests-emit-OK-along-EXIT_SUCCESS.patch
++0133-consistently-use-add_test-NAME-.-COMMAND.patch
++0134-fix-unlabeled-tests.patch
++0135-skip-tests-that-require-unavailable-devices.patch
++0136-skip-subdevice-tests-on-devices-with-only-1-compute-.patch
++0137-add-poclu_show_program_build_log-cl_program.patch
++0138-tests-run_-kernel.c-show-build-log-after-clBuildProg.patch
++0139-do-not-dlopen-libpocl.so-without-ENABLE_ICD.patch
++0140-add-dlopen-test-for-the-proxy-device.patch
++0141-add-testcase-for-llvm-segfault-issue-889.patch
++0142-ignore-known-llvm-segfault-test-failures.patch
++0143-add-printf-and-parameter-passing-test-for-ulongn-vec.patch
++0144-test_dlopen-fix-for-ICD-enabled.patch
++
++2002-link-against-single-shared-libclang-cpp-when-buildin.patch
++test_structs_as_args.patch
++generic-cpu.patch
++distro.patch
++verbose.patch
++timeout.patch
++use-system-CL-headers.patch
++cl_ext_pocl.patch
++fix-accel.patch
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ebf6846fe36a2f0f04df72fe317a327e434eaf24
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,76 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: HACK! regression/struct_kernel_arguments fails on i686
++ 141/143 Test  #85: regression/struct_kernel_arguments ..................................................***Failed  Error regular expression found in output. Regex=[FAIL]  4.58 sec
++ CMake Error at /build/pocl-1.4/cmake/run_test.cmake:34 (message):
++  FAIL: Test exited with nonzero code (1):
++  /build/pocl-1.4/obj-i686-linux-gnu/tests/regression/test_structs_as_args
++
++  STDOUT:
++
++  F(4: 0 != 5) F(5: -2147483648 != 6) F(6: 0 != 7) F(7: 0 != 8)
++
++  STDERR:
++
++
++
++ -- OK
++Bug: https://github.com/pocl/pocl/issues/801
++Bug: https://github.com/KhronosGroup/OpenCL-Headers/issues/149
++Forwarded: not-needed
++
++--- a/tests/regression/test_structs_as_args.cpp
+++++ b/tests/regression/test_structs_as_args.cpp
++@@ -52,21 +52,33 @@
++     cl_long b;\r
++ };\r
++ \r
+++// i386 has a default alignment of 4 even for 64-bit types\r
+++#ifdef __i386__\r
+++#define CL_LONG_ALIGNMENT __attribute__((aligned(8)))\r
+++#define CL_DOUBLE_ALIGNMENT __attribute__((aligned(8)))\r
+++#else\r
+++#define CL_LONG_ALIGNMENT\r
+++#define CL_DOUBLE_ALIGNMENT\r
+++#endif\r
+++\r
++ struct test_struct {\r
++     cl_int elementA;\r
++     cl_int elementB;\r
++-    cl_long elementC;\r
+++    cl_long elementC CL_LONG_ALIGNMENT;\r
++     cl_char elementD;\r
++-    cl_long elementE;\r
+++    cl_long elementE CL_LONG_ALIGNMENT;\r
++     cl_float elementF;\r
++     cl_short elementG;\r
++ #ifdef _CL_DISABLE_DOUBLE\r
++-    cl_long elementH;\r
+++    cl_long elementH CL_LONG_ALIGNMENT;\r
++ #else\r
++-    cl_double elementH;\r
+++    cl_double elementH CL_DOUBLE_ALIGNMENT;\r
++ #endif\r
++ };\r
++ \r
+++#undef CL_LONG_ALIGNMENT\r
+++#undef CL_DOUBLE_ALIGNMENT\r
+++\r
++ static char\r
++ kernelSourceCode[] = \r
++ "typedef struct int_single {\n"\r
++--- a/tests/regression/CMakeLists.txt
+++++ b/tests/regression/CMakeLists.txt
++@@ -253,6 +253,13 @@
++ 
++ add_test_pocl(NAME "regression/struct_kernel_arguments" COMMAND "test_structs_as_args")
++ 
+++if(0)
+++if(LLC_HOST_CPU STREQUAL "i686")
+++  set_tests_properties("regression/struct_kernel_arguments"
+++    PROPERTIES WILL_FAIL 1)
+++endif()
+++endif()
+++
++ add_test_pocl(NAME "regression/vector_kernel_arguments" COMMAND "test_vectors_as_args")
++ 
++ set(TCE_TESTS "regression/barrier_between_two_for_loops_LOOPS"
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..dedc87900b83a70e9dc0fe57f0ab8a4deff95479
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,14 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: kill hanging tests after 30 minutes
++
++--- a/cmake/run_test.cmake
+++++ b/cmake/run_test.cmake
++@@ -12,7 +12,7 @@ endif()
++ string(REPLACE "####" ";" test_cmd_separated "${test_cmd}")
++ 
++ execute_process(
++-  COMMAND ${test_cmd_separated}
+++  COMMAND timeout -k 60 1800 ${test_cmd_separated}
++   RESULT_VARIABLE test_not_successful
++   OUTPUT_VARIABLE stdout
++   ERROR_VARIABLE stderr
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..cd4b4c3db9db752e50576feb4b83daa3c2664056
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,15 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: we move the embedded copy aside to use system CL headers
++Forwarded: no-needed
++
++--- a/include/CMakeLists.txt
+++++ b/include/CMakeLists.txt
++@@ -23,7 +23,7 @@
++ #
++ #=============================================================================
++ 
++-add_subdirectory("CL")
+++#add_subdirectory("CL")
++ 
++ set(PRIVATE_HEADERS _enable_all_exts.h _builtin_renames.h
++                     _kernel.h _clang_opencl.h
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a43205883a2a6cce18d1dcbf70ec981013cb2e39
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,18 @@@
++Author: Andreas Beckmann <anbe@debian.org>
++Description: dump some cmake information
++Forwarded: not-needed
++
++--- a/cmake/LLVM.cmake
+++++ b/cmake/LLVM.cmake
++@@ -24,6 +24,11 @@
++ #
++ #=============================================================================
++ 
+++MESSAGE(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
+++MESSAGE(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
+++MESSAGE(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
+++MESSAGE(STATUS "CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}")
+++
++ if(DEFINED WITH_LLVM_CONFIG AND WITH_LLVM_CONFIG)
++   # search for preferred version
++   if(IS_ABSOLUTE "${WITH_LLVM_CONFIG}")
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d4c905ba275dbc004de4bc037d5bc524fdc11414
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,8 @@@
++Document: pocl-doc
++Title: Documentation for the pocl library
++Author: The pocl developers
++Section: Programming
++
++Format: HTML
++Index: /usr/share/doc/pocl-doc/html/index.html
++Files: /usr/share/doc/pocl-doc/html/*.html
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7a69846d00ee392c604ea81a4dfe79782be0e288
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++build-doc/html
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..724e0844955307c264b28a9319b65da3e99bb2c5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++README
++TODO
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..65491496652c437377b1a5f726e10579bcea10d7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++etc/OpenCL/vendors/pocl.icd
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..aca7cada9db5543e68eb28733298c867387bf12a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++# This is kind of a metapackage.
++package-contains-no-arch-dependent-files
diff --cc debian/rules
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b7627d9871e93092e8359e0d2578d201c15782c8
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,129 @@@
++#!/usr/bin/make -f
++# See debhelper(7) (uncomment to enable)
++# output every command that modifies files on the build system.
++#DH_VERBOSE = 1
++
++# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
++DPKG_EXPORT_BUILDFLAGS = 1
++include /usr/share/dpkg/default.mk
++include /usr/share/dpkg/architecture.mk
++include /usr/share/dpkg/pkg-info.mk
++
++# see FEATURE AREAS in dpkg-buildflags(1)
++export DEB_BUILD_MAINT_OPTIONS = hardening=+all
++
++# see ENVIRONMENT in dpkg-buildflags(1)
++# package maintainers to append CFLAGS
++#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
++
++LLVM_VERSION                   = $(shell sed -n -r '/^Build/,/^$$/s/.*llvm-([0-9]+)-dev.*/\1/p' debian/control)
++
++LLVM_ARCH-amd64                        = distro
++#LLVM_ARCH-amd64                       = x86-64
++#LLVM_ARCH-arm64                       = generic
++LLVM_ARCH-armel                        = arm946e-s            # arch=armv5te
++# armhf should rather be arch=armv7-a, e.g. cpu=cortex-a5 or similar with attr=+vfp3,+d16,+thumb2,-neon,-vfp4
++LLVM_ARCH-armhf                        = arm1156t2f-s
++LLVM_ARCH-hurd-i386            = $(LLVM_ARCH-i386)
++LLVM_ARCH-i386                         = i686                 # clang targets pentium4 by default
++LLVM_ARCH-kfreebsd-amd64       = $(LLVM_ARCH-amd64)
++LLVM_ARCH-kfreebsd-i386                = $(LLVM_ARCH-i386)
++#LLVM_ARCH-mips                        = mips32r2 # guess
++#LLVM_ARCH-mips64el            = mips64r2 # guess
++#LLVM_ARCH-mipsel              = mips32r2 # guess
++#LLVM_ARCH-powerpc             = ppc
++#LLVM_ARCH-ppc64                       = ppc64 # guess
++#LLVM_ARCH-ppc64el             = ppc64le
++#LLVM_ARCH-s390x                       = z10
++#LLVM_ARCH-sparc64             = v8 # guess
++LLVM_ARCH-x32                  = $(LLVM_ARCH-amd64)
++
++LLC_HOST_CPU   = $(or $(patsubst pocl_cpu=%,%,$(filter pocl_cpu=%,$(DEB_BUILD_OPTIONS))),$(LLVM_ARCH-$(DEB_HOST_ARCH)),GENERIC)
++
++# NEON, optional for Debian, must not be used
++EXTRA_HOST_CLANG_FLAGS-armhf   = -mfpu=vfp3-d16
++# TODO: export KERNEL_LIB_OPT_FLAGS= -mattr=-neon,+d16,+vfp3,-vfp4,+v7,+aclass,+thumb2
++
++# doc for symbols:
++# http://www.eyrie.org/~eagle/journal/2012-01/008.html
++# main packaging script based on dh7 syntax
++%:
++      dh $@ --with pkgkde_symbolshelper
++
++getval                         = $(or $($1-$(DEB_HOST_ARCH)),$($1))
++var2flag               = $(if $(strip $(call getval,$1)),-D$1="$(call getval,$1)")
++POCL_CONFIGURE_FLAGS   =
++POCL_CONFIGURE_FLAGS  += -DENABLE_ICD=ON
++POCL_CONFIGURE_FLAGS  += -DWITH_LLVM_CONFIG=/usr/bin/llvm-config-$(LLVM_VERSION)
++POCL_CONFIGURE_FLAGS  += $(if $(filter distro,$(LLC_HOST_CPU)),-DLLC_HOST_CPU=GENERIC -DKERNELLIB_HOST_CPU_VARIANTS=distro,-DLLC_HOST_CPU=$(LLC_HOST_CPU))
++POCL_CONFIGURE_FLAGS  += $(call var2flag,EXTRA_HOST_CLANG_FLAGS)
++POCL_CONFIGURE_FLAGS  += -DPOCL_ICD_ABSOLUTE_PATH=OFF
++POCL_CONFIGURE_FLAGS  += -DHARDENING_ENABLE=ON
++POCL_CONFIGURE_FLAGS  += -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF
++ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf))
++POCL_CONFIGURE_FLAGS  += -DPRINTF_BUFFER_SIZE=4096
++endif
++
++execute_before_dh_auto_configure:
++      test ! -d include/CL || mv -v include/CL include/_CL
++      test ! -d include/OpenCL || mv -v include/OpenCL include/_OpenCL
++
++execute_after_dh_auto_clean:
++      test ! -d include/_CL || mv -v include/_CL include/CL
++      test ! -d include/_OpenCL || mv -v include/_OpenCL include/OpenCL
++
++override_dh_auto_configure:
++      @echo Using LLC_HOST_CPU=$(LLC_HOST_CPU)
++      -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -version
++      -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -mattr=help
++      dh_auto_configure -- $(POCL_CONFIGURE_FLAGS)
++
++override_dh_auto_build-indep:
++ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
++      sphinx-build -N -b html doc/sphinx/source build-doc/html
++else
++      mkdir -p build-doc/html
++endif
++
++override_dh_shlibdeps:
++      dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/pocl -- --warnings=7
++
++override_dh_auto_test-indep:
++override_dh_auto_test-arch:
++      # Failure in testsuite is delayed until symbols handling
++      # and all files are logged.
++      $(RM) debian/stamp-failed-testsuite
++      $(RM) -r debian/kcache
++      mkdir debian/kcache
++      env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \
++              OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \
++              POCL_BUILDING=1 POCL_DEVICES=basic clinfo || touch debian/stamp-failed-testsuite
++      env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \
++              OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \
++              POCL_BUILDING=1 clinfo || touch debian/stamp-failed-testsuite
++      @set -ex; if ! env POCL_CACHE_DIR="$(CURDIR)/debian/kcache" dh_auto_test ; then \
++              echo "***** The testsuite has failed! *****" ; \
++              touch debian/stamp-failed-testsuite; \
++      fi
++      $(RM) -r debian/kcache
++
++run_dh_makeshlibs:
++      dh_makeshlibs
++
++delayed_check_dh_auto_test_result: run_dh_makeshlibs
++      @set -ex; if test -f debian/stamp-failed-testsuite ; then \
++              echo "***** The testsuite has failed! *****" ; \
++              exit 1 ; \
++      fi
++      @test -f obj-*/Testing/Temporary/LastTest.log && echo 'The testsuite has passed all tests.' || echo '*** The testsuite was *NOT* run! ***'
++
++override_dh_makeshlibs: run_dh_makeshlibs delayed_check_dh_auto_test_result
++
++override_dh_gencontrol:
++      dh_gencontrol -- \
++              -V'LLVM:Version=$(LLVM_VERSION)' \
++
++
++fix-symbols:
++      pkgkde-getbuildlogs
++      echo "pkgkde-symbolshelper batchpatch -v $(DEB_VERSION_EPOCH_UPSTREAM) pocl_$(DEB_DISTRIBUTION)_logs/pocl_$(DEB_VERSION)_*build"
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++3.0 (quilt)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..aa75a96e059fdc6498cb9a6edd5ad6dcbc8651a5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++# the examples directory only contains CMakeFiles for external testsuites
++package-does-not-install-examples examples/
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a712608217291954a0eebcb7d178eefe0eb0f34c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,7 @@@
++Test-Command: env POCL_DEVICES=basic clinfo
++Depends: clinfo, pocl-opencl-icd
++Restrictions: superficial
++
++Test-Command: clinfo
++Depends: clinfo, pocl-opencl-icd
++Restrictions: superficial
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..dcb39aa9c5f0cb50b395b8164bb9858bf37bccbf
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++Bug-Database: https://github.com/pocl/pocl/issues
++Bug-Submit: https://github.com/pocl/pocl/issues/new
++Repository: https://github.com/pocl/pocl.git
++Repository-Browse: https://github.com/pocl/pocl
diff --cc debian/watch
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ec09000b9b251fc9827574fa34c77538b02d8eda
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++version=4
++opts="uversionmangle=s/-RC(\d*)/~rc$1/, filenamemangle=s/-RC(\d*)/~rc$1/;s%(?:^.*?/)?v?(\d[\d.\~rc]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \
++   https://github.com/pocl/pocl/releases \
++   (?:.*?/)?v?(\d[\d.RC-]*)\.tar\.gz debian uupdate