aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG4
-rw-r--r--README25
-rw-r--r--README.sources17
-rw-r--r--SECURITY.md6
-rw-r--r--classes/uefi-comboapp.bbclass6
-rw-r--r--conf/include/maintainers.inc94
-rw-r--r--conf/layer.conf13
-rw-r--r--conf/machine/include/intel-common-pkgarch.inc26
-rw-r--r--conf/machine/include/intel-core2-32-common.inc4
-rw-r--r--conf/machine/include/intel-corei7-64-common.inc4
-rw-r--r--conf/machine/include/meta-intel.inc31
-rw-r--r--conf/machine/include/qemu-intel.inc2
-rw-r--r--conf/machine/include/qemuboot-intel.inc25
-rw-r--r--conf/machine/include/tune-skylake.inc48
-rw-r--r--conf/machine/intel-core2-32.conf5
-rw-r--r--conf/machine/intel-corei7-64.conf10
-rw-r--r--conf/machine/intel-skylake-64.conf9
-rw-r--r--custom-licenses/EULA392
-rw-r--r--custom-licenses/ISSL114
-rw-r--r--custom-licenses/syrah32
-rw-r--r--documentation/dpcpp-compiler.md107
-rw-r--r--dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.bb (renamed from dynamic-layers/clang-layer/recipes-core/dnn/onednn_2.1.1.bb)22
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Fix-debug-info-of-work-item-builtin-translation-745.patch119
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-Add-cl_khr_extended_subgroup-extensions.patch812
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch111
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch146
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/fix-shared-libs.patch30
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-OpenCL-3.0-support.patch8259
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Remove-repo-name-in-LLVM-IR.patch50
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-skip-building-tests.patch51
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-OpenCL-3.0-support.patch8453
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-Remove-repo-name-in-LLVM-IR.patch50
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch51
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend35
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch71
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch16
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch40
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.04.18912.bb56
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb64
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-Fix-build-with-LLVM-12.patch2433
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch31
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch24
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-skip-execution-of-ElfPackager.patch43
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-Review-fixes-for-LLVM-12-phase-1.patch318
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch (renamed from dynamic-layers/clang-layer/recipes-opencl/igc/files/improve_src_package_reproducibility.patch)10
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Review-fixes-for-LLVM-12-phase-2.patch123
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/link-to-LLVMGenXIntrinsics.patch71
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.15985.7.bb75
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.6646.bb45
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch49
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch32
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch60
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-make-sure-only-static-libraries-linked-for-native-bu.patch42
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc (renamed from dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_11.0.0.bb)21
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb35
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb34
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb5
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb5
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/vc-intrinsics/vc-intrinsics_1.0.bb24
-rw-r--r--dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.0.0.bb (renamed from dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2021.2.bb)24
-rw-r--r--dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb (renamed from dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2102.1.0.0.bb)25
-rw-r--r--dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch39
-rw-r--r--dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.6.bb (renamed from dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.4.3.bb)17
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch53
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch36
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch52
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest2
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb64
-rw-r--r--dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb (renamed from dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.2.3.bb)20
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb54
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb45
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb30
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb35
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb74
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb23
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb42
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch28
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb37
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb19
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch38
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch (renamed from dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERT-and-NULL-definition-so-we-can-c.patch)55
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb (renamed from dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0302.bb)30
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-CPU-Solving-the-build-failure-caused-by-setting-the-.patch43
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-fix-build-when-using-sysroot.patch32
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch90
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-dont-install-licenses-and-version-file.patch54
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch172
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cldNN-disable-Werror.patch30
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-cmake-Fix-overloaded-virtual-error.patch33
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-inference-engine-installation-fixes.patch223
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0004-protobuf-allow-target-protoc-to-be-built.patch45
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0005-cldnn-fix-inclusion-of-headers.patch53
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch32
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.2.bb63
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.0.0.bb54
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.2.bb123
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.0.0.bb143
-rw-r--r--lib/oeqa/runtime/cases/jhi.py41
-rw-r--r--lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt9
-rw-r--r--lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt14
-rw-r--r--recipes-bsp/formfactor/formfactor_0.0.bbappend2
-rw-r--r--recipes-bsp/intel-cmt-cat/intel-cmt-cat_23.11.1.bb29
-rw-r--r--recipes-bsp/metee/metee_3.2.4.bb (renamed from recipes-bsp/metee/metee_3.0.0.bb)5
-rw-r--r--recipes-core/images/core-image-minimal-initramfs.bbappend2
-rw-r--r--recipes-core/images/core-image-tiny.bb4
-rw-r--r--recipes-core/libxcam/libxcam/0001-fake_v4l2_device.h-fix-narrowing-warning.patch94
-rw-r--r--recipes-core/libxcam/libxcam_1.5.0.bb13
-rw-r--r--recipes-core/meta/icx-environment.inc15
-rw-r--r--recipes-core/meta/meta-environment-extsdk.bbappend3
-rw-r--r--recipes-core/meta/meta-environment.bbappend3
-rw-r--r--recipes-core/microcode/intel-microcode_20240312.bb (renamed from recipes-core/microcode/intel-microcode_20210216.bb)11
-rw-r--r--recipes-core/microcode/iucode-tool_2.3.1.bb6
-rw-r--r--recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch55
-rw-r--r--recipes-core/ovmf/ovmf-shell-image-enrollkeys.bb4
-rw-r--r--recipes-core/ovmf/ovmf_%.bbappend6
-rw-r--r--recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend1
-rw-r--r--recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend1
-rw-r--r--recipes-core/zlib/zlib-intel_1.2.11.1.jtkv6.3.bb18
-rw-r--r--recipes-devtools/slimboot/slimboot-tools_git.bb6
-rw-r--r--recipes-graphics/gmmlib/files/0001-Add-new-DG2-device-IDs-194.patch38
-rw-r--r--recipes-graphics/gmmlib/files/0001-Introduce-ARL-H-support-172.patch42
-rw-r--r--recipes-graphics/gmmlib/gmmlib_22.3.15.bb (renamed from recipes-graphics/gmmlib/gmmlib_21.1.1.bb)10
-rw-r--r--recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch2
-rw-r--r--recipes-graphics/hdcp/hdcp_21.2.0.bb (renamed from recipes-graphics/hdcp/hdcp_20.4.0.bb)6
-rw-r--r--recipes-graphics/libva/libva-intel-utils_2.20.1.bb (renamed from recipes-graphics/libva/libva-intel-utils_2.11.1.bb)6
-rw-r--r--recipes-graphics/libva/libva-intel_2.20.0.bb (renamed from recipes-graphics/libva/libva-intel_2.11.0.bb)23
-rw-r--r--recipes-graphics/metrics-discovery/metrics-discovery/0001-md_internal.h-Replace-string.h-with-string-C-header-.patch34
-rw-r--r--recipes-graphics/metrics-discovery/metrics-discovery_1.12.170.bb (renamed from recipes-graphics/metrics-discovery/metrics-discovery_1.5.108.bb)5
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-ast_1.1.6.bb (renamed from recipes-graphics/xorg-driver/xf86-video-ast_1.1.5.bb)4
-rw-r--r--recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb (renamed from recipes-kernel/intel-ethernet/ixgbe_5.11.3.bb)16
-rw-r--r--recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb (renamed from recipes-kernel/intel-ethernet/ixgbevf_4.11.1.bb)18
-rw-r--r--recipes-kernel/iwlwifi/backport-iwlwifi_git.bb20
-rw-r--r--recipes-kernel/linux/linux-intel-dev.bb34
-rw-r--r--recipes-kernel/linux/linux-intel-rt_5.4.bb30
-rw-r--r--recipes-kernel/linux/linux-intel-rt_6.6.bb (renamed from recipes-kernel/linux/linux-intel-rt_5.10.bb)24
-rw-r--r--recipes-kernel/linux/linux-intel.inc20
-rw-r--r--recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch48
-rw-r--r--recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch30
-rw-r--r--recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch58
-rw-r--r--recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch40
-rw-r--r--recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg7
-rw-r--r--recipes-kernel/linux/linux-intel/enable_lynxpoint_gpio.cfg1
-rw-r--r--recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch39
-rw-r--r--recipes-kernel/linux/linux-intel_5.10.bb22
-rw-r--r--recipes-kernel/linux/linux-intel_5.4.bb26
-rw-r--r--recipes-kernel/linux/linux-intel_6.6.bb21
-rw-r--r--recipes-kernel/linux/linux-intel_6.8.bb20
-rw-r--r--recipes-kernel/linux/linux-yocto-dev.bbappend22
-rw-r--r--recipes-kernel/linux/linux-yocto-rt_%.bbappend (renamed from recipes-kernel/linux/linux-yocto-rt_5.%.bbappend)0
-rw-r--r--recipes-kernel/linux/linux-yocto_%.bbappend4
-rw-r--r--recipes-kernel/linux/linux-yocto_5.%.bbappend1
-rw-r--r--recipes-kernel/linux/meta-intel-compat-kernel.inc12
-rw-r--r--recipes-multimedia/itt/itt_3.24.6.bb (renamed from recipes-multimedia/itt/itt_3.18.10.bb)10
-rw-r--r--recipes-multimedia/libva/files/0001-Disable-vp9-padding-on-mtl.patch35
-rw-r--r--recipes-multimedia/libva/files/0002-Force-ARGB-surface-to-tile4-for-ACM.patch44
-rw-r--r--recipes-multimedia/libva/files/0004-Add-device-ID-for-ARL.patch45
-rw-r--r--recipes-multimedia/libva/files/0005-Add-XR24-support-to-DMABuf.patch34
-rw-r--r--recipes-multimedia/libva/files/0006-add-INTEL-MEDIA-ALLOC-refineE-to-specify-the-memory-.patch214
-rw-r--r--recipes-multimedia/libva/files/0007-Skip-report-keys.patch78
-rw-r--r--recipes-multimedia/libva/files/0008-Limit-INTEL-MEDIA-ALLOC-MODE-to-MTL-and-ARL-only.patch255
-rw-r--r--recipes-multimedia/libva/files/0009-Skip-cache-bucket-realloc-for-default-mode-0.patch33
-rw-r--r--recipes-multimedia/libva/files/0010-Fix-failed-4k-video-wall-test-case-and-color-corrupt.patch195
-rw-r--r--recipes-multimedia/libva/files/0011-Disable-422H-format-output.patch33
-rw-r--r--recipes-multimedia/libva/files/0012-Decode-Fix-AVC-decode-SFC-4K-hang-issue.patch32
-rw-r--r--recipes-multimedia/libva/intel-media-driver_23.4.3.bb (renamed from recipes-multimedia/libva/intel-media-driver_21.1.3.bb)25
-rw-r--r--recipes-multimedia/libva/intel-vaapi-driver_2.4.1.bb6
-rw-r--r--recipes-multimedia/libyami/libyami-utils/0001-Fix-build-with-clang.patch96
-rw-r--r--recipes-multimedia/libyami/libyami-utils_1.3.2.bb26
-rw-r--r--recipes-multimedia/libyami/libyami_1.3.2.bb24
-rw-r--r--recipes-multimedia/mediasdk/files/0001-Don-t-try-to-autheticate-with-render-node.patch44
-rw-r--r--recipes-multimedia/mediasdk/files/fix-gcc13.patch15
-rw-r--r--recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb (renamed from recipes-multimedia/mediasdk/intel-mediasdk_21.1.3.bb)20
-rw-r--r--recipes-multimedia/onevpl/files/0001-ARLH-DID-open-source-6286.patch39
-rw-r--r--recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch32
-rw-r--r--recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch96
-rw-r--r--recipes-multimedia/onevpl/files/0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch28
-rw-r--r--recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb33
-rw-r--r--recipes-multimedia/onevpl/onevpl_2023.4.0.bb40
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch27
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb/0001-crypto-mb-Make-sure-libs-are-installed-correctly.patch42
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb/0002-cmake-exclude-Yocto-build-flags.patch45
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb28
-rw-r--r--recipes-oneapi/onedpl/onedpl_2022.3.0.bb26
-rw-r--r--recipes-oneapi/setup-oneapi-env/files/intel-oneapi-runtime.conf4
-rw-r--r--recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb20
-rw-r--r--recipes-selftest/images/secureboot-selftest-image-unsigned.bb4
-rw-r--r--recipes-support/isa-l/isa-l_2.31.0.bb (renamed from recipes-support/isa-l/isa-l_2.30.0.bb)8
-rw-r--r--recipes-support/jhi/jhi_1.41.bb72
-rw-r--r--recipes-support/libipt/libipt_2.1.1.bb (renamed from recipes-support/libipt/libipt_2.0.4.bb)11
-rw-r--r--recipes-support/sbsigntool/sbsigntool-native_git.bb16
-rw-r--r--recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch2
194 files changed, 4601 insertions, 23288 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a99cbb1f..2ed8af05 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -64,7 +64,7 @@ without having to use hardware. The virtio drivers are added via
KERNEL_FEATURES_INTEL_COMMON. This prevents them from being added to
custom kernels by default. They can be removed by adding the
following to a conf or kernel bbappend file:
- KERNEL_FEATURES_INTEL_COMMON_remove = “cfg/virtio.scc”
+ KERNEL_FEATURES_INTEL_COMMON:remove = “cfg/virtio.scc”
OVMF firmware is also built and can be used in order to emulate a UEFI
environment. A full runqemu command line for intel-corei7-64 could look
like this:
@@ -84,4 +84,4 @@ setting, it will not work in as the primary MACHINE tune as the bootloader needs
to be built as a 64bit binary. The setup for this would be as follows:
require conf/multilib.conf
MULTILIBS = "multilib:libx32
- DEFAULTTUNE_virtclass-multilib-libx32 = "corei7-64-x32"
+ DEFAULTTUNE:virtclass-multilib-libx32 = "corei7-64-x32"
diff --git a/README b/README
index f377c67b..ca2c5041 100644
--- a/README
+++ b/README
@@ -206,15 +206,15 @@ based installer image instead of default wic image. To build it, you need to
add below configuration to local.conf :
WKS_FILE = "image-installer.wks.in"
- IMAGE_FSTYPES_append = " ext4"
- IMAGE_TYPEDEP_wic = "ext4"
+ IMAGE_FSTYPES:append = " ext4"
+ IMAGE_TYPEDEP:wic = "ext4"
INITRD_IMAGE_LIVE="core-image-minimal-initramfs"
do_image_wic[depends] += "${INITRD_IMAGE_LIVE}:do_image_complete"
do_rootfs[depends] += "virtual/kernel:do_deploy"
- IMAGE_BOOT_FILES_append = "\
+ IMAGE_BOOT_FILES:append = "\
${KERNEL_IMAGETYPE} \
microcode.cpio \
- ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.ext4;rootfs.img \
+ ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.rootfs.ext4;rootfs.img \
${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', 'grub-efi-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', '${IMAGE_ROOTFS}/boot/EFI/BOOT/grub.cfg;EFI/BOOT/grub.cfg', '', d)} \
${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', 'systemd-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
@@ -394,9 +394,20 @@ Note that both 64-bit and 32-bit firmware is available for the MinnowBoard
Turbot, so it is tested against both intel-corei7-64 and intel-core2-32.
intel-corei7-64:
- NUC6i5SYH
- NUC7i7BNH
- Coffee Lake-H
+ Alder Lake-P
+ Alder Lake-S
+ Elkhart Lake
+ Kaby Lake
+ Raptor Lake-P
+ Tiger Lake
+
+intel-skylake-64:
+ Alder Lake-P
+ Alder Lake-S
+ Elkhart Lake
+ Kaby Lake
+ Raptor Lake-P
+ Tiger Lake
intel-core2-32:
MinnowBoard Turbot
diff --git a/README.sources b/README.sources
deleted file mode 100644
index 9b483ee0..00000000
--- a/README.sources
+++ /dev/null
@@ -1,17 +0,0 @@
-The sources for the packages comprising the images shipped with this
-BSP can be found at the following location:
-
-http://downloads.yoctoproject.org/mirror/sources/
-
-The metadata used to generate the images shipped with this BSP, in
-addition to the code contained in this BSP, can be found at the
-following location:
-
-http://downloads.yoctoproject.org/releases/yocto/yocto-2.7/poky-warrior-21.0.0.tar.bz2
-
-The metadata used to generate the images shipped with this BSP, in
-addition to the code contained in this BSP, can also be found at the
-following locations:
-
-git://git.yoctoproject.org/poky.git
-git://git.yoctoproject.org/meta-intel
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..e70fcb0f
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,6 @@
+# Security Policy
+Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
+
+## Reporting a Vulnerability
+Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
+
diff --git a/classes/uefi-comboapp.bbclass b/classes/uefi-comboapp.bbclass
index 4ecc5535..a05e0ca0 100644
--- a/classes/uefi-comboapp.bbclass
+++ b/classes/uefi-comboapp.bbclass
@@ -4,8 +4,8 @@
# it with the efi stub obtained from systemd-boot.
# Don't add syslinux or build an ISO
-PCBIOS_forcevariable = "0"
-NOISO_forcevariable = "1"
+PCBIOS:forcevariable = "0"
+NOISO:forcevariable = "1"
# image-live.bbclass will default INITRD_LIVE to the image INITRD_IMAGE creates.
# We want behavior to be consistent whether or not "live" is in IMAGE_FSTYPES, so
@@ -138,7 +138,7 @@ build_efi_cfg() {
:
}
-populate_kernel_append() {
+populate_kernel:append() {
# The kernel and initrd are built into the app, so we don't need these
if [ -f $dest/initrd ]; then
rm $dest/initrd
diff --git a/conf/include/maintainers.inc b/conf/include/maintainers.inc
index 90c39e4e..9849d0d8 100644
--- a/conf/include/maintainers.inc
+++ b/conf/include/maintainers.inc
@@ -1,44 +1,54 @@
# This file contains a list of recipe maintainers for meta-intel
-RECIPE_MAINTAINER_pn-backport-iwlwifi = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-core-image-rt = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-core-image-rt-sdk = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-core-image-tiny = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-core-image-minimal-initramfs = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-gmmlib = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-hdcp = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-intel-graphics-compiler = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-intel-compute-runtime = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-intel-media-driver = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-intel-mediasdk = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-intel-microcode = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-intel-vaapi-driver = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-isa-l = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-itt = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-ixgbe = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-ixgbevf = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-iucode-tool = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-jhi = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-level-zero = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-libipt = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-libyami = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-libyami-utils = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-libxcam = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-linux-intel = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-linux-intel-rt = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-linux-intel-dev = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-lms = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-metee = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-metrics-discovery = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-onednn = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-open-model-zoo = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-opencl-clang = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-openvino-inference-engine = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-openvino-model-optimizer = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-ovmf-shell-image-enrollkeys = "Naveen Saini <naveen.kumar.saini@intel.com>"
-RECIPE_MAINTAINER_pn-sbsigntool-native = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-secureboot-selftest-image-signed = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-secureboot-selftest-image-unsigned = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-thermald = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-xf86-video-ast = "Anuj Mittal <anuj.mittal@intel.com>"
-RECIPE_MAINTAINER_pn-zlib-intel = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-backport-iwlwifi = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-core-image-rt = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-core-image-rt-sdk = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-core-image-tiny = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-core-image-minimal-initramfs = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-embree = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-gmmlib = "Lim Siew Hoon <siew.hoon.lim@intel.com>"
+RECIPE_MAINTAINER:pn-hdcp = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-intel-cmt-cat = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-intel-compute-runtime = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-intel-crypto-mb = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-intel-graphics-compiler = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-intel-media-driver = "Lim Siew Hoon <siew.hoon.lim@intel.com>"
+RECIPE_MAINTAINER:pn-intel-mediasdk = "Lim Siew Hoon <siew.hoon.lim@intel.com>"
+RECIPE_MAINTAINER:pn-intel-microcode = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-intel-vaapi-driver = "Lim Siew Hoon <siew.hoon.lim@intel.com>"
+RECIPE_MAINTAINER:pn-ipmctl = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-isa-l = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-ispc = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-itt = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-ixgbe = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-ixgbevf = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-iucode-tool = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-level-zero = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-libipt = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-libva-intel = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-libva-intel-utils = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-libxcam = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-linux-intel = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-linux-intel-rt = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-linux-intel-dev = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-lms = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-metee = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-metrics-discovery = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-oidn = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-onednn = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-onedpl = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-onevpl = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-onevpl-intel-gpu = "Yew Chang Ching <chang.ching.yew@intel.com>"
+RECIPE_MAINTAINER:pn-open-model-zoo = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-opencl-clang = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-openvino-inference-engine = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-openvino-model-optimizer = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-openvkl = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-ospray = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-ovmf-shell-image-enrollkeys = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-rkcommon = "Naveen Saini <naveen.kumar.saini@intel.com>"
+RECIPE_MAINTAINER:pn-sbsigntool-native = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-secureboot-selftest-image-signed = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-secureboot-selftest-image-unsigned = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-thermald = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-xf86-video-ast = "Anuj Mittal <anuj.mittal@intel.com>"
diff --git a/conf/layer.conf b/conf/layer.conf
index c4781ffd..97dfb897 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -10,15 +10,16 @@ BBFILE_PATTERN_intel := "^${LAYERDIR}/"
BBFILE_PRIORITY_intel = "5"
# Additional license directories.
-LICENSE_PATH += "${LAYERDIR}/custom-licenses"
+CUSTOM_LICENSES_PATH = "${LAYERDIR}/custom-licenses"
+LICENSE_PATH += "${CUSTOM_LICENSES_PATH}"
LAYERDEPENDS_intel = "core"
-LAYERRECOMMENDS_intel = "dpdk intel-qat"
+LAYERRECOMMENDS_intel = "dpdk"
# This should only be incremented on significant changes that will
# cause compatibility issues with other layers
LAYERVERSION_intel = "5"
-LAYERSERIES_COMPAT_intel = "dunfell gatesgarth hardknott"
+LAYERSERIES_COMPAT_intel = "kirkstone scarthgap"
BBFILES_DYNAMIC += " \
clang-layer:${LAYERDIR}/dynamic-layers/clang-layer/*/*/*.bb \
@@ -31,10 +32,6 @@ BBFILES_DYNAMIC += " \
require ${LAYERDIR}/conf/include/maintainers.inc
-PREFERRED_PROVIDER_zlib ?= "zlib"
-PREFERRED_PROVIDER_zlib-native ?= "zlib-native"
-PREFERRED_PROVIDER_nativesdk-zlib ?= "nativesdk-zlib"
-
# Use the libva from OE-Core when layer is included but no MACHINE
# from meta-intel is being used.
PREFERRED_PROVIDER_libva ?= "libva"
@@ -44,3 +41,5 @@ PREFERRED_PROVIDER_nativesdk-libva ?= "nativesdk-libva"
PREFERRED_PROVIDER_libva-utils ?= "libva-utils"
PREFERRED_PROVIDER_libva-utils-native ?= "libva-utils-native"
PREFERRED_PROVIDER_nativesdk-libva-utils ?= "nativesdk-libva-utils"
+
+# addpylib ${LAYERDIR}/lib oeqa
diff --git a/conf/machine/include/intel-common-pkgarch.inc b/conf/machine/include/intel-common-pkgarch.inc
index d0f208bd..94d77e06 100644
--- a/conf/machine/include/intel-common-pkgarch.inc
+++ b/conf/machine/include/intel-common-pkgarch.inc
@@ -1,15 +1,15 @@
INTEL_COMMON_PACKAGE_ARCH ?= "${TUNE_PKGARCH}-intel-common"
-PACKAGE_ARCH_pn-linux-intel = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-intel-rt = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-intel-tiny = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-intel-dev = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-yocto = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-yocto-rt = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-yocto-tiny = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-linux-yocto-dev = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-intel-microcode = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-backport-iwlwifi = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-ixgbe = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_ARCH_pn-ixgbevf = "${INTEL_COMMON_PACKAGE_ARCH}"
-PACKAGE_EXTRA_ARCHS_append += "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-intel = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-intel-rt = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-intel-tiny = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-intel-dev = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-yocto = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-yocto-rt = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-yocto-tiny = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-linux-yocto-dev = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-intel-microcode = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-backport-iwlwifi = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-ixgbe = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_ARCH:pn-ixgbevf = "${INTEL_COMMON_PACKAGE_ARCH}"
+PACKAGE_EXTRA_ARCHS:append = " ${INTEL_COMMON_PACKAGE_ARCH}"
MACHINEOVERRIDES =. "${INTEL_COMMON_PACKAGE_ARCH}:"
diff --git a/conf/machine/include/intel-core2-32-common.inc b/conf/machine/include/intel-core2-32-common.inc
index 8c469499..ce34d9bb 100644
--- a/conf/machine/include/intel-core2-32-common.inc
+++ b/conf/machine/include/intel-core2-32-common.inc
@@ -3,5 +3,5 @@
#
DEFAULTTUNE ?= "core2-32"
-require conf/machine/include/tune-core2.inc
-require conf/machine/include/x86-base.inc
+require conf/machine/include/x86/tune-core2.inc
+require conf/machine/include/x86/x86-base.inc
diff --git a/conf/machine/include/intel-corei7-64-common.inc b/conf/machine/include/intel-corei7-64-common.inc
index 00282569..3498ebe3 100644
--- a/conf/machine/include/intel-corei7-64-common.inc
+++ b/conf/machine/include/intel-corei7-64-common.inc
@@ -3,5 +3,5 @@
#
DEFAULTTUNE ?= "corei7-64"
-require conf/machine/include/tune-corei7.inc
-require conf/machine/include/x86-base.inc
+require conf/machine/include/x86/tune-corei7.inc
+require conf/machine/include/x86/x86-base.inc
diff --git a/conf/machine/include/meta-intel.inc b/conf/machine/include/meta-intel.inc
index 19f7857d..230d0253 100644
--- a/conf/machine/include/meta-intel.inc
+++ b/conf/machine/include/meta-intel.inc
@@ -5,17 +5,11 @@
#
PREFERRED_PROVIDER_virtual/kernel ?= "linux-intel"
-PREFERRED_PROVIDER_virtual/kernel_poky-tiny ?= "linux-intel"
+PREFERRED_PROVIDER_virtual/kernel:poky-tiny ?= "linux-intel"
-# Only use the Intel-tuned zlib for target builds to improve reuse
-PREFERRED_PROVIDER_zlib = "zlib-intel"
-PREFERRED_PROVIDER_zlib-native = "zlib-native"
-PREFERRED_PROVIDER_nativesdk-zlib = "nativesdk-zlib"
-
-PREFERRED_VERSION_linux-intel ?= "5.10%"
-PREFERRED_VERSION_linux-intel-rt ?= "5.10%"
-PREFERRED_VERSION_linux-intel_poky-altcfg ?= "5.4%"
-PREFERRED_VERSION_linux-intel-rt_poky-altcfg ?= "5.4%"
+PREFERRED_VERSION_linux-intel ?= "6.6%"
+PREFERRED_VERSION_linux-intel-rt ?= "6.6%"
+PREFERRED_VERSION_linux-intel:poky-altcfg ?= "6.8%"
# Need to point to latest version of libva needed for media components
PREFERRED_PROVIDER_libva = "libva-intel"
@@ -26,29 +20,28 @@ PREFERRED_PROVIDER_libva-utils = "libva-intel-utils"
PREFERRED_PROVIDER_libva-utils-native = "libva-intel-utils-native"
PREFERRED_PROVIDER_nativesdk-libva-utils = "nativesdk-libva-intel-utils"
-PREFERRED_VERSION_opencl-clang ?= "${@bb.utils.contains('LLVMVERSION', '10.0.1', '10.0.0', \
- bb.utils.contains('LLVMVERSION', '11.1.0', '11.0.0', '12.0.0', d), d)}"
-PREFERRED_VERSION_opencl-clang-native ?= "${@bb.utils.contains('LLVMVERSION', '10.0.1', '10.0.0', \
- bb.utils.contains('LLVMVERSION', '11.1.0', '11.0.0', '12.0.0', d), d)}"
+LLVM_MAJOR_VERSION = "${@d.getVar('LLVMVERSION').split('.')[0]}"
+PREFERRED_VERSION_opencl-clang ?= "${@bb.utils.contains('LLVM_MAJOR_VERSION', '14', '14.0.0', '15.0.0', d)}"
+PREFERRED_VERSION_opencl-clang-native ?= "${@bb.utils.contains('LLVM_MAJOR_VERSION', '14', '14.0.0', '15.0.0', d)}"
XSERVER_X86_ASPEED_AST = "xf86-video-ast \
"
# include the user space intel microcode loading support in the generated images.
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', ' intel-microcode', '', d)}"
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', ' intel-microcode', '', d)}"
# recommended extra packages common to all intel machines
-MACHINE_EXTRA_RRECOMMENDS_append = " kernel-modules linux-firmware"
-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS_append = " kernel-module-i915 linux-firmware-i915"
+MACHINE_EXTRA_RRECOMMENDS:append = " kernel-modules linux-firmware"
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS:append = " kernel-module-i915 linux-firmware-i915 kernel-module-igc kernel-module-r8152"
# for the early boot time kernel microcode loading support,
# merge the microcode data in the final initrd image.
-INITRD_LIVE_prepend = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}"
+INITRD_LIVE:prepend = "${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}"
DISK_SIGNATURE_UUID ??= "deadbeef-dead-beef-dead-beefdeadbeef"
EFI_PROVIDER ?= "systemd-boot"
-EFI_PROVIDER_x86-x32 = "grub-efi"
+EFI_PROVIDER:x86-x32 = "grub-efi"
# Add general MACHINEOVERRIDE for meta-intel
MACHINEOVERRIDES =. "intel-x86-common:"
diff --git a/conf/machine/include/qemu-intel.inc b/conf/machine/include/qemu-intel.inc
index 81510404..4608db99 100644
--- a/conf/machine/include/qemu-intel.inc
+++ b/conf/machine/include/qemu-intel.inc
@@ -2,7 +2,7 @@
# distro content (in particular the kernel) less than qemu.inc.
# Ensure that qemu gets built when building images.
-EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+EXTRA_IMAGEDEPENDS += "qemu-system-native qemu-helper-native:do_addto_recipe_sysroot"
# Build ovmf firmware for uefi support in qemu.
EXTRA_IMAGEDEPENDS += "ovmf"
diff --git a/conf/machine/include/qemuboot-intel.inc b/conf/machine/include/qemuboot-intel.inc
index befcc250..17a1234d 100644
--- a/conf/machine/include/qemuboot-intel.inc
+++ b/conf/machine/include/qemuboot-intel.inc
@@ -1,19 +1,18 @@
# For runqemu
IMAGE_CLASSES += "qemuboot"
-QB_SYSTEM_NAME_intel-core2-32 = "qemu-system-i386"
-QB_CPU_intel-core2-32 = "-cpu coreduo"
-QB_CPU_KVM_intel-core2-32 = "-cpu kvm32"
+QB_SYSTEM_NAME:intel-core2-32 = "qemu-system-i386"
+QB_CPU:intel-core2-32 = "-cpu coreduo"
+QB_CPU_KVM:intel-core2-32 = "-cpu kvm32"
-QB_SYSTEM_NAME_intel-corei7-64 = "qemu-system-x86_64"
-QB_CPU_intel-corei7-64 = "-cpu Nehalem"
-QB_CPU_KVM_intel-corei7-64 = "-cpu kvm64"
+QB_SYSTEM_NAME:intel-corei7-64 = "qemu-system-x86_64"
+QB_CPU:intel-corei7-64 = "-cpu Nehalem"
+QB_CPU_KVM:intel-corei7-64 = "-cpu kvm64"
-QB_SYSTEM_NAME_intel-skylake-64 = "qemu-system-x86_64"
-QB_CPU_intel-skylake-64 = "-cpu Skylake-Client"
-QB_CPU_KVM_intel-skylake-64 = "-cpu Skylake-Client"
+QB_SYSTEM_NAME:intel-skylake-64 = "qemu-system-x86_64"
+QB_CPU:intel-skylake-64 = "-cpu Skylake-Client"
+QB_CPU_KVM:intel-skylake-64 = "-cpu Skylake-Client"
QB_AUDIO_DRV = "alsa"
-QB_AUDIO_OPT = "-soundhw ac97,es1370"
-QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1"
-# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
-QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
+QB_AUDIO_OPT = "-device AC97"
+QB_KERNEL_CMDLINE_APPEND = " oprofile.timer=1"
+QB_OPT_APPEND = " -usb -usbdevice tablet "
diff --git a/conf/machine/include/tune-skylake.inc b/conf/machine/include/tune-skylake.inc
deleted file mode 100644
index 4882600b..00000000
--- a/conf/machine/include/tune-skylake.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-# Settings for the GCC(1) cpu-type "skylake":
-#
-# Intel Skylake CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
-# SSE4.2, AVX, AVX2 and POPCNT instruction set support.
-#
-# This tune is recommended for Intel Skylake CPU (and beyond).
-#
-DEFAULTTUNE ?= "skylake-64"
-
-# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
-require conf/machine/include/tune-corei7.inc
-
-# Extra tune features
-TUNEVALID[skylake] = "Enable skylake specific processor optimizations"
-TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'skylake', ' -march=skylake ${SKYLAKE_TUNE} -mfpmath=sse', '', d)}"
-
-# Extra tune selections
-
-AVAILTUNES += "skylake-64"
-TUNE_FEATURES_tune-skylake-64 = "${TUNE_FEATURES_tune-x86-64} skylake"
-BASE_LIB_tune-skylake-64 = "lib64"
-TUNE_PKGARCH_tune-skylake-64 = "skylake-64"
-PACKAGE_EXTRA_ARCHS_tune-skylake-64 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64} skylake-64"
-QEMU_EXTRAOPTIONS_skylake-64 = " -cpu Skylake-Client"
-
-
-# Disable QEMU usermode by default (get avx2)
-MACHINE_FEATURES_remove = "qemu-usermode"
-
-# If qemu-usermode is enabled, we have to disable avx2 ISA extensions, but we can keep mtune as skylake vs generic
-SKYLAKE_TUNE .= "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', ' -mtune=skylake ${QEMU_UNAVAILABLE_ISA}', '-mtune=generic -mavx2', d)}"
-
-QEMU_UNAVAILABLE_ISA = " \
--mno-avx \
--mno-avx2 \
--mno-avx512f \
--mno-avx512er \
--mno-avx512cd \
--mno-avx512pf \
--mno-avx512dq \
--mno-avx512bw \
--mno-avx512vl \
--mno-avx512ifma \
--mno-avx512vbmi \
--mno-avx512vbmi2 \
--mno-avx512vnni \
--mno-avx512bitalg \
-"
diff --git a/conf/machine/intel-core2-32.conf b/conf/machine/intel-core2-32.conf
index 384ad1e9..5b134dc3 100644
--- a/conf/machine/intel-core2-32.conf
+++ b/conf/machine/intel-core2-32.conf
@@ -13,9 +13,6 @@ MACHINE_FEATURES += "intel-ucode"
MACHINE_HWCODECS ?= "intel-vaapi-driver gstreamer1.0-vaapi"
-# Enable optional QAT items:
-COMPATIBLE_MACHINE_pn-qat17 = "intel-core2-32"
-
XSERVER ?= "${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
${XSERVER_X86_FBDEV} \
@@ -32,4 +29,4 @@ APPEND += "rootwait console=ttyS0,115200 console=ttyPCH0,115200 console=tty0"
IMAGE_FSTYPES += "wic"
WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk-microcode.wks.in", "grub-bootdisk-microcode.wks.in", d)}"
-WKS_FILE_DEPENDS_append = " intel-microcode"
+WKS_FILE_DEPENDS:append = " intel-microcode"
diff --git a/conf/machine/intel-corei7-64.conf b/conf/machine/intel-corei7-64.conf
index 033b1aa9..968395fe 100644
--- a/conf/machine/intel-corei7-64.conf
+++ b/conf/machine/intel-corei7-64.conf
@@ -14,12 +14,8 @@ MACHINE_FEATURES += "intel-ucode"
MACHINE_HWCODECS ?= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '', 'intel-media-driver intel-mediasdk', d)} gstreamer1.0-vaapi"
# Enable optional dpdk:
-COMPATIBLE_MACHINE_pn-dpdk = "intel-corei7-64"
-
-# Enable optional QAT items:
-COMPATIBLE_MACHINE_pn-qat16 = "intel-corei7-64"
-COMPATIBLE_MACHINE_pn-qat17 = "intel-corei7-64"
-COMPATIBLE_MACHINE_pn-zlib-qat = "intel-corei7-64"
+COMPATIBLE_MACHINE:pn-dpdk = "intel-corei7-64"
+COMPATIBLE_MACHINE:pn-dpdk-module = "intel-corei7-64"
XSERVER ?= "${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
@@ -37,4 +33,4 @@ APPEND += "rootwait console=ttyS0,115200 console=tty0"
IMAGE_FSTYPES += "wic"
WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk-microcode.wks.in", "grub-bootdisk-microcode.wks.in", d)}"
-WKS_FILE_DEPENDS_append = " intel-microcode"
+WKS_FILE_DEPENDS:append = " intel-microcode"
diff --git a/conf/machine/intel-skylake-64.conf b/conf/machine/intel-skylake-64.conf
index eccd59b8..a2b392c2 100644
--- a/conf/machine/intel-skylake-64.conf
+++ b/conf/machine/intel-skylake-64.conf
@@ -4,8 +4,8 @@
#@DESCRIPTION: Machine configuration for 64 bit Intel Skylake CPU (and later) with MMX, SSE, SSE2, SSE3, SSE4.1, SSE4.2, AVX, and AVX2 instruction set support. Supports a moderately wide range of drivers that should boot and be usable on "typical" hardware.
require conf/machine/include/meta-intel.inc
-require conf/machine/include/x86-base.inc
-require conf/machine/include/tune-skylake.inc
+require conf/machine/include/x86/x86-base.inc
+require conf/machine/include/x86/tune-x86-64-v3.inc
require conf/machine/include/intel-common-pkgarch.inc
MACHINE_FEATURES += "efi"
@@ -14,7 +14,8 @@ MACHINE_FEATURES += "intel-ucode"
MACHINE_HWCODECS ?= "intel-media-driver intel-mediasdk gstreamer1.0-vaapi"
-COMPATIBLE_MACHINE_pn-dpdk = "intel-skylake-64"
+COMPATIBLE_MACHINE:pn-dpdk = "intel-skylake-64"
+COMPATIBLE_MACHINE:pn-dpdk-module = "intel-skylake-64"
XSERVER ?= "${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
@@ -32,4 +33,4 @@ APPEND += "rootwait console=ttyS0,115200 console=tty0"
IMAGE_FSTYPES += "wic"
WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk-microcode.wks.in", "grub-bootdisk-microcode.wks.in", d)}"
-WKS_FILE_DEPENDS_append = " intel-microcode"
+WKS_FILE_DEPENDS:append = " intel-microcode"
diff --git a/custom-licenses/EULA b/custom-licenses/EULA
new file mode 100644
index 00000000..549f78e1
--- /dev/null
+++ b/custom-licenses/EULA
@@ -0,0 +1,392 @@
+Intel End User License Agreement for Developer Tools (Version October 2021)
+
+IMPORTANT NOTICE - PLEASE READ AND AGREE BEFORE DOWNLOADING, INSTALLING, COPYING
+OR USING
+
+This Agreement is between you, or the company or other legal entity that you
+represent and warrant you have the legal authority to bind, (each, "You" or
+"Your") and Intel Corporation and its subsidiaries (collectively, "Intel")
+regarding Your use of the Materials. By downloading, installing, copying or
+using the Materials, You agree to be bound by the terms of this Agreement. If
+You do not agree to the terms of this Agreement, or do not have legal authority
+or required age to agree to them, do not download, install, copy or use the
+Materials.
+
+1. LICENSE DEFINITIONS.
+
+ A. "Cloud Provider" means a third party service provider offering a cloud-based
+ platform, infrastructure, application or storage services, such as Microsoft
+ Azure or Amazon Web Services, which You may only utilize to host the
+ Materials subject to the restrictions set forth in Section 2.3 B.
+
+ B. "Derivative Work" means a derivative work, as defined in 17 U.S.C. 101, of
+ the Source Code.
+
+ C. "Executable Code" means computer programming code in binary form suitable
+ for machine execution by a processor without the intervening steps of
+ interpretation or compilation.
+
+ D. "Materials" mean the software, documentation, the software product serial
+ number, and other collateral, including any updates, made available to You
+ by Intel under this Agreement. Materials include Redistributables,
+ Executable Code, Source Code, Sample Source Code, and Pre-Release Materials,
+ but do not include Third Party Software.
+
+ E. "Pre-Release Materials" mean the Materials, or portions of the Materials,
+ that are identified (in the product release notes, on Intel's download
+ website for the Materials or elsewhere) or labeled as pre-release,
+ prototype, alpha or beta code and, as such, are deemed to be pre-release
+ code (i) which may not be fully functional or tested and may contain bugs or
+ errors; (ii) which Intel may substantially modify in its development of a
+ production version; or (iii) for which Intel makes no assurances that it
+ will ever develop or make a production version generally available.
+ Pre-Release Materials are subject to the terms of Section 3.2.
+
+ F. "Reciprocal Open Source Software" means any software that is subject to a
+ license which requires that (i) it must be distributed in source code form;
+ (ii) it must be licensed under the same open source license terms; and (iii)
+ its derivative works must be licensed under the same open source license
+ terms. Examples of this type of license are the GNU General Public License
+ or the Mozilla Public License.
+
+ G. "Redistributables" mean the files (if any) listed in the "redist.txt,"
+ "redist-rt.txt" or similarly-named text files that may be included in the
+ Materials. Redistributables include Sample Source Code.
+
+ H. "Sample Source Code" means those portions of the Materials that are Source
+ Code and are identified as sample code. Sample Source Code may not have been
+ tested or validated by Intel and is provided purely as a programming example.
+
+ I. "Source Code" means the software portion of the Materials provided in human
+ readable format.
+
+ J. "Third Party Software" mean the files (if any) listed in the
+ "third-party-software.txt" or other similarly-named text file that may be
+ included in the Materials for the applicable software. Third Party Software
+ is subject to the terms of Section 2.2.
+
+ K. "Your Product" means one or more applications, products or projects
+ developed by or for You using the Materials.
+
+2. LICENSE GRANTS.
+
+2.1 License to the Materials. Subject to the terms and conditions of this
+ Agreement, Intel grants You a non-exclusive, worldwide, non-assignable,
+ non-sublicensable, limited right and license under its copyrights, to:
+
+ A. reproduce internally a reasonable number of copies of the Materials for Your
+ personal or business use;
+
+ B. use the Materials solely for Your personal or business use to develop Your
+ Product, in accordance with the documentation included as part of the
+ Materials;
+
+ C. modify or create Derivative Works only of the Redistributables, or any
+ portions, that are provided to You in Source Code;
+
+ D. distribute (directly and through Your distributors, resellers, and other
+ channel partners, if applicable), the Redistributables, including any
+ modifications to or Derivative Works of the Redistributables or any portions
+ made pursuant to Section 2.1.C subject to the following conditions:
+
+ (1) Any distribution of the Redistributables must only be as part of Your
+ Product which must add significant primary functionality different than
+ that of the Redistributables themselves;
+
+ (2) You must only distribute the Redistributables originally provided to You
+ by Intel only in Executable Code subject to a license agreement that
+ prohibits reverse engineering, decompiling or disassembling the
+ Redistributables;
+
+ (3) This distribution right includes a limited right to sublicense only the
+ Intel copyrights in the Redistributables and only to the extent necessary
+ to perform, display, and distribute the Redistributables (including Your
+ modifications and Derivative Works of the Redistributables provided in
+ Source Code) solely as incorporated in Your Product; and
+
+ (4) You: (i) will be solely responsible to Your customers for any update,
+ support obligation or other obligation or liability which may arise from
+ the distribution of Your Product, (ii) will not make any statement that
+ Your Product is "certified" or that its performance is guaranteed by Intel
+ or its suppliers, (iii) will not use Intel's or its suppliers' names or
+ trademarks to market Your Product, (iv) will comply with any additional
+ restrictions which are included in the text files with the
+ Redistributables and in Section 3 below, (v) will indemnify, hold
+ harmless, and defend Intel and its suppliers from and against any claims
+ or lawsuits, costs, damages, and expenses, including attorney's fees, that
+ arise or result from (a) Your modifications or Derivative Works of the
+ Materials or (b) Your distribution of Your Product.
+
+2.2 Third Party Software. Third Party Software, even if included with the
+ distribution of the Materials, may be governed by separate license terms,
+ including without limitation, third party license terms, open source
+ software notices and terms, and/or other Intel software license terms. These
+ separate license terms solely govern Your use of the Third Party Software.
+
+2.3 Third Party Use.
+
+ A. If You are an entity, Your contractors may use the Materials under the
+ license specified in Section 2, provided: (i) their use of the Materials is
+ solely on behalf of and in support of Your business, (ii) they agree to the
+ terms and conditions of this Agreement, and (iii) You are solely responsible
+ for their use, misuse or disclosure of the Materials.
+
+ B. You may utilize a Cloud Provider to host the Materials for You, provided:
+ (i) the Cloud Provider may only host the Materials for Your exclusive use
+ and may not use the Materials for any other purpose whatsoever, including the
+ restriction set forth in Section 3.1(xi); (ii) the Cloud Provider's use of
+ the Materials must be solely on behalf of and in support of Your Product, and
+ (iii) You will indemnify, hold harmless, and defend Intel and its suppliers
+ from and against any claims or lawsuits, costs, damages, and expenses,
+ including attorney's fees, that arise or result from Your Cloud Provider's
+ use, misuse or disclosure of the Materials.
+
+3. LICENSE CONDITIONS.
+
+3.1 Restrictions. Except as expressly provided in this Agreement, You may NOT:
+ (i) use, reproduce, disclose, distribute, or publicly display the
+ Materials; (ii) share, publish, rent or lease the Materials to any third
+ party; (iii) assign this Agreement or transfer the Materials; (iv) modify,
+ adapt, or translate the Materials in whole or in part; (v) reverse engineer,
+ decompile, or disassemble the Materials, or otherwise attempt to derive the
+ source code for the software; (vi) work around any technical limitations in
+ the Materials; (vii) distribute, sublicense or transfer any Source Code,
+ modifications or Derivative Works of any Source Code to any third party;
+ (viii) remove, minimize, block or modify any notices of Intel or its
+ suppliers in the Materials; (ix) include the Redistributables in malicious,
+ deceptive, or unlawful programs or products or use the Materials in any way
+ that is against the law; (x) modify, create a Derivative Work, link, or
+ distribute the Materials so that any part of it becomes Reciprocal Open
+ Source Software; (xi) use the Materials directly or indirectly for SaaS
+ services or service bureau purposes (i.e., a service that allows use of or
+ access to the Materials by a third party as part of that service, such as
+ the salesforce.com service business model).
+
+3.2 Pre-Release Materials. If You receive Pre-Release Materials, You may
+ reproduce a reasonable number of copies and use the Pre-Release Materials
+ for evaluation and testing purposes only. You may not (i) modify or
+ incorporate the Pre-Release Materials into Your Product; (ii) continue to
+ use the Pre-Release Materials once a commercial version is released; or
+ (iii) disclose to any third party any benchmarks, performance results, or
+ other information relating to the Pre-Release Materials. Intel may waive
+ these restrictions in writing at its sole discretion; however, if You decide
+ to use the Pre-Release Materials in Your Product (even with Intel's waiver),
+ You acknowledge and agree that You are fully responsible for any and all
+ issues that result from such use.
+
+3.3 Safety-Critical, and Life-Saving Applications; Indemnity. The Materials may
+ provide information relevant to safety-critical applications
+ ("Safety-Critical Applications") to allow compliance with functional safety
+ standards or requirements. You acknowledge and agree that safety is Your
+ responsibility. To the extent You use the Materials to create, or as part
+ of, products used in Safety-Critical Applications, it is Your responsibility
+ to design, manage, and ensure that there are system-level safeguards to
+ anticipate, monitor, and control system failures, and You agree that You are
+ solely responsible for all applicable regulatory standards and
+ safety-related requirements concerning Your use of the Materials in Safety
+ Critical Applications.
+
+ Should You use the Materials for Safety-Critical Applications or in any type
+ of a system or application in which the failure of the Materials could
+ create a situation where personal injury or death may occur (e.g., medical
+ systems, life-sustaining or life-saving systems) ("Life-Saving
+ Applications"), You agree to indemnify, defend, and hold Intel and its
+ representatives harmless against any claims or lawsuits, costs, damages, and
+ expenses, including reasonable attorney fees, arising in any way out of Your
+ use of the Materials in Safety-Critical Applications or Life-Saving
+ Applications and claims of product liability, personal injury or death
+ associated with those applications; even if such claims allege that Intel
+ was negligent or strictly liable regarding the design or manufacture of the
+ Materials or its failure to warn regarding the Materials.
+
+3.4 Media Format Codecs and Digital Rights Management. You acknowledge and agree
+ that Your use of the Materials or distribution of the Redistributables with
+ Your Product as permitted by this Agreement may require You to procure
+ license(s) from third parties that may hold intellectual property rights
+ applicable to any media decoding, encoding or transcoding technology (e.g.,
+ the use of an audio or video codec) and/or digital rights management
+ capabilities of the Materials, if any. Should any such additional licenses
+ be required, You are solely responsible for obtaining any such licenses and
+ agree to obtain any such licenses at Your own expense.
+
+4. DATA COLLECTION AND PRIVACY.
+
+4.1 Data Collection. The Materials may generate and collect anonymous data
+ and/or provisioning data about the Materials and/or the development
+ environment and transmit the data to Intel as a one-time event during
+ installation. Optional data may also be collected by the Materials, however,
+ You will be provided notice of the request to collect optional data and no
+ optional data will be collected without Your consent. All data collection by
+ Intel is performed pursuant to relevant privacy laws, including notice and
+ consent requirements.
+
+4.2 Intel's Privacy Notice. Intel is committed to respecting Your privacy. To
+ learn more about Intel's privacy practices, please visit
+ http://www.intel.com/privacy.
+
+5. OWNERSHIP. Title to the Materials and all copies remain with Intel or its
+ suppliers. The Materials are protected by intellectual property rights,
+ including without limitation, United States copyright laws and international
+ treaty provisions. You will not remove any copyright or other proprietary
+ notices from the Materials. Except as expressly provided herein, no license
+ or right is granted to You directly or by implication, inducement, estoppel
+ or otherwise; specifically, Intel does not grant any express or implied right
+ to You under Intel patents, copyrights, trademarks, or trade secrets.
+
+6. NO WARRANTY AND NO SUPPORT.
+
+6.1 No Warranty. Disclaimer. Intel disclaims all warranties of any kind and the
+ terms and remedies provided in this Agreement are instead of any other
+ warranty or condition, express, implied or statutory, including those
+ regarding merchantability, fitness for any particular purpose,
+ non-infringement or any warranty arising out of any course of dealing, usage
+ of trade, proposal, specification or sample. Intel does not assume (and does
+ not authorize any person to assume on its behalf) any liability.
+
+6.2 No Support; Priority Support. Intel may make changes to the Materials, or to
+ items referenced therein, at any time without notice, but is not obligated
+ to support, update or provide training for the Materials under the terms of
+ this Agreement. Intel offers free community and paid priority support
+ options. More information on these support options can be found at:
+ https://software.intel.com/content/www/us/en/develop/support/priority-support.html.
+
+7. LIMITATION OF LIABILITY.
+
+7.1 Intel will not be liable for any of the following losses or damages (whether
+ such losses or damages were foreseen, foreseeable, known or otherwise): (i)
+ loss of revenue; (ii) loss of actual or anticipated profits; (iii) loss of
+ the use of money; (iv) loss of anticipated savings; (v) loss of business;
+ (vi) loss of opportunity; (vii) loss of goodwill; (viii) loss of use of the
+ Materials; (ix) loss of reputation; (x) loss of, damage to, or corruption of
+ data; or (xi) any indirect, incidental, special or consequential loss of
+ damage however caused (including loss or damage of the type specified in
+ this Section 7).
+
+7.2 Intel's total cumulative liability to You, including for direct damages for
+ claims relating to this Agreement, and whether for breach of contract,
+ negligence, or for any other reason, will not exceed $100.
+
+7.3 You acknowledge that the limitations of liability provided in this Section 7
+ are an essential part of this Agreement. You agree that the limitations of
+ liability provided in this Agreement with respect to Intel will be conveyed
+ to and made binding upon any customer of Yours that acquires the
+ Redistributables.
+
+8. USER SUBMISSIONS. Should you provide Intel with comments, modifications,
+ corrections, enhancements or other input ("Feedback") related to the
+ Materials, Intel will be free to use, disclose, reproduce, license or
+ otherwise distribute or exploit the Feedback in its sole discretion without
+ any obligations or restrictions of any kind, including without limitation,
+ intellectual property rights or licensing obligations. If You wish to provide
+ Intel with information that You intend to be treated as confidential
+ information, Intel requires that such confidential information be provided
+ pursuant to a non-disclosure agreement ("NDA"); please contact Your Intel
+ representative to ensure the proper NDA is in place.
+
+9. NON-DISCLOSURE. Information provided by Intel to You may include information
+ marked as confidential. You must treat such information as confidential under
+ the terms of the applicable NDA between Intel and You. If You have not
+ entered into an NDA with Intel, You must not disclose, distribute or make use
+ of any information marked as confidential, except as expressly authorized in
+ writing by Intel. Intel retains all rights in and to its confidential
+ information specifications, designs, engineering details, discoveries,
+ inventions, patents, copyrights, trademarks, trade secrets, and other
+ proprietary rights relating to the Materials. Any breach by You of the
+ confidentiality obligations provided for in this Section 9 will cause
+ irreparable injury to Intel for which money damages may be inadequate to
+ compensate Intel for losses arising from such a breach. Intel may obtain
+ equitable relief, including injunctive relief, if You breach or threaten to
+ breach Your confidentiality obligations.
+
+10. TERM AND TERMINATION. This Agreement becomes effective on the date You
+ accept this Agreement and will continue until terminated as provided for in
+ this Agreement. The term for any Pre-Release Materials terminates upon
+ release of a commercial version. This Agreement will terminate if You are in
+ breach of any of its terms and conditions. Upon termination, You will
+ promptly destroy the Materials and all copies. In the event of termination of
+ this Agreement, Your license to any Redistributables distributed by You in
+ accordance with the terms and conditions of this Agreement, prior to the
+ effective date of such termination, will survive any such termination of this
+ Agreement. Sections 1, 2.1.D(4)(v), 2.2, 2.3.A(iii), 2.3.B(iii), 3.3, 5, 6,
+ 7, 8, 9, 10 (with respect to these survival provisions in the last sentence),
+ and 12 will survive expiration or termination of this Agreement.
+
+11. U.S. GOVERNMENT RESTRICTED RIGHTS. The technical data and computer software
+ covered by this license is a "Commercial Item," as such term is defined by
+ the FAR 2.101 (48 C.F.R. 2.101) and is "commercial computer software" and
+ "commercial computer software documentation" as specified under FAR 12.212
+ (48 C.F.R. 12.212) or DFARS 227.7202 (48 C.F.R. 227.7202), as applicable.
+ This commercial computer software and related documentation is provided to
+ end users for use by and on behalf of the U.S. Government with only those
+ rights as are granted to all other end users pursuant to the terms and
+ conditions of this Agreement.
+
+12. GENERAL PROVISIONS.
+
+12.1 ENTIRE AGREEMENT. This Agreement contains the complete and exclusive
+ agreement and understanding between the parties concerning the subject
+ matter of this Agreement, and supersedes all prior and contemporaneous
+ proposals, agreements, understanding, negotiations, representations,
+ warranties, conditions, and communications, oral or written, between the
+ parties relating to the same subject matter. Each party acknowledges and
+ agrees that in entering into this Agreement it has not relied on, and will
+ not be entitled to rely on, any oral or written representations,
+ warranties, conditions, understanding, or communications between the
+ parties that are not expressly set forth in this Agreement. The express
+ provisions of this Agreement control over any course of performance, course
+ of dealing, or usage of the trade inconsistent with any of the provisions
+ of this Agreement. The provisions of this Agreement will prevail
+ notwithstanding any different, conflicting, or additional provisions that
+ may appear on any purchase order, acknowledgement, invoice, or other
+ writing issued by either party in connection with this Agreement. No
+ modification or amendment to this Agreement will be effective unless in
+ writing and signed by authorized representatives of each party, and must
+ specifically identify this Agreement by its title and version (e.g., "Intel
+ End User License Agreement for Developer Tools (Version October 2021)");
+ except that Intel may make changes to this Agreement as it distributes new
+ versions of the Materials. When changes are made, Intel will make a new
+ version of the Agreement available on its website. If You received a copy
+ of this Agreement translated into another language, the English language
+ version of this Agreement will prevail in the event of any conflict between
+ versions.
+
+12.2 EXPORT. You acknowledge that the Materials and all related technical
+ information are subject to export controls and you agree to comply with all
+ laws and regulations of the United States and other applicable governments
+ governing export, re-export, import, transfer, distribution, and use of the
+ Materials. In particular, but without limitation, the Materials may not be
+ exported or re-exported (i) into any U.S. embargoed countries or (ii) to
+ any person or entity listed on a denial order published by the U.S.
+ government or any other applicable governments. By using the Materials, You
+ represent and warrant that You are not located in any such country or on
+ any such list. You also agree that You will not use the Materials for, or
+ sell or transfer them to a third party who is known or suspected to be
+ involved in, any purposes prohibited by the U.S. government or other
+ applicable governments, including, without limitation, the development,
+ design, manufacture, or production of nuclear, missile, chemical or
+ biological weapons.
+
+12.3 GOVERNING LAW, JURISDICTION, AND VENUE. All disputes arising out of or
+ related to this Agreement, whether based on contract, tort, or any other
+ legal or equitable theory, will in all respects be governed by, and
+ construed and interpreted under, the laws of the United States of America
+ and the State of Delaware, without reference to conflict of laws
+ principles. The parties agree that the United Nations Convention on
+ Contracts for the International Sale of Goods (1980) is specifically
+ excluded from and will not apply to this Agreement. All disputes arising
+ out of or related to this Agreement, whether based on contract, tort, or
+ any other legal or equitable theory, will be subject to the exclusive
+ jurisdiction of the courts of the State of Delaware or of the Federal
+ courts sitting in that State. Each party submits to the personal
+ jurisdiction of those courts and waives all objections to that jurisdiction
+ and venue for those disputes.
+
+12.4 SEVERABILITY. The parties intend that if a court holds that any provision
+ or part of this Agreement is invalid or unenforceable under applicable law,
+ the court will modify the provision to the minimum extent necessary to make
+ it valid and enforceable, or if it cannot be made valid and enforceable,
+ the parties intend that the court will sever and delete the provision or
+ part from this Agreement. Any change to or deletion of a provision or part
+ of this Agreement under this Section will not affect the validity or
+ enforceability of the remainder of this Agreement, which will continue in
+ full force and effect.
diff --git a/custom-licenses/ISSL b/custom-licenses/ISSL
index 5435ee04..f987e502 100644
--- a/custom-licenses/ISSL
+++ b/custom-licenses/ISSL
@@ -1,63 +1,73 @@
-Intel Simplified Software License (Version April 2018)
+Intel Simplified Software License (Version August 2021)
-Copyright (c) 2018 Intel Corporation.
+Use and Redistribution. You may use and redistribute the software (the
+"Software"), without modification, provided the following conditions are met:
-Use and Redistribution. You may use and redistribute the software (the "Software"), without modification,
-provided the following conditions are met:
+* Redistributions must reproduce the above copyright notice and the following
+ terms of use in the Software and in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel nor the names of its suppliers may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+* No reverse engineering, decompilation, or disassembly of this Software is
+ permitted.
-* Redistributions must reproduce the above copyright notice and the following terms of use in the Software
-and in the documentation and/or other materials provided with the distribution.
+No other licenses. Except as provided in the preceding section, Intel grants no
+licenses or other rights by implication, estoppel or otherwise to, patent,
+copyright, trademark, trade name, service mark or other intellectual property
+licenses or rights of Intel.
-* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived
-from this Software without specific prior written permission.
+Third party software. The Software may contain Third Party Software. "Third
+Party Software" is open source software, third party software, or other Intel
+software that may be identified in the Software itself or in the files (if any)
+listed in the "third-party-software.txt" or similarly named text file included
+with the Software. Third Party Software, even if included with the distribution
+of the Software, may be governed by separate license terms, including without
+limitation, open source software license terms, third party software license
+terms, and other Intel software license terms. Those separate license terms
+solely govern your use of the Third Party Software, and nothing in this license
+limits any rights under, or grants rights that supersede, the terms of the
+applicable license terms.
-* No reverse engineering, decompilation, or disassembly of this Software is permitted.
+DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS
+WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE
+THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND
+ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT
+INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE.
-Limited patent license. Intel grants you a world-wide, royalty-free, non-exclusive license under patents
-it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
-this Software, but solely to the extent that any such patent is necessary to Utilize the Software alone.
-The patent license shall not apply to any combinations which include this software. No hardware per se
-is licensed hereunder.
+LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL 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.
-Third party and other Intel programs. "Third Party Programs" are the files listed in the
-"third-party-programs.txt" text file that is included with the Software and may include Intel programs
-under separate license terms. Third Party Programs, even if included with the distribution of the Materials,
-are governed by separate license terms and those license terms solely govern your use of those programs.
+No support. Intel may make changes to the Software, at any time without notice,
+and is not obligated to support, update or provide training for the Software.
-DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS
-WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE
-FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS’ FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM
-ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE MATERIALS.
+Termination. Your right to use the Software is terminated in the event of your
+breach of this license.
-LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL 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. YOU AGREE TO
-INDEMNIFY AND HOLD INTEL HARMLESS AGAINST ANY CLAIMS AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED
-USE OF THE SOFTWARE.
+Feedback. Should you provide Intel with comments, modifications, corrections,
+enhancements or other input ("Feedback") related to the Software, Intel will be
+free to use, disclose, reproduce, license or otherwise distribute or exploit the
+Feedback in its sole discretion without any obligations or restrictions of any
+kind, including without limitation, intellectual property rights or licensing
+obligations.
-No support. Intel may make changes to the Software, at any time without notice, and is not obligated to
-support, update or provide training for the Software.
+Compliance with laws. You agree to comply with all relevant laws and regulations
+governing your use, transfer, import or export (or prohibition thereof) of the
+Software.
-Termination. Intel may terminate your right to use the Software in the event of your breach of this Agreement
-and you fail to cure the breach within a reasonable period of time.
-
-Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input
-("Feedback") related to the Software Intel will be free to use, disclose, reproduce, license or otherwise
-distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any
-kind, including without limitation, intellectual property rights or licensing obligations.
-
-Compliance with laws. You agree to comply with all relevant laws and regulations governing your use,
-transfer, import or export (or prohibition thereof) of the Software.
-
-Governing law. All disputes will be governed by the laws of the United States of America and the State
-of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of
-the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to
-the personal jurisdiction and venue of those courts and waives any objections. The United Nations
-Convention on Contracts for the International Sale of Goods (1980) is specifically excluded and will
-not apply to the Software.
-
-*Other names and brands may be claimed as the property of others. \ No newline at end of file
+Governing law. All disputes will be governed by the laws of the United States of
+America and the State of Delaware without reference to conflict of law
+principles and subject to the exclusive jurisdiction of the state or federal
+courts sitting in the State of Delaware, and each party agrees that it submits
+to the personal jurisdiction and venue of those courts and waives any
+objections. The United Nations Convention on Contracts for the International
+Sale of Goods (1980) is specifically excluded and will not apply to the
+Software.
diff --git a/custom-licenses/syrah b/custom-licenses/syrah
new file mode 100644
index 00000000..5cd7f4e6
--- /dev/null
+++ b/custom-licenses/syrah
@@ -0,0 +1,32 @@
+Copyright (c) 2009, Stanford University, and authors listed below.
+All rights reserved.
+
+Original authors:
+ Solomon Boulos
+
+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.
+
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+Neither the name of Stanford University nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+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
+HOLDER 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. \ No newline at end of file
diff --git a/documentation/dpcpp-compiler.md b/documentation/dpcpp-compiler.md
new file mode 100644
index 00000000..b709a685
--- /dev/null
+++ b/documentation/dpcpp-compiler.md
@@ -0,0 +1,107 @@
+Intel(R) oneAPI DPC++/C++ Compiler (ICX) toolchain
+==========================================================================
+
+Get Started with the Intel oneAPI DPC++/C++ Compiler:
+
+https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html#
+
+
+Getting Started
+===============
+
+Clone the required layers and include them in bblayers.conf:
+
+```
+git clone https://git.openembedded.org/openembedded-core
+git clone https://git.openembedded.org/bitbake
+git clone https://git.openembedded.org/meta-openembedded
+git clone https://github.com/kraj/meta-clang.git
+git clone https://git.yoctoproject.org/meta-intel
+
+$ source openembedded-core/oe-init-build-env
+
+$ bitbake-layers add-layer ../meta-openembedded/meta-oe/
+$ bitbake-layers add-layer ../meta-intel
+$ bitbake-layers add-layer ../meta-clang
+```
+
+Distro
+======
+
+Note that oneAPI DPC++/C++ compiler currently only works when the vendor string is "oe".
+
+```
+DISTRO ?= "nodistro"
+```
+
+MACHINE configuration
+=====================
+
+```
+MACHINE ?= "intel-skylake-64"
+```
+
+Package installation
+====================
+
+```
+# To include OpenCL driver that might be needed when compiling SYCL programs, include:
+IMAGE_INSTALL:append = " intel-compute-runtime intel-graphics-compiler"
+
+# To install only runtime libraries, include:
+IMAGE_INSTALL:append = " intel-oneapi-dpcpp-cpp-runtime intel-oneapi-dpcpp-cpp-runtime-dev"
+
+# To install the toolchain, include:
+IMAGE_INSTALL:append = " intel-oneapi-dpcpp-cpp intel-oneapi-dpcpp-cpp-dev"
+```
+in local.conf.
+
+Build an image
+==============
+
+```
+$ bitbake core-image-minimal
+```
+
+Including oneAPI C++/DPC++ compiler in generated SDK toolchain
+==============================================================
+
+The compiler is not included in the generated SDK by default. If it is expected to be part of SDK, add ICXSDK = "1" in local.conf:
+
+```
+ICXSDK = "1"
+```
+
+Generate SDK:
+```
+bitbake core-image-minimal -c populate_sdk
+```
+
+
+To setup PATH variables on target
+=================================
+
+Once image is booted successfully, some variables would need to be exported to make sure compiler can be used:
+
+```
+$ source /opt/intel/oneapi/compiler/2022.1.0/env/vars.sh
+
+$ mkdir -p /lib64
+
+$ ln -sf /lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
+```
+
+Build application and run
+=========================
+
+To compile a sycl application, for example:
+
+```
+$ icpx --target=x86_64-oe-linux -fsycl simple-sycl-app.c -o simple-sycl-app
+```
+
+To run:
+
+```
+$ ./simple-sycl-app
+```
diff --git a/dynamic-layers/clang-layer/recipes-core/dnn/onednn_2.1.1.bb b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.bb
index 5b96ea0e..afea70df 100644
--- a/dynamic-layers/clang-layer/recipes-core/dnn/onednn_2.1.1.bb
+++ b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.bb
@@ -3,19 +3,20 @@ SUMMARY = "Deep Neural Network Library"
DESCRIPTION = "This software is a user mode library that accelerates\
deep-learning applications and frameworks on Intel architecture."
LICENSE = "Apache-2.0 & BSD-3-Clause & BSL-1.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8e17c0f9656ebaf0c380d9b22707c846 \
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \
file://tests/gtests/gtest/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a \
file://src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \
- file://src/cpu/x64/jit_utils/jitprofiling/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \
- file://doc/assets/mathjax/MathJax.js;endline=17;md5=25a014ad78c3d72a0e15d15f1d007c20 \
+ file://src/common/ittnotify/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \
"
SECTION = "lib"
inherit pkgconfig cmake ptest
+DNN_BRANCH = "rls-v${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+
S = "${WORKDIR}/git"
-SRCREV = "53f53c2bb859d386a40e03f7623a4f9af758c1b3"
-SRC_URI = "git://github.com/oneapi-src/oneDNN.git;branch=rls-v2.1 \
+SRCREV = "ecd7fb6d5a0df6503d1691c1754a684b9c769c16"
+SRC_URI = "git://github.com/oneapi-src/oneDNN.git;branch=${DNN_BRANCH};protocol=https \
file://run-ptest \
"
@@ -24,7 +25,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$"
CVE_PRODUCT = "intel:math_kernel_library"
COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = 'null'
+COMPATIBLE_HOST:libc-musl = 'null'
EXTRA_OECMAKE += " \
-DDNNL_LIBRARY_TYPE=SHARED \
@@ -33,12 +34,13 @@ EXTRA_OECMAKE += " \
-DDNNL_CPU_RUNTIME=OMP \
-DDNNL_ARCH_OPT_FLAGS="" \
-DCMAKE_SKIP_RPATH=ON \
+ -DONEDNN_BUILD_GRAPH=OFF \
"
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[gpu] = "-DDNNL_GPU_RUNTIME=OCL, , opencl-headers ocl-icd, intel-compute-runtime"
+PACKAGECONFIG ??= "gpu"
+PACKAGECONFIG[gpu] = "-DDNNL_GPU_RUNTIME=OCL, , opencl-headers virtual/opencl-icd, intel-compute-runtime"
-do_install_append () {
+do_install:append () {
install -d ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs
install -m 0755 ${B}/tests/benchdnn/benchdnn ${D}${bindir}/mkl-dnn/tests/benchdnn
cp -r ${B}/tests/benchdnn/inputs/* ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs
@@ -52,4 +54,4 @@ do_install_ptest () {
PACKAGES =+ "${PN}-test"
-FILES_${PN}-test = "${bindir}/mkl-dnn/*"
+FILES:${PN}-test = "${bindir}/mkl-dnn/*"
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Fix-debug-info-of-work-item-builtin-translation-745.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Fix-debug-info-of-work-item-builtin-translation-745.patch
deleted file mode 100644
index 923b871f..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Fix-debug-info-of-work-item-builtin-translation-745.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-From 200c200eb19602ffd7c8f29d0b2df9df1fd311bf Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 7 Apr 2021 17:44:20 +0800
-Subject: [PATCH] Fix debug info of work-item builtin translation (#745)
-
-debug info of work-item builtins are lost in both llvm IR -> spirv and
-spirv -> llvm IR translations. See #744
-
-Upstream-Status: Backport [https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/c734c5c8bbd3012a09c610e4be68e90cc603c580]
-Signed-off-by: Wenju He <wenju.he@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- lib/SPIRV/OCL20ToSPIRV.cpp | 5 ++-
- lib/SPIRV/SPIRVReader.cpp | 1 +
- test/DebugInfo/builtin-get-global-id.ll | 60 +++++++++++++++++++++++++
- 3 files changed, 65 insertions(+), 1 deletion(-)
- create mode 100644 test/DebugInfo/builtin-get-global-id.ll
-
-diff --git a/lib/SPIRV/OCL20ToSPIRV.cpp b/lib/SPIRV/OCL20ToSPIRV.cpp
-index 1262c48c..a742c8cf 100644
---- a/lib/SPIRV/OCL20ToSPIRV.cpp
-+++ b/lib/SPIRV/OCL20ToSPIRV.cpp
-@@ -1297,11 +1297,14 @@ void OCL20ToSPIRV::transWorkItemBuiltinsToVariables() {
- for (auto UI = I.user_begin(), UE = I.user_end(); UI != UE; ++UI) {
- auto CI = dyn_cast<CallInst>(*UI);
- assert(CI && "invalid instruction");
-- Value *NewValue = new LoadInst(BV, "", CI);
-+ const DebugLoc &DLoc = CI->getDebugLoc();
-+ Instruction *NewValue = new LoadInst(BV, "", CI);
-+ NewValue->setDebugLoc(DLoc);
- LLVM_DEBUG(dbgs() << "Transform: " << *CI << " => " << *NewValue << '\n');
- if (IsVec) {
- NewValue =
- ExtractElementInst::Create(NewValue, CI->getArgOperand(0), "", CI);
-+ NewValue->setDebugLoc(DLoc);
- LLVM_DEBUG(dbgs() << *NewValue << '\n');
- }
- NewValue->takeName(CI);
-diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp
-index 16a3dd38..528f6663 100644
---- a/lib/SPIRV/SPIRVReader.cpp
-+++ b/lib/SPIRV/SPIRVReader.cpp
-@@ -307,6 +307,7 @@ bool SPIRVToLLVM::transOCLBuiltinFromVariable(GlobalVariable *GV,
- auto Replace = [&](std::vector<Value *> Arg, Instruction *I) {
- auto Call = CallInst::Create(Func, Arg, "", I);
- Call->takeName(I);
-+ Call->setDebugLoc(I->getDebugLoc());
- setAttrByCalledFunc(Call);
- SPIRVDBG(dbgs() << "[transOCLBuiltinFromVariable] " << *I << " -> " << *Call
- << '\n';)
-diff --git a/test/DebugInfo/builtin-get-global-id.ll b/test/DebugInfo/builtin-get-global-id.ll
-new file mode 100644
-index 00000000..a4a00e63
---- /dev/null
-+++ b/test/DebugInfo/builtin-get-global-id.ll
-@@ -0,0 +1,60 @@
-+; Check debug info of builtin get_global_id is preserved from LLVM IR to spirv
-+; and spirv to LLVM IR translation.
-+
-+; Original .cl source:
-+; kernel void test() {
-+; size_t gid = get_global_id(0);
-+; }
-+
-+; Command line:
-+; ./clang -cc1 1.cl -triple spir64 -cl-std=cl2.0 -emit-llvm -finclude-default-header -debug-info-kind=line-tables-only -O0
-+
-+; RUN: llvm-as %s -o %t.bc
-+; RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s --check-prefix CHECK-SPIRV
-+; RUN: llvm-spirv %t.bc -o %t.spv
-+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o - | FileCheck %s
-+
-+target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
-+target triple = "spir64"
-+
-+; CHECK-SPIRV: ExtInst {{.*}} DebugScope
-+; CHECK-SPIRV-NEXT: Line {{[0-9]+}} 2 16
-+; CHECK-SPIRV-NEXT: Load {{[0-9]+}} [[LoadRes:[0-9]+]]
-+; CHECK-SPIRV-NEXT: CompositeExtract {{[0-9]+}} {{[0-9]+}} [[LoadRes]] 0
-+
-+; Function Attrs: convergent noinline norecurse nounwind optnone
-+define spir_kernel void @test() #0 !dbg !7 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 {
-+entry:
-+ %gid = alloca i64, align 8
-+ %call = call spir_func i64 @_Z13get_global_idj(i32 0) #2, !dbg !10
-+; CHECK: %call = call spir_func i64 @_Z13get_global_idj(i32 0) #1, !dbg [[DBG:![0-9]+]]
-+ store i64 %call, i64* %gid, align 8, !dbg !11
-+ ret void, !dbg !12
-+}
-+
-+; Function Attrs: convergent nounwind readnone
-+declare spir_func i64 @_Z13get_global_idj(i32) #1
-+
-+attributes #0 = { convergent noinline norecurse nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
-+attributes #1 = { convergent nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
-+attributes #2 = { convergent nounwind readnone }
-+
-+!llvm.dbg.cu = !{!0}
-+!llvm.module.flags = !{!3, !4}
-+!opencl.ocl.version = !{!5}
-+!opencl.spir.version = !{!5}
-+!llvm.ident = !{!6}
-+
-+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0 (https://github.com/llvm/llvm-project.git b5bc56da8aa23dc57db9d286b0591dbcf9b1bdd3)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, nameTableKind: None)
-+!1 = !DIFile(filename: "<stdin>", directory: "")
-+!2 = !{}
-+!3 = !{i32 2, !"Debug Info Version", i32 3}
-+!4 = !{i32 1, !"wchar_size", i32 4}
-+!5 = !{i32 2, i32 0}
-+!6 = !{!"clang version 12.0.0 (https://github.com/llvm/llvm-project.git b5bc56da8aa23dc57db9d286b0591dbcf9b1bdd3)"}
-+!7 = distinct !DISubprogram(name: "test", scope: !8, file: !8, line: 1, type: !9, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
-+!8 = !DIFile(filename: "1.cl", directory: "")
-+!9 = !DISubroutineType(types: !2)
-+!10 = !DILocation(line: 2, column: 16, scope: !7)
-+!11 = !DILocation(line: 2, column: 10, scope: !7)
-+!12 = !DILocation(line: 3, column: 1, scope: !7)
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch
deleted file mode 100644
index 103dad5e..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From c86c43b70e029b102543e8a85d269cbeb5c00279 Mon Sep 17 00:00:00 2001
-From: juanrod2 <>
-Date: Tue, 22 Dec 2020 08:33:08 +0800
-Subject: [PATCH] Memory leak fix for Managed Static Mutex
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
-
-Cleaning a mutex inside ManagedStatic llvm class.
----
- llvm/lib/Support/ManagedStatic.cpp | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
-index 053493f72fb5..6571580ccecf 100644
---- a/llvm/lib/Support/ManagedStatic.cpp
-+++ b/llvm/lib/Support/ManagedStatic.cpp
-@@ -76,8 +76,12 @@ void ManagedStaticBase::destroy() const {
-
- /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
- void llvm::llvm_shutdown() {
-- std::lock_guard<std::recursive_mutex> Lock(*getManagedStaticMutex());
-+ getManagedStaticMutex()->lock();
-
- while (StaticList)
- StaticList->destroy();
-+
-+ getManagedStaticMutex()->unlock();
-+ delete ManagedStaticMutex;
-+ ManagedStaticMutex = nullptr;
- }
---
-2.29.2
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-Add-cl_khr_extended_subgroup-extensions.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-Add-cl_khr_extended_subgroup-extensions.patch
deleted file mode 100644
index cbe492c4..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-Add-cl_khr_extended_subgroup-extensions.patch
+++ /dev/null
@@ -1,812 +0,0 @@
-From 27d47f1a17c8921b07acc8cdc26e38cc609de4a9 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 7 Apr 2021 16:38:38 +0800
-Subject: [PATCH 2/2] Add cl_khr_extended_subgroup extensions.
-
-Added extensions and their function declarations into
-the standard header.
-
-Patch by Piotr Fusik!
-
-Tags: #clang
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/4a4402f0d72167477a6252e4c3daf5089ebc8f9a]
-Signed-off-by: Anastasia Stulova <anastasia.stulova@arm.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- .../include/clang/Basic/OpenCLExtensions.def | 7 +
- clang/lib/Headers/opencl-c.h | 668 ++++++++++++++++++
- clang/test/SemaOpenCL/extension-version.cl | 83 +++
- 3 files changed, 758 insertions(+)
-
-diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
-index 608f78a13eef..d1574164f9b2 100644
---- a/clang/include/clang/Basic/OpenCLExtensions.def
-+++ b/clang/include/clang/Basic/OpenCLExtensions.def
-@@ -74,6 +74,13 @@ OPENCLEXT_INTERNAL(cl_khr_mipmap_image_writes, 200, ~0U)
- OPENCLEXT_INTERNAL(cl_khr_srgb_image_writes, 200, ~0U)
- OPENCLEXT_INTERNAL(cl_khr_subgroups, 200, ~0U)
- OPENCLEXT_INTERNAL(cl_khr_terminate_context, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_extended_types, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_non_uniform_vote, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_ballot, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_non_uniform_arithmetic, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_shuffle, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_shuffle_relative, 200, ~0U)
-+OPENCLEXT_INTERNAL(cl_khr_subgroup_clustered_reduce, 200, ~0U)
-
- // Clang Extensions.
- OPENCLEXT_INTERNAL(cl_clang_storage_class_specifiers, 100, ~0U)
-diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
-index 93a946cec5b1..67d900eb1c3d 100644
---- a/clang/lib/Headers/opencl-c.h
-+++ b/clang/lib/Headers/opencl-c.h
-@@ -17530,6 +17530,674 @@ double __ovld __conv sub_group_scan_inclusive_max(double x);
-
- #endif //cl_khr_subgroups cl_intel_subgroups
-
-+#if defined(cl_khr_subgroup_extended_types)
-+char __ovld __conv sub_group_broadcast( char value, uint index );
-+char2 __ovld __conv sub_group_broadcast( char2 value, uint index );
-+char3 __ovld __conv sub_group_broadcast( char3 value, uint index );
-+char4 __ovld __conv sub_group_broadcast( char4 value, uint index );
-+char8 __ovld __conv sub_group_broadcast( char8 value, uint index );
-+char16 __ovld __conv sub_group_broadcast( char16 value, uint index );
-+
-+uchar __ovld __conv sub_group_broadcast( uchar value, uint index );
-+uchar2 __ovld __conv sub_group_broadcast( uchar2 value, uint index );
-+uchar3 __ovld __conv sub_group_broadcast( uchar3 value, uint index );
-+uchar4 __ovld __conv sub_group_broadcast( uchar4 value, uint index );
-+uchar8 __ovld __conv sub_group_broadcast( uchar8 value, uint index );
-+uchar16 __ovld __conv sub_group_broadcast( uchar16 value, uint index );
-+
-+short __ovld __conv sub_group_broadcast( short value, uint index );
-+short2 __ovld __conv sub_group_broadcast( short2 value, uint index );
-+short3 __ovld __conv sub_group_broadcast( short3 value, uint index );
-+short4 __ovld __conv sub_group_broadcast( short4 value, uint index );
-+short8 __ovld __conv sub_group_broadcast( short8 value, uint index );
-+short16 __ovld __conv sub_group_broadcast( short16 value, uint index );
-+
-+ushort __ovld __conv sub_group_broadcast( ushort value, uint index );
-+ushort2 __ovld __conv sub_group_broadcast( ushort2 value, uint index );
-+ushort3 __ovld __conv sub_group_broadcast( ushort3 value, uint index );
-+ushort4 __ovld __conv sub_group_broadcast( ushort4 value, uint index );
-+ushort8 __ovld __conv sub_group_broadcast( ushort8 value, uint index );
-+ushort16 __ovld __conv sub_group_broadcast( ushort16 value, uint index );
-+
-+// scalar int broadcast is part of cl_khr_subgroups
-+int2 __ovld __conv sub_group_broadcast( int2 value, uint index );
-+int3 __ovld __conv sub_group_broadcast( int3 value, uint index );
-+int4 __ovld __conv sub_group_broadcast( int4 value, uint index );
-+int8 __ovld __conv sub_group_broadcast( int8 value, uint index );
-+int16 __ovld __conv sub_group_broadcast( int16 value, uint index );
-+
-+// scalar uint broadcast is part of cl_khr_subgroups
-+uint2 __ovld __conv sub_group_broadcast( uint2 value, uint index );
-+uint3 __ovld __conv sub_group_broadcast( uint3 value, uint index );
-+uint4 __ovld __conv sub_group_broadcast( uint4 value, uint index );
-+uint8 __ovld __conv sub_group_broadcast( uint8 value, uint index );
-+uint16 __ovld __conv sub_group_broadcast( uint16 value, uint index );
-+
-+// scalar long broadcast is part of cl_khr_subgroups
-+long2 __ovld __conv sub_group_broadcast( long2 value, uint index );
-+long3 __ovld __conv sub_group_broadcast( long3 value, uint index );
-+long4 __ovld __conv sub_group_broadcast( long4 value, uint index );
-+long8 __ovld __conv sub_group_broadcast( long8 value, uint index );
-+long16 __ovld __conv sub_group_broadcast( long16 value, uint index );
-+
-+// scalar ulong broadcast is part of cl_khr_subgroups
-+ulong2 __ovld __conv sub_group_broadcast( ulong2 value, uint index );
-+ulong3 __ovld __conv sub_group_broadcast( ulong3 value, uint index );
-+ulong4 __ovld __conv sub_group_broadcast( ulong4 value, uint index );
-+ulong8 __ovld __conv sub_group_broadcast( ulong8 value, uint index );
-+ulong16 __ovld __conv sub_group_broadcast( ulong16 value, uint index );
-+
-+// scalar float broadcast is part of cl_khr_subgroups
-+float2 __ovld __conv sub_group_broadcast( float2 value, uint index );
-+float3 __ovld __conv sub_group_broadcast( float3 value, uint index );
-+float4 __ovld __conv sub_group_broadcast( float4 value, uint index );
-+float8 __ovld __conv sub_group_broadcast( float8 value, uint index );
-+float16 __ovld __conv sub_group_broadcast( float16 value, uint index );
-+
-+char __ovld __conv sub_group_reduce_add( char value );
-+uchar __ovld __conv sub_group_reduce_add( uchar value );
-+short __ovld __conv sub_group_reduce_add( short value );
-+ushort __ovld __conv sub_group_reduce_add( ushort value );
-+
-+char __ovld __conv sub_group_reduce_min( char value );
-+uchar __ovld __conv sub_group_reduce_min( uchar value );
-+short __ovld __conv sub_group_reduce_min( short value );
-+ushort __ovld __conv sub_group_reduce_min( ushort value );
-+
-+char __ovld __conv sub_group_reduce_max( char value );
-+uchar __ovld __conv sub_group_reduce_max( uchar value );
-+short __ovld __conv sub_group_reduce_max( short value );
-+ushort __ovld __conv sub_group_reduce_max( ushort value );
-+
-+char __ovld __conv sub_group_scan_inclusive_add( char value );
-+uchar __ovld __conv sub_group_scan_inclusive_add( uchar value );
-+short __ovld __conv sub_group_scan_inclusive_add( short value );
-+ushort __ovld __conv sub_group_scan_inclusive_add( ushort value );
-+
-+char __ovld __conv sub_group_scan_inclusive_min( char value );
-+uchar __ovld __conv sub_group_scan_inclusive_min( uchar value );
-+short __ovld __conv sub_group_scan_inclusive_min( short value );
-+ushort __ovld __conv sub_group_scan_inclusive_min( ushort value );
-+
-+char __ovld __conv sub_group_scan_inclusive_max( char value );
-+uchar __ovld __conv sub_group_scan_inclusive_max( uchar value );
-+short __ovld __conv sub_group_scan_inclusive_max( short value );
-+ushort __ovld __conv sub_group_scan_inclusive_max( ushort value );
-+
-+char __ovld __conv sub_group_scan_exclusive_add( char value );
-+uchar __ovld __conv sub_group_scan_exclusive_add( uchar value );
-+short __ovld __conv sub_group_scan_exclusive_add( short value );
-+ushort __ovld __conv sub_group_scan_exclusive_add( ushort value );
-+
-+char __ovld __conv sub_group_scan_exclusive_min( char value );
-+uchar __ovld __conv sub_group_scan_exclusive_min( uchar value );
-+short __ovld __conv sub_group_scan_exclusive_min( short value );
-+ushort __ovld __conv sub_group_scan_exclusive_min( ushort value );
-+
-+char __ovld __conv sub_group_scan_exclusive_max( char value );
-+uchar __ovld __conv sub_group_scan_exclusive_max( uchar value );
-+short __ovld __conv sub_group_scan_exclusive_max( short value );
-+ushort __ovld __conv sub_group_scan_exclusive_max( ushort value );
-+
-+#if defined(cl_khr_fp16)
-+// scalar half broadcast is part of cl_khr_subgroups
-+half2 __ovld __conv sub_group_broadcast( half2 value, uint index );
-+half3 __ovld __conv sub_group_broadcast( half3 value, uint index );
-+half4 __ovld __conv sub_group_broadcast( half4 value, uint index );
-+half8 __ovld __conv sub_group_broadcast( half8 value, uint index );
-+half16 __ovld __conv sub_group_broadcast( half16 value, uint index );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+// scalar double broadcast is part of cl_khr_subgroups
-+double2 __ovld __conv sub_group_broadcast( double2 value, uint index );
-+double3 __ovld __conv sub_group_broadcast( double3 value, uint index );
-+double4 __ovld __conv sub_group_broadcast( double4 value, uint index );
-+double8 __ovld __conv sub_group_broadcast( double8 value, uint index );
-+double16 __ovld __conv sub_group_broadcast( double16 value, uint index );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_extended_types
-+
-+#if defined(cl_khr_subgroup_non_uniform_vote)
-+int __ovld sub_group_elect(void);
-+int __ovld sub_group_non_uniform_all( int predicate );
-+int __ovld sub_group_non_uniform_any( int predicate );
-+
-+int __ovld sub_group_non_uniform_all_equal( char value );
-+int __ovld sub_group_non_uniform_all_equal( uchar value );
-+int __ovld sub_group_non_uniform_all_equal( short value );
-+int __ovld sub_group_non_uniform_all_equal( ushort value );
-+int __ovld sub_group_non_uniform_all_equal( int value );
-+int __ovld sub_group_non_uniform_all_equal( uint value );
-+int __ovld sub_group_non_uniform_all_equal( long value );
-+int __ovld sub_group_non_uniform_all_equal( ulong value );
-+int __ovld sub_group_non_uniform_all_equal( float value );
-+
-+#if defined(cl_khr_fp16)
-+int __ovld sub_group_non_uniform_all_equal( half value );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+int __ovld sub_group_non_uniform_all_equal( double value );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_non_uniform_vote
-+
-+#if defined(cl_khr_subgroup_ballot)
-+char __ovld sub_group_non_uniform_broadcast( char value, uint index );
-+char2 __ovld sub_group_non_uniform_broadcast( char2 value, uint index );
-+char3 __ovld sub_group_non_uniform_broadcast( char3 value, uint index );
-+char4 __ovld sub_group_non_uniform_broadcast( char4 value, uint index );
-+char8 __ovld sub_group_non_uniform_broadcast( char8 value, uint index );
-+char16 __ovld sub_group_non_uniform_broadcast( char16 value, uint index );
-+
-+uchar __ovld sub_group_non_uniform_broadcast( uchar value, uint index );
-+uchar2 __ovld sub_group_non_uniform_broadcast( uchar2 value, uint index );
-+uchar3 __ovld sub_group_non_uniform_broadcast( uchar3 value, uint index );
-+uchar4 __ovld sub_group_non_uniform_broadcast( uchar4 value, uint index );
-+uchar8 __ovld sub_group_non_uniform_broadcast( uchar8 value, uint index );
-+uchar16 __ovld sub_group_non_uniform_broadcast( uchar16 value, uint index );
-+
-+short __ovld sub_group_non_uniform_broadcast( short value, uint index );
-+short2 __ovld sub_group_non_uniform_broadcast( short2 value, uint index );
-+short3 __ovld sub_group_non_uniform_broadcast( short3 value, uint index );
-+short4 __ovld sub_group_non_uniform_broadcast( short4 value, uint index );
-+short8 __ovld sub_group_non_uniform_broadcast( short8 value, uint index );
-+short16 __ovld sub_group_non_uniform_broadcast( short16 value, uint index );
-+
-+ushort __ovld sub_group_non_uniform_broadcast( ushort value, uint index );
-+ushort2 __ovld sub_group_non_uniform_broadcast( ushort2 value, uint index );
-+ushort3 __ovld sub_group_non_uniform_broadcast( ushort3 value, uint index );
-+ushort4 __ovld sub_group_non_uniform_broadcast( ushort4 value, uint index );
-+ushort8 __ovld sub_group_non_uniform_broadcast( ushort8 value, uint index );
-+ushort16 __ovld sub_group_non_uniform_broadcast( ushort16 value, uint index );
-+
-+int __ovld sub_group_non_uniform_broadcast( int value, uint index );
-+int2 __ovld sub_group_non_uniform_broadcast( int2 value, uint index );
-+int3 __ovld sub_group_non_uniform_broadcast( int3 value, uint index );
-+int4 __ovld sub_group_non_uniform_broadcast( int4 value, uint index );
-+int8 __ovld sub_group_non_uniform_broadcast( int8 value, uint index );
-+int16 __ovld sub_group_non_uniform_broadcast( int16 value, uint index );
-+
-+uint __ovld sub_group_non_uniform_broadcast( uint value, uint index );
-+uint2 __ovld sub_group_non_uniform_broadcast( uint2 value, uint index );
-+uint3 __ovld sub_group_non_uniform_broadcast( uint3 value, uint index );
-+uint4 __ovld sub_group_non_uniform_broadcast( uint4 value, uint index );
-+uint8 __ovld sub_group_non_uniform_broadcast( uint8 value, uint index );
-+uint16 __ovld sub_group_non_uniform_broadcast( uint16 value, uint index );
-+
-+long __ovld sub_group_non_uniform_broadcast( long value, uint index );
-+long2 __ovld sub_group_non_uniform_broadcast( long2 value, uint index );
-+long3 __ovld sub_group_non_uniform_broadcast( long3 value, uint index );
-+long4 __ovld sub_group_non_uniform_broadcast( long4 value, uint index );
-+long8 __ovld sub_group_non_uniform_broadcast( long8 value, uint index );
-+long16 __ovld sub_group_non_uniform_broadcast( long16 value, uint index );
-+
-+ulong __ovld sub_group_non_uniform_broadcast( ulong value, uint index );
-+ulong2 __ovld sub_group_non_uniform_broadcast( ulong2 value, uint index );
-+ulong3 __ovld sub_group_non_uniform_broadcast( ulong3 value, uint index );
-+ulong4 __ovld sub_group_non_uniform_broadcast( ulong4 value, uint index );
-+ulong8 __ovld sub_group_non_uniform_broadcast( ulong8 value, uint index );
-+ulong16 __ovld sub_group_non_uniform_broadcast( ulong16 value, uint index );
-+
-+float __ovld sub_group_non_uniform_broadcast( float value, uint index );
-+float2 __ovld sub_group_non_uniform_broadcast( float2 value, uint index );
-+float3 __ovld sub_group_non_uniform_broadcast( float3 value, uint index );
-+float4 __ovld sub_group_non_uniform_broadcast( float4 value, uint index );
-+float8 __ovld sub_group_non_uniform_broadcast( float8 value, uint index );
-+float16 __ovld sub_group_non_uniform_broadcast( float16 value, uint index );
-+
-+char __ovld sub_group_broadcast_first( char value );
-+uchar __ovld sub_group_broadcast_first( uchar value );
-+short __ovld sub_group_broadcast_first( short value );
-+ushort __ovld sub_group_broadcast_first( ushort value );
-+int __ovld sub_group_broadcast_first( int value );
-+uint __ovld sub_group_broadcast_first( uint value );
-+long __ovld sub_group_broadcast_first( long value );
-+ulong __ovld sub_group_broadcast_first( ulong value );
-+float __ovld sub_group_broadcast_first( float value );
-+
-+uint4 __ovld sub_group_ballot( int predicate );
-+int __ovld __cnfn sub_group_inverse_ballot( uint4 value );
-+int __ovld __cnfn sub_group_ballot_bit_extract( uint4 value, uint index );
-+uint __ovld __cnfn sub_group_ballot_bit_count( uint4 value );
-+
-+uint __ovld sub_group_ballot_inclusive_scan( uint4 value );
-+uint __ovld sub_group_ballot_exclusive_scan( uint4 value );
-+uint __ovld sub_group_ballot_find_lsb( uint4 value );
-+uint __ovld sub_group_ballot_find_msb( uint4 value );
-+
-+uint4 __ovld __cnfn get_sub_group_eq_mask(void);
-+uint4 __ovld __cnfn get_sub_group_ge_mask(void);
-+uint4 __ovld __cnfn get_sub_group_gt_mask(void);
-+uint4 __ovld __cnfn get_sub_group_le_mask(void);
-+uint4 __ovld __cnfn get_sub_group_lt_mask(void);
-+
-+#if defined(cl_khr_fp16)
-+half __ovld sub_group_non_uniform_broadcast( half value, uint index );
-+half2 __ovld sub_group_non_uniform_broadcast( half2 value, uint index );
-+half3 __ovld sub_group_non_uniform_broadcast( half3 value, uint index );
-+half4 __ovld sub_group_non_uniform_broadcast( half4 value, uint index );
-+half8 __ovld sub_group_non_uniform_broadcast( half8 value, uint index );
-+half16 __ovld sub_group_non_uniform_broadcast( half16 value, uint index );
-+
-+half __ovld sub_group_broadcast_first( half value );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+double __ovld sub_group_non_uniform_broadcast( double value, uint index );
-+double2 __ovld sub_group_non_uniform_broadcast( double2 value, uint index );
-+double3 __ovld sub_group_non_uniform_broadcast( double3 value, uint index );
-+double4 __ovld sub_group_non_uniform_broadcast( double4 value, uint index );
-+double8 __ovld sub_group_non_uniform_broadcast( double8 value, uint index );
-+double16 __ovld sub_group_non_uniform_broadcast( double16 value, uint index );
-+
-+double __ovld sub_group_broadcast_first( double value );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_ballot
-+
-+#if defined(cl_khr_subgroup_non_uniform_arithmetic)
-+char __ovld sub_group_non_uniform_reduce_add( char value );
-+uchar __ovld sub_group_non_uniform_reduce_add( uchar value );
-+short __ovld sub_group_non_uniform_reduce_add( short value );
-+ushort __ovld sub_group_non_uniform_reduce_add( ushort value );
-+int __ovld sub_group_non_uniform_reduce_add( int value );
-+uint __ovld sub_group_non_uniform_reduce_add( uint value );
-+long __ovld sub_group_non_uniform_reduce_add( long value );
-+ulong __ovld sub_group_non_uniform_reduce_add( ulong value );
-+float __ovld sub_group_non_uniform_reduce_add( float value );
-+
-+char __ovld sub_group_non_uniform_reduce_mul( char value );
-+uchar __ovld sub_group_non_uniform_reduce_mul( uchar value );
-+short __ovld sub_group_non_uniform_reduce_mul( short value );
-+ushort __ovld sub_group_non_uniform_reduce_mul( ushort value );
-+int __ovld sub_group_non_uniform_reduce_mul( int value );
-+uint __ovld sub_group_non_uniform_reduce_mul( uint value );
-+long __ovld sub_group_non_uniform_reduce_mul( long value );
-+ulong __ovld sub_group_non_uniform_reduce_mul( ulong value );
-+float __ovld sub_group_non_uniform_reduce_mul( float value );
-+
-+char __ovld sub_group_non_uniform_reduce_min( char value );
-+uchar __ovld sub_group_non_uniform_reduce_min( uchar value );
-+short __ovld sub_group_non_uniform_reduce_min( short value );
-+ushort __ovld sub_group_non_uniform_reduce_min( ushort value );
-+int __ovld sub_group_non_uniform_reduce_min( int value );
-+uint __ovld sub_group_non_uniform_reduce_min( uint value );
-+long __ovld sub_group_non_uniform_reduce_min( long value );
-+ulong __ovld sub_group_non_uniform_reduce_min( ulong value );
-+float __ovld sub_group_non_uniform_reduce_min( float value );
-+
-+char __ovld sub_group_non_uniform_reduce_max( char value );
-+uchar __ovld sub_group_non_uniform_reduce_max( uchar value );
-+short __ovld sub_group_non_uniform_reduce_max( short value );
-+ushort __ovld sub_group_non_uniform_reduce_max( ushort value );
-+int __ovld sub_group_non_uniform_reduce_max( int value );
-+uint __ovld sub_group_non_uniform_reduce_max( uint value );
-+long __ovld sub_group_non_uniform_reduce_max( long value );
-+ulong __ovld sub_group_non_uniform_reduce_max( ulong value );
-+float __ovld sub_group_non_uniform_reduce_max( float value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_add( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_add( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_add( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_add( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_add( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_add( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_add( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_add( ulong value );
-+float __ovld sub_group_non_uniform_scan_inclusive_add( float value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_mul( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_mul( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_mul( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_mul( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_mul( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_mul( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_mul( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_mul( ulong value );
-+float __ovld sub_group_non_uniform_scan_inclusive_mul( float value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_min( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_min( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_min( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_min( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_min( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_min( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_min( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_min( ulong value );
-+float __ovld sub_group_non_uniform_scan_inclusive_min( float value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_max( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_max( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_max( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_max( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_max( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_max( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_max( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_max( ulong value );
-+float __ovld sub_group_non_uniform_scan_inclusive_max( float value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_add( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_add( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_add( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_add( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_add( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_add( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_add( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_add( ulong value );
-+float __ovld sub_group_non_uniform_scan_exclusive_add( float value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_mul( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_mul( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_mul( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_mul( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_mul( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_mul( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_mul( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_mul( ulong value );
-+float __ovld sub_group_non_uniform_scan_exclusive_mul( float value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_min( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_min( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_min( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_min( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_min( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_min( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_min( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_min( ulong value );
-+float __ovld sub_group_non_uniform_scan_exclusive_min( float value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_max( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_max( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_max( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_max( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_max( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_max( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_max( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_max( ulong value );
-+float __ovld sub_group_non_uniform_scan_exclusive_max( float value );
-+
-+char __ovld sub_group_non_uniform_reduce_and( char value );
-+uchar __ovld sub_group_non_uniform_reduce_and( uchar value );
-+short __ovld sub_group_non_uniform_reduce_and( short value );
-+ushort __ovld sub_group_non_uniform_reduce_and( ushort value );
-+int __ovld sub_group_non_uniform_reduce_and( int value );
-+uint __ovld sub_group_non_uniform_reduce_and( uint value );
-+long __ovld sub_group_non_uniform_reduce_and( long value );
-+ulong __ovld sub_group_non_uniform_reduce_and( ulong value );
-+
-+char __ovld sub_group_non_uniform_reduce_or( char value );
-+uchar __ovld sub_group_non_uniform_reduce_or( uchar value );
-+short __ovld sub_group_non_uniform_reduce_or( short value );
-+ushort __ovld sub_group_non_uniform_reduce_or( ushort value );
-+int __ovld sub_group_non_uniform_reduce_or( int value );
-+uint __ovld sub_group_non_uniform_reduce_or( uint value );
-+long __ovld sub_group_non_uniform_reduce_or( long value );
-+ulong __ovld sub_group_non_uniform_reduce_or( ulong value );
-+
-+char __ovld sub_group_non_uniform_reduce_xor( char value );
-+uchar __ovld sub_group_non_uniform_reduce_xor( uchar value );
-+short __ovld sub_group_non_uniform_reduce_xor( short value );
-+ushort __ovld sub_group_non_uniform_reduce_xor( ushort value );
-+int __ovld sub_group_non_uniform_reduce_xor( int value );
-+uint __ovld sub_group_non_uniform_reduce_xor( uint value );
-+long __ovld sub_group_non_uniform_reduce_xor( long value );
-+ulong __ovld sub_group_non_uniform_reduce_xor( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_and( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_and( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_and( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_and( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_and( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_and( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_and( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_and( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_or( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_or( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_or( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_or( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_or( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_or( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_or( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_or( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_inclusive_xor( char value );
-+uchar __ovld sub_group_non_uniform_scan_inclusive_xor( uchar value );
-+short __ovld sub_group_non_uniform_scan_inclusive_xor( short value );
-+ushort __ovld sub_group_non_uniform_scan_inclusive_xor( ushort value );
-+int __ovld sub_group_non_uniform_scan_inclusive_xor( int value );
-+uint __ovld sub_group_non_uniform_scan_inclusive_xor( uint value );
-+long __ovld sub_group_non_uniform_scan_inclusive_xor( long value );
-+ulong __ovld sub_group_non_uniform_scan_inclusive_xor( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_and( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_and( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_and( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_and( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_and( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_and( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_and( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_and( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_or( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_or( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_or( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_or( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_or( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_or( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_or( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_or( ulong value );
-+
-+char __ovld sub_group_non_uniform_scan_exclusive_xor( char value );
-+uchar __ovld sub_group_non_uniform_scan_exclusive_xor( uchar value );
-+short __ovld sub_group_non_uniform_scan_exclusive_xor( short value );
-+ushort __ovld sub_group_non_uniform_scan_exclusive_xor( ushort value );
-+int __ovld sub_group_non_uniform_scan_exclusive_xor( int value );
-+uint __ovld sub_group_non_uniform_scan_exclusive_xor( uint value );
-+long __ovld sub_group_non_uniform_scan_exclusive_xor( long value );
-+ulong __ovld sub_group_non_uniform_scan_exclusive_xor( ulong value );
-+
-+int __ovld sub_group_non_uniform_reduce_logical_and( int predicate );
-+int __ovld sub_group_non_uniform_reduce_logical_or( int predicate );
-+int __ovld sub_group_non_uniform_reduce_logical_xor( int predicate );
-+
-+int __ovld sub_group_non_uniform_scan_inclusive_logical_and( int predicate );
-+int __ovld sub_group_non_uniform_scan_inclusive_logical_or( int predicate );
-+int __ovld sub_group_non_uniform_scan_inclusive_logical_xor( int predicate );
-+
-+int __ovld sub_group_non_uniform_scan_exclusive_logical_and( int predicate );
-+int __ovld sub_group_non_uniform_scan_exclusive_logical_or( int predicate );
-+int __ovld sub_group_non_uniform_scan_exclusive_logical_xor( int predicate );
-+
-+#if defined(cl_khr_fp16)
-+half __ovld sub_group_non_uniform_reduce_add( half value );
-+half __ovld sub_group_non_uniform_reduce_mul( half value );
-+half __ovld sub_group_non_uniform_reduce_min( half value );
-+half __ovld sub_group_non_uniform_reduce_max( half value );
-+half __ovld sub_group_non_uniform_scan_inclusive_add( half value );
-+half __ovld sub_group_non_uniform_scan_inclusive_mul( half value );
-+half __ovld sub_group_non_uniform_scan_inclusive_min( half value );
-+half __ovld sub_group_non_uniform_scan_inclusive_max( half value );
-+half __ovld sub_group_non_uniform_scan_exclusive_add( half value );
-+half __ovld sub_group_non_uniform_scan_exclusive_mul( half value );
-+half __ovld sub_group_non_uniform_scan_exclusive_min( half value );
-+half __ovld sub_group_non_uniform_scan_exclusive_max( half value );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+double __ovld sub_group_non_uniform_reduce_add( double value );
-+double __ovld sub_group_non_uniform_reduce_mul( double value );
-+double __ovld sub_group_non_uniform_reduce_min( double value );
-+double __ovld sub_group_non_uniform_reduce_max( double value );
-+double __ovld sub_group_non_uniform_scan_inclusive_add( double value );
-+double __ovld sub_group_non_uniform_scan_inclusive_mul( double value );
-+double __ovld sub_group_non_uniform_scan_inclusive_min( double value );
-+double __ovld sub_group_non_uniform_scan_inclusive_max( double value );
-+double __ovld sub_group_non_uniform_scan_exclusive_add( double value );
-+double __ovld sub_group_non_uniform_scan_exclusive_mul( double value );
-+double __ovld sub_group_non_uniform_scan_exclusive_min( double value );
-+double __ovld sub_group_non_uniform_scan_exclusive_max( double value );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_non_uniform_arithmetic
-+
-+#if defined(cl_khr_subgroup_shuffle)
-+char __ovld sub_group_shuffle( char value, uint index );
-+uchar __ovld sub_group_shuffle( uchar value, uint index );
-+short __ovld sub_group_shuffle( short value, uint index );
-+ushort __ovld sub_group_shuffle( ushort value, uint index );
-+int __ovld sub_group_shuffle( int value, uint index );
-+uint __ovld sub_group_shuffle( uint value, uint index );
-+long __ovld sub_group_shuffle( long value, uint index );
-+ulong __ovld sub_group_shuffle( ulong value, uint index );
-+float __ovld sub_group_shuffle( float value, uint index );
-+
-+char __ovld sub_group_shuffle_xor( char value, uint mask );
-+uchar __ovld sub_group_shuffle_xor( uchar value, uint mask );
-+short __ovld sub_group_shuffle_xor( short value, uint mask );
-+ushort __ovld sub_group_shuffle_xor( ushort value, uint mask );
-+int __ovld sub_group_shuffle_xor( int value, uint mask );
-+uint __ovld sub_group_shuffle_xor( uint value, uint mask );
-+long __ovld sub_group_shuffle_xor( long value, uint mask );
-+ulong __ovld sub_group_shuffle_xor( ulong value, uint mask );
-+float __ovld sub_group_shuffle_xor( float value, uint mask );
-+
-+#if defined(cl_khr_fp16)
-+half __ovld sub_group_shuffle( half value, uint index );
-+half __ovld sub_group_shuffle_xor( half value, uint mask );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+double __ovld sub_group_shuffle( double value, uint index );
-+double __ovld sub_group_shuffle_xor( double value, uint mask );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_shuffle
-+
-+#if defined(cl_khr_subgroup_shuffle_relative)
-+char __ovld sub_group_shuffle_up( char value, uint delta );
-+uchar __ovld sub_group_shuffle_up( uchar value, uint delta );
-+short __ovld sub_group_shuffle_up( short value, uint delta );
-+ushort __ovld sub_group_shuffle_up( ushort value, uint delta );
-+int __ovld sub_group_shuffle_up( int value, uint delta );
-+uint __ovld sub_group_shuffle_up( uint value, uint delta );
-+long __ovld sub_group_shuffle_up( long value, uint delta );
-+ulong __ovld sub_group_shuffle_up( ulong value, uint delta );
-+float __ovld sub_group_shuffle_up( float value, uint delta );
-+
-+char __ovld sub_group_shuffle_down( char value, uint delta );
-+uchar __ovld sub_group_shuffle_down( uchar value, uint delta );
-+short __ovld sub_group_shuffle_down( short value, uint delta );
-+ushort __ovld sub_group_shuffle_down( ushort value, uint delta );
-+int __ovld sub_group_shuffle_down( int value, uint delta );
-+uint __ovld sub_group_shuffle_down( uint value, uint delta );
-+long __ovld sub_group_shuffle_down( long value, uint delta );
-+ulong __ovld sub_group_shuffle_down( ulong value, uint delta );
-+float __ovld sub_group_shuffle_down( float value, uint delta );
-+
-+#if defined(cl_khr_fp16)
-+half __ovld sub_group_shuffle_up( half value, uint delta );
-+half __ovld sub_group_shuffle_down( half value, uint delta );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+double __ovld sub_group_shuffle_up( double value, uint delta );
-+double __ovld sub_group_shuffle_down( double value, uint delta );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_shuffle_relative
-+
-+#if defined(cl_khr_subgroup_clustered_reduce)
-+char __ovld sub_group_clustered_reduce_add( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_add( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_add( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_add( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_add( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_add( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_add( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_add( ulong value, uint clustersize );
-+float __ovld sub_group_clustered_reduce_add( float value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_mul( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_mul( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_mul( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_mul( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_mul( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_mul( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_mul( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_mul( ulong value, uint clustersize );
-+float __ovld sub_group_clustered_reduce_mul( float value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_min( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_min( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_min( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_min( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_min( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_min( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_min( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_min( ulong value, uint clustersize );
-+float __ovld sub_group_clustered_reduce_min( float value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_max( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_max( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_max( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_max( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_max( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_max( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_max( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_max( ulong value, uint clustersize );
-+float __ovld sub_group_clustered_reduce_max( float value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_and( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_and( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_and( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_and( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_and( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_and( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_and( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_and( ulong value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_or( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_or( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_or( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_or( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_or( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_or( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_or( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_or( ulong value, uint clustersize );
-+
-+char __ovld sub_group_clustered_reduce_xor( char value, uint clustersize );
-+uchar __ovld sub_group_clustered_reduce_xor( uchar value, uint clustersize );
-+short __ovld sub_group_clustered_reduce_xor( short value, uint clustersize );
-+ushort __ovld sub_group_clustered_reduce_xor( ushort value, uint clustersize );
-+int __ovld sub_group_clustered_reduce_xor( int value, uint clustersize );
-+uint __ovld sub_group_clustered_reduce_xor( uint value, uint clustersize );
-+long __ovld sub_group_clustered_reduce_xor( long value, uint clustersize );
-+ulong __ovld sub_group_clustered_reduce_xor( ulong value, uint clustersize );
-+
-+int __ovld sub_group_clustered_reduce_logical_and( int predicate, uint clustersize );
-+int __ovld sub_group_clustered_reduce_logical_or( int predicate, uint clustersize );
-+int __ovld sub_group_clustered_reduce_logical_xor( int predicate, uint clustersize );
-+
-+#if defined(cl_khr_fp16)
-+half __ovld sub_group_clustered_reduce_add( half value, uint clustersize );
-+half __ovld sub_group_clustered_reduce_mul( half value, uint clustersize );
-+half __ovld sub_group_clustered_reduce_min( half value, uint clustersize );
-+half __ovld sub_group_clustered_reduce_max( half value, uint clustersize );
-+#endif // cl_khr_fp16
-+
-+#if defined(cl_khr_fp64)
-+double __ovld sub_group_clustered_reduce_add( double value, uint clustersize );
-+double __ovld sub_group_clustered_reduce_mul( double value, uint clustersize );
-+double __ovld sub_group_clustered_reduce_min( double value, uint clustersize );
-+double __ovld sub_group_clustered_reduce_max( double value, uint clustersize );
-+#endif // cl_khr_fp64
-+
-+#endif // cl_khr_subgroup_clustered_reduce
-+
- #if defined(cl_intel_subgroups)
- // Intel-Specific Sub Group Functions
- float __ovld __conv intel_sub_group_shuffle( float x, uint c );
-diff --git a/clang/test/SemaOpenCL/extension-version.cl b/clang/test/SemaOpenCL/extension-version.cl
-index 0e6bbb7d3bcd..86c78143a0eb 100644
---- a/clang/test/SemaOpenCL/extension-version.cl
-+++ b/clang/test/SemaOpenCL/extension-version.cl
-@@ -333,3 +333,86 @@
- #endif
- #pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : enable
-
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_extended_types
-+#error "Missing cl_khr_subgroup_extended_types"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_extended_types
-+#error "Incorrect cl_khr_subgroup_extended_types define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_extended_types' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_extended_types : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_non_uniform_vote
-+#error "Missing cl_khr_subgroup_non_uniform_vote"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_non_uniform_vote
-+#error "Incorrect cl_khr_subgroup_non_uniform_vote define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_non_uniform_vote' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_non_uniform_vote : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_ballot
-+#error "Missing cl_khr_subgroup_ballot"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_ballot
-+#error "Incorrect cl_khr_subgroup_ballot define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_ballot' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_ballot : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_non_uniform_arithmetic
-+#error "Missing cl_khr_subgroup_non_uniform_arithmetic"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_non_uniform_arithmetic
-+#error "Incorrect cl_khr_subgroup_non_uniform_arithmetic define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_non_uniform_arithmetic' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_non_uniform_arithmetic : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_shuffle
-+#error "Missing cl_khr_subgroup_shuffle"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_shuffle
-+#error "Incorrect cl_khr_subgroup_shuffle define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_shuffle' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_shuffle : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_shuffle_relative
-+#error "Missing cl_khr_subgroup_shuffle_relative"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_shuffle_relative
-+#error "Incorrect cl_khr_subgroup_shuffle_relative define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_shuffle_relative' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_shuffle_relative : enable
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+#ifndef cl_khr_subgroup_clustered_reduce
-+#error "Missing cl_khr_subgroup_clustered_reduce"
-+#endif
-+#else
-+#ifdef cl_khr_subgroup_clustered_reduce
-+#error "Incorrect cl_khr_subgroup_clustered_reduce define"
-+#endif
-+// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroup_clustered_reduce' - ignoring}}
-+#endif
-+#pragma OPENCL EXTENSION cl_khr_subgroup_clustered_reduce : enable
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch
deleted file mode 100644
index cd519971..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From eeb816d95f0910bd246e37bb2bb3923acf0edf6b Mon Sep 17 00:00:00 2001
-From: Aleksander Us <aleksander.us@intel.com>
-Date: Mon, 26 Aug 2019 15:47:41 +0300
-Subject: [PATCH] [BasicBlockUtils] Add metadata fixing in
- SplitBlockPredecessors.
-
-In case when BB is header of some loop and predecessor is latch of
-this loop, metadata was not attached to newly created basic block.
-This led to loss of loop metadata for other passes.
-
-Upstream-Status: Submitted [https://reviews.llvm.org/D66892]
-
-https://github.com/intel/llvm-patches/commit/8af4449e2d201707f7f2f832b473a0439e255f32
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- lib/Transforms/Utils/BasicBlockUtils.cpp | 23 ++++++++----
- test/Transforms/LoopSimplify/loop_metadata.ll | 36 +++++++++++++++++++
- 2 files changed, 52 insertions(+), 7 deletions(-)
- create mode 100644 test/Transforms/LoopSimplify/loop_metadata.ll
-
-diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
-index 5fa371377c8..3a90ae061fb 100644
---- a/lib/Transforms/Utils/BasicBlockUtils.cpp
-+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
-@@ -579,24 +579,33 @@ BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB,
-
- // The new block unconditionally branches to the old block.
- BranchInst *BI = BranchInst::Create(BB, NewBB);
-+ bool IsBBHeader = LI && LI->isLoopHeader(BB);
-+ Loop *BBLoop = LI ? LI->getLoopFor(BB) : nullptr;
- // Splitting the predecessors of a loop header creates a preheader block.
-- if (LI && LI->isLoopHeader(BB))
-+ if (IsBBHeader)
- // Using the loop start line number prevents debuggers stepping into the
- // loop body for this instruction.
-- BI->setDebugLoc(LI->getLoopFor(BB)->getStartLoc());
-+ BI->setDebugLoc(BBLoop->getStartLoc());
- else
- BI->setDebugLoc(BB->getFirstNonPHIOrDbg()->getDebugLoc());
-
- // Move the edges from Preds to point to NewBB instead of BB.
-- for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
-+ for (BasicBlock *Pred : Preds) {
-+ Instruction *PI = Pred->getTerminator();
- // This is slightly more strict than necessary; the minimum requirement
- // is that there be no more than one indirectbr branching to BB. And
- // all BlockAddress uses would need to be updated.
-- assert(!isa<IndirectBrInst>(Preds[i]->getTerminator()) &&
-+ assert(!isa<IndirectBrInst>(PI) &&
- "Cannot split an edge from an IndirectBrInst");
-- assert(!isa<CallBrInst>(Preds[i]->getTerminator()) &&
-- "Cannot split an edge from a CallBrInst");
-- Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB);
-+ assert(!isa<CallBrInst>(PI) && "Cannot split an edge from a CallBrInst");
-+ if (IsBBHeader && BBLoop->contains(Pred) && BBLoop->isLoopLatch(Pred)) {
-+ // Update loop metadata if it exists.
-+ if (MDNode *LoopMD = PI->getMetadata(LLVMContext::MD_loop)) {
-+ BI->setMetadata(LLVMContext::MD_loop, LoopMD);
-+ PI->setMetadata(LLVMContext::MD_loop, nullptr);
-+ }
-+ }
-+ PI->replaceUsesOfWith(BB, NewBB);
- }
-
- // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI
-diff --git a/test/Transforms/LoopSimplify/loop_metadata.ll b/test/Transforms/LoopSimplify/loop_metadata.ll
-new file mode 100644
-index 00000000000..c15c92fe3ae
---- /dev/null
-+++ b/test/Transforms/LoopSimplify/loop_metadata.ll
-@@ -0,0 +1,36 @@
-+; RUN: opt -S -loop-simplify < %s | FileCheck %s
-+
-+; CHECK: for.cond.loopexit:
-+; CHECK: br label %for.cond, !llvm.loop !0
-+; CHECK: br i1 %cmp1, label %for.body1, label %for.cond.loopexit
-+
-+define void @foo() {
-+entry:
-+ br label %for.cond
-+
-+for.cond: ; preds = %for.cond1, %entry
-+ %j = phi i32 [ 0, %entry ], [ %add, %for.cond1 ]
-+ %cmp = icmp ult i32 %j, 8
-+ br i1 %cmp, label %for.body, label %for.end
-+
-+for.body: ; preds = %for.cond
-+ %dummy1 = add i32 1, 1
-+ %add = add nuw nsw i32 %j, 1
-+ br label %for.cond1
-+
-+for.cond1: ; preds = %for.body1, %for.body
-+ %i.0 = phi i32 [ 1, %for.body ], [ %inc, %for.body1 ]
-+ %cmp1 = icmp ult i32 %i.0, 8
-+ br i1 %cmp1, label %for.body1, label %for.cond, !llvm.loop !0
-+
-+for.body1: ; preds = %for.cond1
-+ %dummy2 = add i32 1, 1
-+ %inc = add nuw nsw i32 %i.0, 1
-+ br label %for.cond1
-+
-+for.end: ; preds = %for.cond
-+ ret void
-+}
-+
-+!0 = distinct !{!0, !1}
-+!1 = !{!"llvm.loop.unroll.full"}
---
-2.18.0
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch
deleted file mode 100644
index 48307deb..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From 35e218a886f4c066eabd18685240d55270bd5a6d Mon Sep 17 00:00:00 2001
-From: Aleksander Us <aleksander.us@intel.com>
-Date: Mon, 26 Aug 2019 15:45:47 +0300
-Subject: [PATCH] [IndVarSimplify] Do not use SCEV expander for IVCount in
- LFTR when possible.
-
-SCEV analysis cannot properly cache instruction with poison flags
-(for example, add nsw outside of loop will not be reused by expander).
-This can lead to generating of additional instructions by SCEV expander.
-
-Example IR:
-
- ...
- %maxval = add nuw nsw i32 %a1, %a2
- ...
-for.body:
- ...
- %cmp22 = icmp ult i32 %ivadd, %maxval
- br i1 %cmp22, label %for.body, label %for.end
- ...
-
-SCEV expander will generate copy of %maxval in preheader but without
-nuw/nsw flags. This can be avoided by explicit check that iv count
-value gives the same SCEV expressions as calculated by LFTR.
-
-Upstream-Status: Submitted [https://reviews.llvm.org/D66890]
-
-https://github.com/intel/llvm-patches/commit/fd6a6c97341a56fd21bc32bc940afea751312e8f
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- lib/Transforms/Scalar/IndVarSimplify.cpp | 12 +++++++++-
- test/Transforms/IndVarSimplify/add_nsw.ll | 23 ++++++++++++++++++++
- test/Transforms/IndVarSimplify/lftr-reuse.ll | 9 +++-----
- test/Transforms/IndVarSimplify/udiv.ll | 1 +
- 4 files changed, 38 insertions(+), 7 deletions(-)
- create mode 100644 test/Transforms/IndVarSimplify/add_nsw.ll
-
-diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
-index f9fc698a4a9..5e04dac8aa6 100644
---- a/lib/Transforms/Scalar/IndVarSimplify.cpp
-+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
-@@ -2375,6 +2375,17 @@ static Value *genLoopLimit(PHINode *IndVar, BasicBlock *ExitingBB,
- if (UsePostInc)
- IVLimit = SE->getAddExpr(IVLimit, SE->getOne(IVLimit->getType()));
-
-+ // If computed limit is equal to old limit then do not use SCEV expander
-+ // because it can lost NUW/NSW flags and create extra instructions.
-+ BranchInst *BI = cast<BranchInst>(ExitingBB->getTerminator());
-+ if (ICmpInst *Cmp = dyn_cast<ICmpInst>(BI->getOperand(0))) {
-+ Value *Limit = Cmp->getOperand(0);
-+ if (!L->isLoopInvariant(Limit))
-+ Limit = Cmp->getOperand(1);
-+ if (SE->getSCEV(Limit) == IVLimit)
-+ return Limit;
-+ }
-+
- // Expand the code for the iteration count.
- assert(SE->isLoopInvariant(IVLimit, L) &&
- "Computed iteration count is not loop invariant!");
-@@ -2383,7 +2394,6 @@ static Value *genLoopLimit(PHINode *IndVar, BasicBlock *ExitingBB,
- // SCEV expression (IVInit) for a pointer type IV value (IndVar).
- Type *LimitTy = ExitCount->getType()->isPointerTy() ?
- IndVar->getType() : ExitCount->getType();
-- BranchInst *BI = cast<BranchInst>(ExitingBB->getTerminator());
- return Rewriter.expandCodeFor(IVLimit, LimitTy, BI);
- }
- }
-diff --git a/test/Transforms/IndVarSimplify/add_nsw.ll b/test/Transforms/IndVarSimplify/add_nsw.ll
-new file mode 100644
-index 00000000000..abd1cbb6c51
---- /dev/null
-+++ b/test/Transforms/IndVarSimplify/add_nsw.ll
-@@ -0,0 +1,23 @@
-+; RUN: opt -indvars -S %s | FileCheck %s
-+
-+target datalayout = "e-p:32:32-i64:64-n8:16:32"
-+
-+; CHECK: for.body.preheader:
-+; CHECK-NOT: add
-+; CHECK: for.body:
-+
-+define void @foo(i32 %a1, i32 %a2) {
-+entry:
-+ %maxval = add nuw nsw i32 %a1, %a2
-+ %cmp = icmp slt i32 %maxval, 1
-+ br i1 %cmp, label %for.end, label %for.body
-+
-+for.body: ; preds = %entry, %for.body
-+ %j.02 = phi i32 [ 0, %entry ], [ %add31, %for.body ]
-+ %add31 = add nuw nsw i32 %j.02, 1
-+ %cmp22 = icmp slt i32 %add31, %maxval
-+ br i1 %cmp22, label %for.body, label %for.end
-+
-+for.end: ; preds = %for.body
-+ ret void
-+}
-diff --git a/test/Transforms/IndVarSimplify/lftr-reuse.ll b/test/Transforms/IndVarSimplify/lftr-reuse.ll
-index 14ae9738696..509d662b767 100644
---- a/test/Transforms/IndVarSimplify/lftr-reuse.ll
-+++ b/test/Transforms/IndVarSimplify/lftr-reuse.ll
-@@ -67,11 +67,9 @@ define void @expandOuterRecurrence(i32 %arg) nounwind {
- ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 0, [[SUB1]]
- ; CHECK-NEXT: br i1 [[CMP1]], label [[OUTER_PREHEADER:%.*]], label [[EXIT:%.*]]
- ; CHECK: outer.preheader:
--; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[ARG]], -1
- ; CHECK-NEXT: br label [[OUTER:%.*]]
- ; CHECK: outer:
--; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i32 [ [[TMP0]], [[OUTER_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[OUTER_INC:%.*]] ]
--; CHECK-NEXT: [[I:%.*]] = phi i32 [ [[I_INC:%.*]], [[OUTER_INC]] ], [ 0, [[OUTER_PREHEADER]] ]
-+; CHECK-NEXT: [[I:%.*]] = phi i32 [ [[I_INC:%.*]], [[OUTER_INC:%.*]] ], [ 0, [[OUTER_PREHEADER]] ]
- ; CHECK-NEXT: [[SUB2:%.*]] = sub nsw i32 [[ARG]], [[I]]
- ; CHECK-NEXT: [[SUB3:%.*]] = sub nsw i32 [[SUB2]], 1
- ; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 0, [[SUB3]]
-@@ -81,14 +79,13 @@ define void @expandOuterRecurrence(i32 %arg) nounwind {
- ; CHECK: inner:
- ; CHECK-NEXT: [[J:%.*]] = phi i32 [ 0, [[INNER_PH]] ], [ [[J_INC:%.*]], [[INNER]] ]
- ; CHECK-NEXT: [[J_INC]] = add nuw nsw i32 [[J]], 1
--; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[J_INC]], [[INDVARS_IV]]
-+; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[J_INC]], [[SUB3]]
- ; CHECK-NEXT: br i1 [[EXITCOND]], label [[INNER]], label [[OUTER_INC_LOOPEXIT:%.*]]
- ; CHECK: outer.inc.loopexit:
- ; CHECK-NEXT: br label [[OUTER_INC]]
- ; CHECK: outer.inc:
- ; CHECK-NEXT: [[I_INC]] = add nuw nsw i32 [[I]], 1
--; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add i32 [[INDVARS_IV]], -1
--; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[I_INC]], [[TMP0]]
-+; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[I_INC]], [[SUB1]]
- ; CHECK-NEXT: br i1 [[EXITCOND1]], label [[OUTER]], label [[EXIT_LOOPEXIT:%.*]]
- ; CHECK: exit.loopexit:
- ; CHECK-NEXT: br label [[EXIT]]
-diff --git a/test/Transforms/IndVarSimplify/udiv.ll b/test/Transforms/IndVarSimplify/udiv.ll
-index b3f2c2a6a66..3530343ef4a 100644
---- a/test/Transforms/IndVarSimplify/udiv.ll
-+++ b/test/Transforms/IndVarSimplify/udiv.ll
-@@ -133,6 +133,7 @@ declare i32 @printf(i8* nocapture, ...) nounwind
- ; CHECK-LABEL: @foo(
- ; CHECK: for.body.preheader:
- ; CHECK-NOT: udiv
-+; CHECK: for.body:
-
- define void @foo(double* %p, i64 %n) nounwind {
- entry:
---
-2.18.0
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/fix-shared-libs.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/fix-shared-libs.patch
deleted file mode 100644
index d69d2a97..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/fix-shared-libs.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From a6d4ccf082858e63e139ca06c02a071c343d2657 Mon Sep 17 00:00:00 2001
-From: Andrea Bocci <andrea.bocci@cern.ch>
-Date: Sun, 15 Mar 2020 17:35:44 +0100
-Subject: [PATCH] Fix building in-tree with cmake -DLLVM_LINK_LLVM_DYLIB=ON
-
-Building in-tree with LLVM 11.0 master with the LLVM_LINK_LLVM_DYLIB
-cmake flag fails to link with the LLVMSPIRVLib library.
-
-Add an explicit dependency to force the correct build order and linking.
-
-Signed-off-by: Andrea Bocci <andrea.bocci@cern.ch>
-Upstream-Status: Backport
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- tools/llvm-spirv/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tools/llvm-spirv/CMakeLists.txt b/tools/llvm-spirv/CMakeLists.txt
-index 9aa96d9c..501c0daf 100644
---- a/tools/llvm-spirv/CMakeLists.txt
-+++ b/tools/llvm-spirv/CMakeLists.txt
-@@ -14,7 +14,7 @@ add_llvm_tool(llvm-spirv
- NO_INSTALL_RPATH
- )
-
--if (LLVM_SPIRV_BUILD_EXTERNAL)
-+if (LLVM_SPIRV_BUILD_EXTERNAL OR LLVM_LINK_LLVM_DYLIB)
- target_link_libraries(llvm-spirv PRIVATE LLVMSPIRVLib)
- endif()
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-OpenCL-3.0-support.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-OpenCL-3.0-support.patch
deleted file mode 100644
index 53395ea0..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-OpenCL-3.0-support.patch
+++ /dev/null
@@ -1,8259 +0,0 @@
-From 31ec702cb365f4d02dd2146fb4329d642b8fc30b Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 7 Apr 2021 16:36:10 +0800
-Subject: [PATCH 1/2] OpenCL 3.0 support
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/clang/0001-OpenCL-3.0-support.patch]
-Signed-off-by: Anton Zabaznov <anton.zabaznov@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/include/clang/Basic/Builtins.def | 65 +-
- clang/include/clang/Basic/Builtins.h | 13 +-
- .../clang/Basic/DiagnosticParseKinds.td | 2 +
- .../clang/Basic/DiagnosticSemaKinds.td | 7 +
- clang/include/clang/Basic/LangOptions.def | 2 +
- clang/include/clang/Basic/LangStandards.def | 4 +
- .../include/clang/Basic/OpenCLExtensions.def | 15 +
- clang/include/clang/Basic/OpenCLOptions.h | 175 +-
- clang/include/clang/Driver/Options.td | 2 +-
- clang/include/clang/Sema/Sema.h | 9 +
- clang/lib/AST/ASTContext.cpp | 3 +-
- clang/lib/Basic/Builtins.cpp | 28 +-
- clang/lib/Basic/TargetInfo.cpp | 11 +
- clang/lib/Basic/Targets.cpp | 1 -
- clang/lib/CodeGen/CodeGenFunction.cpp | 6 +-
- clang/lib/Frontend/CompilerInvocation.cpp | 22 +-
- clang/lib/Frontend/InitPreprocessor.cpp | 6 +-
- clang/lib/Headers/opencl-c-base.h | 75 +-
- clang/lib/Headers/opencl-c.h | 3228 ++++++++++++++---
- clang/lib/Parse/ParseDecl.cpp | 12 +-
- clang/lib/Parse/ParsePragma.cpp | 10 +-
- clang/lib/Sema/OpenCLBuiltins.td | 49 +-
- clang/lib/Sema/Sema.cpp | 47 +-
- clang/lib/Sema/SemaChecking.cpp | 38 +-
- clang/lib/Sema/SemaDecl.cpp | 15 +-
- clang/lib/Sema/SemaDeclAttr.cpp | 9 +-
- clang/lib/Sema/SemaDeclCXX.cpp | 10 +
- clang/lib/Sema/SemaLookup.cpp | 19 +-
- clang/lib/Sema/SemaType.cpp | 14 +-
- .../CodeGenOpenCL/addr-space-struct-arg.cl | 7 +-
- .../address-spaces-conversions.cl | 2 +
- .../CodeGenOpenCL/address-spaces-mangling.cl | 3 +-
- clang/test/CodeGenOpenCL/address-spaces.cl | 4 +
- .../amdgcn-automatic-variable.cl | 1 +
- .../CodeGenOpenCL/amdgpu-sizeof-alignof.cl | 21 +-
- .../CodeGenOpenCL/arm-integer-dot-product.cl | 1 +
- .../test/CodeGenOpenCL/cl-uniform-wg-size.cl | 2 +
- clang/test/CodeGenOpenCL/fpmath.cl | 2 +
- .../generic-address-space-feature.cl | 28 +
- .../intel-subgroups-avc-ext-types.cl | 1 +
- .../kernels-have-spir-cc-by-default.cl | 3 +
- clang/test/CodeGenOpenCL/logical-ops.cl | 1 +
- clang/test/CodeGenOpenCL/no-half.cl | 1 +
- clang/test/CodeGenOpenCL/pipe_builtin.cl | 3 +
- clang/test/CodeGenOpenCL/pipe_types.cl | 1 +
- clang/test/CodeGenOpenCL/printf.cl | 2 +
- clang/test/CodeGenOpenCL/unroll-hint.cl | 1 +
- clang/test/Driver/autocomplete.c | 2 +
- clang/test/Driver/opencl.cl | 2 +
- clang/test/Driver/unknown-std.cl | 1 +
- clang/test/Frontend/stdlang.c | 1 +
- clang/test/Headers/opencl-c-header.cl | 7 +-
- clang/test/Index/pipe-size.cl | 7 +
- clang/test/Preprocessor/predefined-macros.c | 13 +
- .../Sema/feature-extensions-simult-support.cl | 75 +
- clang/test/Sema/features-ignore-pragma.cl | 24 +
- clang/test/Sema/opencl-features-pipes.cl | 18 +
- clang/test/Sema/opencl-features.cl | 128 +
- clang/test/Sema/pipe_builtins_feature.cl | 21 +
- .../address-spaces-conversions-cl2.0.cl | 3 +
- clang/test/SemaOpenCL/address-spaces.cl | 1 +
- .../SemaOpenCL/cl20-device-side-enqueue.cl | 16 +-
- .../SemaOpenCL/forget-unsupported-builtins.cl | 22 +
- clang/test/SemaOpenCL/image-features.cl | 20 +
- .../SemaOpenCL/invalid-pipe-builtin-cl2.0.cl | 1 +
- clang/test/SemaOpenCL/storageclass-cl20.cl | 1 +
- .../TableGen/ClangOpenCLBuiltinEmitter.cpp | 35 +-
- 67 files changed, 3656 insertions(+), 723 deletions(-)
- create mode 100644 clang/test/CodeGenOpenCL/generic-address-space-feature.cl
- create mode 100644 clang/test/Sema/feature-extensions-simult-support.cl
- create mode 100644 clang/test/Sema/features-ignore-pragma.cl
- create mode 100644 clang/test/Sema/opencl-features-pipes.cl
- create mode 100644 clang/test/Sema/opencl-features.cl
- create mode 100644 clang/test/Sema/pipe_builtins_feature.cl
- create mode 100644 clang/test/SemaOpenCL/forget-unsupported-builtins.cl
- create mode 100644 clang/test/SemaOpenCL/image-features.cl
-
-diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def
-index 1a6c85ce2dd3..b76e277f0337 100644
---- a/clang/include/clang/Basic/Builtins.def
-+++ b/clang/include/clang/Basic/Builtins.def
-@@ -106,6 +106,10 @@
- # define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
- #endif
-
-+#if defined(BUILTIN) && !defined(OPENCLBUILTIN)
-+# define OPENCLBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG, FEATURE) BUILTIN(ID, TYPE, ATTRS)
-+#endif
-+
- // Standard libc/libm functions:
- BUILTIN(__builtin_atan2 , "ddd" , "Fne")
- BUILTIN(__builtin_atan2f, "fff" , "Fne")
-@@ -1514,50 +1518,54 @@ BUILTIN(__builtin_coro_param, "bv*v*", "n")
-
- // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.
- // We need the generic prototype, since the packet type could be anything.
--LANGBUILTIN(read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(commit_write_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(commit_read_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
- // OpenCL v2.0 s6.13.17 - Enqueue kernel functions.
- // Custom builtin check allows to perform special check of passed block arguments.
--LANGBUILTIN(enqueue_kernel, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(enqueue_kernel, "i.", "tn", OCLC2P_LANG,
-+ "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC2P_LANG,
-+ "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn",
-+ OCLC2P_LANG, "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn",
-+ OCLC2P_LANG, "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_device_enqueue")
-
- // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
- // FIXME: Pointer parameters of OpenCL builtins should have their address space
- // requirement defined.
--LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG)
--LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG)
--LANGBUILTIN(to_private, "v*v*", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(to_global, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-+OPENCLBUILTIN(to_local, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-+OPENCLBUILTIN(to_private, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-
- // OpenCL half load/store builtin
--LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES)
-+OPENCLBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES, "")
-
- // Builtins for os_log/os_trace
- BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut")
-@@ -1578,3 +1586,4 @@ BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n")
- #undef BUILTIN
- #undef LIBBUILTIN
- #undef LANGBUILTIN
-+#undef OPENCLBUILTIN
-diff --git a/clang/include/clang/Basic/Builtins.h b/clang/include/clang/Basic/Builtins.h
-index e4ed482d9068..713ea4bc267d 100644
---- a/clang/include/clang/Basic/Builtins.h
-+++ b/clang/include/clang/Basic/Builtins.h
-@@ -33,13 +33,13 @@ enum LanguageID {
- CXX_LANG = 0x4, // builtin for cplusplus only.
- OBJC_LANG = 0x8, // builtin for objective-c and objective-c++
- MS_LANG = 0x10, // builtin requires MS mode.
-- OCLC20_LANG = 0x20, // builtin for OpenCL C 2.0 only.
-+ OCLC2P_LANG = 0x20, // builtin for OpenCL C 2.0+ versions.
- OCLC1X_LANG = 0x40, // builtin for OpenCL C 1.x only.
- OMP_LANG = 0x80, // builtin requires OpenMP.
- ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages.
- ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode.
- ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG, // builtin requires MS mode.
-- ALL_OCLC_LANGUAGES = OCLC1X_LANG | OCLC20_LANG // builtin for OCLC languages.
-+ ALL_OCLC_LANGUAGES = OCLC1X_LANG | OCLC2P_LANG // builtin for OCLC languages.
- };
-
- namespace Builtin {
-@@ -228,6 +228,10 @@ public:
- /// for non-builtins.
- bool canBeRedeclared(unsigned ID) const;
-
-+ bool requiresFeatures(unsigned ID) const {
-+ return requiresFeatures(getRecord(ID));
-+ }
-+
- private:
- const Info &getRecord(unsigned ID) const;
-
-@@ -235,6 +239,11 @@ private:
- bool builtinIsSupported(const Builtin::Info &BuiltinInfo,
- const LangOptions &LangOpts);
-
-+ bool OclBuiltinIsSupported(const Builtin::Info &BuiltinInfo,
-+ const LangOptions &LangOpts) const;
-+
-+ bool requiresFeatures(const Builtin::Info &BuiltinInfo) const;
-+
- /// Helper function for isPrintfLike and isScanfLike.
- bool isLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg,
- const char *Fmt) const;
-diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
-index 33adf093693f..43ea63586f91 100644
---- a/clang/include/clang/Basic/DiagnosticParseKinds.td
-+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
-@@ -1199,6 +1199,8 @@ def warn_pragma_unsupported_extension : Warning<
- "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
- def warn_pragma_extension_is_core : Warning<
- "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<DiagGroup<"pedantic-core-features">>, DefaultIgnore;
-+def warn_opencl_pragma_feature_ignore : Warning<
-+ "OpenCL feature support can't be controlled via pragma, ignoring">, InGroup<IgnoredPragmas>;
-
- // OpenCL errors.
- def err_opencl_taking_function_address_parser : Error<
-diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
-index 917377420505..91648aa27820 100644
---- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
-+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -9378,6 +9378,13 @@ def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
- def err_openclcxx_placement_new : Error<
- "use of placement new requires explicit declaration">;
-
-+def err_opencl_pipes_require_feat : Error<
-+ "usage of OpenCL pipes requires feature support">;
-+def err_opencl_memory_scope_require_feat : Error<
-+ "usage of memory scope requires feature support">;
-+def err_opencl_memory_ordering_require_feat : Error<
-+ "usage of memory ordering requires feature support">;
-+
- // MIG routine annotations.
- def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
- "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
-diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
-index 3319a3123976..406f45c0be69 100644
---- a/clang/include/clang/Basic/LangOptions.def
-+++ b/clang/include/clang/Basic/LangOptions.def
-@@ -203,6 +203,8 @@ LANGOPT(OpenCL , 1, 0, "OpenCL")
- LANGOPT(OpenCLVersion , 32, 0, "OpenCL C version")
- LANGOPT(OpenCLCPlusPlus , 1, 0, "C++ for OpenCL")
- LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "C++ for OpenCL version")
-+LANGOPT(OpenCLGenericKeyword , 1, 0, "OpenCL generic keyword")
-+LANGOPT(OpenCLPipeKeyword , 1, 0, "OpenCL pipe keyword")
- LANGOPT(NativeHalfType , 1, 0, "Native half type support")
- LANGOPT(NativeHalfArgsAndReturns, 1, 0, "Native half args and returns")
- LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns")
-diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
-index 7f1a24db7e9b..69aaba3ff5a2 100644
---- a/clang/include/clang/Basic/LangStandards.def
-+++ b/clang/include/clang/Basic/LangStandards.def
-@@ -167,6 +167,9 @@ LANGSTANDARD(opencl12, "cl1.2",
- LANGSTANDARD(opencl20, "cl2.0",
- OpenCL, "OpenCL 2.0",
- LineComment | C99 | Digraphs | HexFloat | OpenCL)
-+LANGSTANDARD(opencl30, "cl3.0",
-+ OpenCL, "OpenCL 3.0",
-+ LineComment | C99 | Digraphs | HexFloat | OpenCL)
- LANGSTANDARD(openclcpp, "clc++",
- OpenCL, "C++ for OpenCL",
- LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
-@@ -176,6 +179,7 @@ LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
- LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
- LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
- LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
-+LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0")
- LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
-
- // CUDA
-diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
-index 517481584313..608f78a13eef 100644
---- a/clang/include/clang/Basic/OpenCLExtensions.def
-+++ b/clang/include/clang/Basic/OpenCLExtensions.def
-@@ -93,6 +93,21 @@ OPENCLEXT_INTERNAL(cl_intel_subgroups, 120, ~0U)
- OPENCLEXT_INTERNAL(cl_intel_subgroups_short, 120, ~0U)
- OPENCLEXT_INTERNAL(cl_intel_device_side_avc_motion_estimation, 120, ~0U)
-
-+OPENCLEXT_INTERNAL(__opencl_c_pipes, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_generic_address_space, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_work_group_collective_functions, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_order_acq_rel, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_order_seq_cst, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_scope_device, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_scope_all_devices, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_subgroups, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_3d_image_writes, 100, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_device_enqueue, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_read_write_images, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_program_scope_global_variables, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_fp64, 120, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_int64, 100, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_images, 100, ~0U)
- #undef OPENCLEXT_INTERNAL
-
- #ifdef OPENCLEXT
-diff --git a/clang/include/clang/Basic/OpenCLOptions.h b/clang/include/clang/Basic/OpenCLOptions.h
-index 15661154eab5..9a3a8e33cadd 100644
---- a/clang/include/clang/Basic/OpenCLOptions.h
-+++ b/clang/include/clang/Basic/OpenCLOptions.h
-@@ -16,11 +16,16 @@
-
- #include "clang/Basic/LangOptions.h"
- #include "llvm/ADT/StringMap.h"
-+#include "llvm/ADT/StringSwitch.h"
-
- namespace clang {
-
- /// OpenCL supported extensions and optional core features
- class OpenCLOptions {
-+ // OpenCL Version
-+ unsigned CLVer = 120;
-+ bool IsOpenCLCPlusPlus = false;
-+
- struct Info {
- bool Supported; // Is this option supported
- bool Enabled; // Is this option enabled
-@@ -31,7 +36,38 @@ class OpenCLOptions {
- :Supported(S), Enabled(E), Avail(A), Core(C){}
- };
- llvm::StringMap<Info> OptMap;
-+
- public:
-+ void setOpenCLVersion(const LangOptions &LO) {
-+ IsOpenCLCPlusPlus = LO.OpenCLCPlusPlus;
-+ CLVer = IsOpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
-+ }
-+
-+ // Get extension which is semantically equivalent to a given feature
-+ // if exists (e.g. __opencl_c_subgroups -> cl_khr_subgroups)
-+ llvm::Optional<StringRef> getEquivalentExtension(StringRef Feature) const {
-+ return llvm::StringSwitch<llvm::Optional<StringRef>>(Feature)
-+ .Case("__opencl_c_3d_image_writes",
-+ Optional<StringRef>("cl_khr_3d_image_writes"))
-+ .Case("__opencl_c_subgroups", Optional<StringRef>("cl_khr_subgroups"))
-+ .Case("__opencl_c_fp64", Optional<StringRef>("cl_khr_fp64"))
-+ .Default(Optional<StringRef>());
-+ }
-+
-+ // Same as above but for extensions
-+ llvm::Optional<StringRef> getEquivalentFeature(StringRef Extension) const {
-+ return llvm::StringSwitch<llvm::Optional<StringRef>>(Extension)
-+ .Case("cl_khr_3d_image_writes",
-+ Optional<StringRef>("__opencl_c_3d_image_writes"))
-+ .Case("cl_khr_subgroups", Optional<StringRef>("__opencl_c_subgroups"))
-+ .Case("cl_khr_fp64", Optional<StringRef>("__opencl_c_fp64"))
-+ .Default(Optional<StringRef>());
-+ }
-+
-+ bool isFeature(llvm::StringRef Ext) const {
-+ return Ext.startswith("__opencl_c");
-+ }
-+
- bool isKnown(llvm::StringRef Ext) const {
- return OptMap.find(Ext) != OptMap.end();
- }
-@@ -42,32 +78,88 @@ public:
-
- // Is supported as either an extension or an (optional) core feature for
- // OpenCL version \p CLVer.
-- bool isSupported(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupported(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer;
- }
-
- // Is supported (optional) OpenCL core features for OpenCL version \p CLVer.
- // For supported extension, return false.
-- bool isSupportedCore(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupportedCore(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer && I.Core != ~0U && CLVer >= I.Core;
- }
-
- // Is supported OpenCL extension for OpenCL version \p CLVer.
- // For supported (optional) core feature, return false.
-- bool isSupportedExtension(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupportedExtension(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer && (I.Core == ~0U || CLVer < I.Core);
- }
-
-+ // Support features whose support is directly related to the
-+ // specific OpenCL version. For example, OpenCL 2.0 supports
-+ // all features that are optional in 3.0
-+ void adjustFeatures() {
-+ // Support int64 by default (assume compiling for FULL profile)
-+ OptMap["__opencl_c_int64"].Supported = true;
-+
-+ if (CLVer >= 300) {
-+ // Simultaneously support extension and corresponding feature
-+ for (llvm::StringRef F :
-+ {"__opencl_c_subgroups", "__opencl_c_3d_image_writes",
-+ "__opencl_c_fp64"}) {
-+ auto Ext = getEquivalentExtension(F);
-+ OptMap[*Ext].Supported = OptMap[F].Supported;
-+ }
-+
-+ // OpenCL C compilers that define the feature macro __opencl_c_pipes or
-+ // or __opencl_c_device_enqueue must also define the
-+ // feature macro __opencl_c_generic_address_space.
-+ if (OptMap["__opencl_c_pipes"].Supported ||
-+ OptMap["__opencl_c_device_enqueue"].Supported)
-+ OptMap["__opencl_c_generic_address_space"].Supported = true;
-+
-+ // OpenCL C compilers that define the feature macro
-+ // __opencl_c_3d_image_writes or __opencl_c_read_write_images must also
-+ // define the feature macro __opencl_c_images
-+ if (OptMap["__opencl_c_3d_image_writes"].Supported ||
-+ OptMap["__opencl_c_read_write_images"].Supported)
-+ OptMap["__opencl_c_images"].Supported = true;
-+
-+ // All other features are already supported with options
-+ // or in target settings
-+ return;
-+ }
-+
-+ auto FeaturesRange = llvm::make_filter_range(
-+ OptMap, [&](llvm::StringMapEntry<Info> &OptVal) {
-+ auto Opt = OptVal.getKey();
-+ return isFeature(Opt);
-+ });
-+
-+ for (auto &It : FeaturesRange) {
-+ auto &Info = It.getValue();
-+ // For OpenCL version less then 3.0 some
-+ // features should be supported simulateneously
-+ // with specific extension
-+ if (Optional<llvm::StringRef> Ext = getEquivalentExtension(It.getKey()))
-+ Info.Supported = Info.Enabled = OptMap[*Ext].Supported;
-+ else if (Info.Avail <= CLVer)
-+ Info.Supported = Info.Enabled = true;
-+ }
-+ }
-+
- void enable(llvm::StringRef Ext, bool V = true) {
-+ // Ignore disabling extensions if corresponding features
-+ // already supported for OpenCL version higher then 3.0
-+ if (CLVer >= 300)
-+ if (Optional<llvm::StringRef> F = getEquivalentFeature(Ext))
-+ if (V != OptMap[*F].Enabled)
-+ return;
- OptMap[Ext].Enabled = V;
- }
-
-@@ -96,7 +188,7 @@ public:
- OptMap[Ext].Supported = V;
- }
-
-- OpenCLOptions(){
-+ OpenCLOptions() {
- #define OPENCLEXT_INTERNAL(Ext, AvailVer, CoreVer) \
- OptMap[#Ext].Avail = AvailVer; \
- OptMap[#Ext].Core = CoreVer;
-@@ -104,35 +196,86 @@ public:
- }
-
- void addSupport(const OpenCLOptions &Opts) {
-+ assert(IsOpenCLCPlusPlus == Opts.IsOpenCLCPlusPlus && CLVer == Opts.CLVer);
- for (auto &I:Opts.OptMap)
-- if (I.second.Supported)
-+ if (I.second.Supported) {
- OptMap[I.getKey()].Supported = true;
-+ // All features are enabled as they are supported
-+ if (isFeature(I.getKey()))
-+ OptMap[I.getKey()].Enabled = true;
-+ }
-+ if (CLVer >= 300) {
-+ // Enabling extensions with respect to features
-+ for (llvm::StringRef Ext :
-+ {"cl_khr_3d_image_writes", "cl_khr_subgroups", "cl_khr_fp64"}) {
-+ auto Feature = getEquivalentFeature(Ext);
-+ enable(Ext, OptMap[*Feature].Enabled);
-+ }
-+ }
- }
-
- void copy(const OpenCLOptions &Opts) {
-+ CLVer = Opts.CLVer;
-+ IsOpenCLCPlusPlus = Opts.IsOpenCLCPlusPlus;
- OptMap = Opts.OptMap;
- }
-
- // Turn on or off support of all options.
- void supportAll(bool On = true) {
-- for (llvm::StringMap<Info>::iterator I = OptMap.begin(),
-- E = OptMap.end(); I != E; ++I)
-- I->second.Supported = On;
-+ for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
-+ I != E; ++I)
-+ if (!isFeature(I->getKey()))
-+ I->second.Supported = On;
- }
-
- void disableAll() {
-- for (llvm::StringMap<Info>::iterator I = OptMap.begin(),
-- E = OptMap.end(); I != E; ++I)
-- I->second.Enabled = false;
-+ for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
-+ I != E; ++I) {
-+ auto Ext = I->getKey();
-+ if (!isFeature(Ext))
-+ enable(Ext, false);
-+ }
- }
-
-- void enableSupportedCore(LangOptions LO) {
-+ void enableSupportedCore() {
- for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
- I != E; ++I)
-- if (isSupportedCore(I->getKey(), LO))
-+ if (isSupportedCore(I->getKey()))
- I->second.Enabled = true;
- }
-
-+ // This enum specifies how OpenCL versions map into values
-+ // for encoding. This is used when generating built-ins
-+ // from tablegen
-+ enum OpenCLVersionsEncodings : unsigned short {
-+ OPENCL_C_100_CODE = 0x1,
-+ OPENCL_C_110_CODE = 0x2,
-+ OPENCL_C_120_CODE = 0x4,
-+ OPENCL_C_200_CODE = 0x8,
-+ OPENCL_C_300_CODE = 0x10,
-+ OPENCL_C_ALL_CODE = 0x1f
-+ };
-+
-+ // Encode version into single integer
-+ static unsigned short EncodeVersion(unsigned OpenCLVersion) {
-+ switch (OpenCLVersion) {
-+ default:
-+ llvm_unreachable("Unknown OpenCL version");
-+ case 0:
-+ return OpenCLVersionsEncodings::OPENCL_C_ALL_CODE;
-+ case 100:
-+ return OpenCLVersionsEncodings::OPENCL_C_100_CODE;
-+ case 110:
-+ return OpenCLVersionsEncodings::OPENCL_C_110_CODE;
-+ case 120:
-+ return OpenCLVersionsEncodings::OPENCL_C_120_CODE;
-+ case 200:
-+ return OpenCLVersionsEncodings::OPENCL_C_200_CODE;
-+ case 300:
-+ return OpenCLVersionsEncodings::OPENCL_C_300_CODE;
-+ }
-+ }
-+
- friend class ASTWriter;
- friend class ASTReader;
- };
-diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
-index 391c895a453b..e03c22c749ad 100644
---- a/clang/include/clang/Driver/Options.td
-+++ b/clang/include/clang/Driver/Options.td
-@@ -522,7 +522,7 @@ def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC
- def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
- HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">;
- def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
-- HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,clc++,CLC++">;
-+ HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++">;
- def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>, Flags<[CC1Option]>,
- HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
- def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
-diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
-index 842e49602274..d8ac91bc8a31 100644
---- a/clang/include/clang/Sema/Sema.h
-+++ b/clang/include/clang/Sema/Sema.h
-@@ -9632,6 +9632,10 @@ public:
- /// \return true if type is disabled.
- bool checkOpenCLDisabledDecl(const NamedDecl &D, const Expr &E);
-
-+ bool checkOpenCLSubgroupExtForCallExpr(CallExpr *Call);
-+
-+ bool isSupportedOpenCLOMemoryOrdering(int64_t Ordering) const;
-+
- //===--------------------------------------------------------------------===//
- // OpenMP directives and clauses.
- //
-@@ -11102,6 +11106,11 @@ public:
- /// that the user intended an assignment used as condition.
- void DiagnoseEqualityWithExtraParens(ParenExpr *ParenE);
-
-+ template <typename DiagLocT, typename DiagInfoT>
-+ void DiagnoseOpenCLRequiresOption(llvm::StringRef OpenCLOptName,
-+ DiagLocT DiagLoc, DiagInfoT DiagInfo,
-+ unsigned Selector, SourceRange SrcRange);
-+
- /// CheckCXXBooleanCondition - Returns true if conversion to bool is invalid.
- ExprResult CheckCXXBooleanCondition(Expr *CondExpr, bool IsConstexpr = false);
-
-diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
-index 1be72efe4de8..2a81fbcde79d 100644
---- a/clang/lib/AST/ASTContext.cpp
-+++ b/clang/lib/AST/ASTContext.cpp
-@@ -1490,7 +1490,8 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
- ObjCSuperType = QualType();
-
- // void * type
-- if (LangOpts.OpenCLVersion >= 200) {
-+ if (Target.getSupportedOpenCLOpts().isEnabled(
-+ "__opencl_c_generic_address_space")) {
- auto Q = VoidTy.getQualifiers();
- Q.setAddressSpace(LangAS::opencl_generic);
- VoidPtrTy = getPointerType(getCanonicalType(
-diff --git a/clang/lib/Basic/Builtins.cpp b/clang/lib/Basic/Builtins.cpp
-index 0cd89df41b67..7a3067345098 100644
---- a/clang/lib/Basic/Builtins.cpp
-+++ b/clang/lib/Basic/Builtins.cpp
-@@ -23,6 +23,8 @@ static const Builtin::Info BuiltinInfo[] = {
- { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr },
- #define LANGBUILTIN(ID, TYPE, ATTRS, LANGS) \
- { #ID, TYPE, ATTRS, nullptr, LANGS, nullptr },
-+#define OPENCLBUILTIN(ID, TYPE, ATTRS, LANGS, FEATURE) \
-+ {#ID, TYPE, ATTRS, nullptr, LANGS, FEATURE},
- #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, LANGS) \
- { #ID, TYPE, ATTRS, HEADER, LANGS, nullptr },
- #include "clang/Basic/Builtins.def"
-@@ -69,16 +71,17 @@ bool Builtin::Context::builtinIsSupported(const Builtin::Info &BuiltinInfo,
- bool ObjCUnsupported = !LangOpts.ObjC && BuiltinInfo.Langs == OBJC_LANG;
- bool OclC1Unsupported = (LangOpts.OpenCLVersion / 100) != 1 &&
- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES ) == OCLC1X_LANG;
-- bool OclC2Unsupported =
-- (LangOpts.OpenCLVersion != 200 && !LangOpts.OpenCLCPlusPlus) &&
-- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES) == OCLC20_LANG;
-+ bool OclC2PUnsupported =
-+ (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES) == OCLC2P_LANG &&
-+ ((LangOpts.OpenCLVersion < 200 && !LangOpts.OpenCLCPlusPlus) ||
-+ !OclBuiltinIsSupported(BuiltinInfo, LangOpts));
- bool OclCUnsupported = !LangOpts.OpenCL &&
- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES);
- bool OpenMPUnsupported = !LangOpts.OpenMP && BuiltinInfo.Langs == OMP_LANG;
- bool CPlusPlusUnsupported =
- !LangOpts.CPlusPlus && BuiltinInfo.Langs == CXX_LANG;
- return !BuiltinsUnsupported && !MathBuiltinsUnsupported && !OclCUnsupported &&
-- !OclC1Unsupported && !OclC2Unsupported && !OpenMPUnsupported &&
-+ !OclC1Unsupported && !OclC2PUnsupported && !OpenMPUnsupported &&
- !GnuModeUnsupported && !MSModeUnsupported && !ObjCUnsupported &&
- !CPlusPlusUnsupported;
- }
-@@ -191,3 +194,20 @@ bool Builtin::Context::canBeRedeclared(unsigned ID) const {
- (!hasReferenceArgsOrResult(ID) &&
- !hasCustomTypechecking(ID));
- }
-+
-+bool Builtin::Context::OclBuiltinIsSupported(
-+ const Builtin::Info &BuiltinInfo, const LangOptions &LangOpts) const {
-+ if (!requiresFeatures(BuiltinInfo))
-+ return true;
-+
-+ return llvm::StringSwitch<bool>(BuiltinInfo.Features)
-+ .Case("__opencl_c_device_enqueue", LangOpts.Blocks)
-+ .Case("__opencl_c_generic_address_space", LangOpts.OpenCLGenericKeyword)
-+ .Case("__opencl_c_pipes", LangOpts.OpenCLPipeKeyword)
-+ .Default(false);
-+}
-+
-+bool Builtin::Context::requiresFeatures(
-+ const Builtin::Info &BuiltinInfo) const {
-+ return BuiltinInfo.Features && llvm::StringRef(BuiltinInfo.Features) != "";
-+}
-diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
-index 3a21a19e1f19..795311d5934e 100644
---- a/clang/lib/Basic/TargetInfo.cpp
-+++ b/clang/lib/Basic/TargetInfo.cpp
-@@ -377,6 +377,17 @@ void TargetInfo::adjust(LangOptions &Opts) {
- HalfFormat = &llvm::APFloat::IEEEhalf();
- FloatFormat = &llvm::APFloat::IEEEsingle();
- LongDoubleFormat = &llvm::APFloat::IEEEquad();
-+
-+ auto &SupportedOCLOpts = getTargetOpts().SupportedOpenCLOptions;
-+
-+ SupportedOCLOpts.setOpenCLVersion(Opts);
-+ SupportedOCLOpts.adjustFeatures();
-+
-+ if (!Opts.OpenCLCPlusPlus && Opts.OpenCLVersion >= 200)
-+ Opts.Blocks = SupportedOCLOpts.isSupported("__opencl_c_device_enqueue");
-+ Opts.OpenCLGenericKeyword =
-+ SupportedOCLOpts.isSupported("__opencl_c_generic_address_space");
-+ Opts.OpenCLPipeKeyword = SupportedOCLOpts.isSupported("__opencl_c_pipes");
- }
-
- if (Opts.LongDoubleSize) {
-diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
-index c063f8ca4472..b394be18a234 100644
---- a/clang/lib/Basic/Targets.cpp
-+++ b/clang/lib/Basic/Targets.cpp
-@@ -39,7 +39,6 @@
- #include "clang/Basic/Diagnostic.h"
- #include "llvm/ADT/StringExtras.h"
- #include "llvm/ADT/Triple.h"
--
- using namespace clang;
-
- namespace clang {
-diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
-index 648e6d9c214a..6d839fa61abc 100644
---- a/clang/lib/CodeGen/CodeGenFunction.cpp
-+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
-@@ -2303,11 +2303,11 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc,
- std::string MissingFeature;
- if (BuiltinID) {
- SmallVector<StringRef, 1> ReqFeatures;
-- const char *FeatureList =
-- CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID);
- // Return if the builtin doesn't have any required features.
-- if (!FeatureList || StringRef(FeatureList) == "")
-+ if (!CGM.getContext().BuiltinInfo.requiresFeatures(BuiltinID))
- return;
-+ const char *FeatureList =
-+ CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID);
- StringRef(FeatureList).split(ReqFeatures, ',');
- if (!hasRequiredFeatures(ReqFeatures, CGM, FD, MissingFeature))
- CGM.getDiags().Report(Loc, diag::err_builtin_needs_feature)
-diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
-index e98a407ac42f..18fa06bf3c6d 100644
---- a/clang/lib/Frontend/CompilerInvocation.cpp
-+++ b/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -2298,6 +2298,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
- Opts.OpenCLVersion = 120;
- else if (LangStd == LangStandard::lang_opencl20)
- Opts.OpenCLVersion = 200;
-+ else if (LangStd == LangStandard::lang_opencl30)
-+ Opts.OpenCLVersion = 300;
- else if (LangStd == LangStandard::lang_openclcpp)
- Opts.OpenCLCPlusPlusVersion = 100;
-
-@@ -2498,14 +2500,15 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
- // -cl-std only applies for OpenCL language standards.
- // Override the -std option in this case.
- if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
-- LangStandard::Kind OpenCLLangStd
-- = llvm::StringSwitch<LangStandard::Kind>(A->getValue())
-- .Cases("cl", "CL", LangStandard::lang_opencl10)
-- .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
-- .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
-- .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
-- .Cases("clc++", "CLC++", LangStandard::lang_openclcpp)
-- .Default(LangStandard::lang_unspecified);
-+ LangStandard::Kind OpenCLLangStd =
-+ llvm::StringSwitch<LangStandard::Kind>(A->getValue())
-+ .Cases("cl", "CL", LangStandard::lang_opencl10)
-+ .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
-+ .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
-+ .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
-+ .Cases("cl3.0", "CL3.0", LangStandard::lang_opencl30)
-+ .Cases("clc++", "CLC++", LangStandard::lang_openclcpp)
-+ .Default(LangStandard::lang_unspecified);
-
- if (OpenCLLangStd == LangStandard::lang_unspecified) {
- Diags.Report(diag::err_drv_invalid_value)
-@@ -2787,8 +2790,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
-
- Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
- Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
-- Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL
-- && Opts.OpenCLVersion == 200);
-+ Opts.Blocks = Args.hasArg(OPT_fblocks);
- Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);
- Opts.Coroutines = Opts.CPlusPlus2a || Args.hasArg(OPT_fcoroutines_ts);
-
-diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
-index c273cb96d9b9..aefd208e6cd3 100644
---- a/clang/lib/Frontend/InitPreprocessor.cpp
-+++ b/clang/lib/Frontend/InitPreprocessor.cpp
-@@ -445,6 +445,9 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
- case 200:
- Builder.defineMacro("__OPENCL_C_VERSION__", "200");
- break;
-+ case 300:
-+ Builder.defineMacro("__OPENCL_C_VERSION__", "300");
-+ break;
- default:
- llvm_unreachable("Unsupported OpenCL version");
- }
-@@ -453,6 +456,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
- Builder.defineMacro("CL_VERSION_1_1", "110");
- Builder.defineMacro("CL_VERSION_1_2", "120");
- Builder.defineMacro("CL_VERSION_2_0", "200");
-+ Builder.defineMacro("CL_VERSION_3_0", "300");
-
- if (TI.isLittleEndian())
- Builder.defineMacro("__ENDIAN_LITTLE__");
-@@ -1101,7 +1105,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- // OpenCL definitions.
- if (LangOpts.OpenCL) {
- #define OPENCLEXT(Ext) \
-- if (TI.getSupportedOpenCLOpts().isSupported(#Ext, LangOpts)) \
-+ if (TI.getSupportedOpenCLOpts().isSupported(#Ext)) \
- Builder.defineMacro(#Ext);
- #include "clang/Basic/OpenCLExtensions.def"
-
-diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
-index 430e07d36f62..2cc688ccc3da 100644
---- a/clang/lib/Headers/opencl-c-base.h
-+++ b/clang/lib/Headers/opencl-c-base.h
-@@ -9,6 +9,59 @@
- #ifndef _OPENCL_BASE_H_
- #define _OPENCL_BASE_H_
-
-+// Add predefined macros to build headers with standalone executable
-+#ifndef CL_VERSION_3_0
-+ #define CL_VERSION_3_0 300
-+#endif
-+
-+// Define features for 2.0 for header backward compatibility
-+#ifndef __opencl_c_int64
-+ #define __opencl_c_int64 1
-+#endif
-+#if __OPENCL_C_VERSION__ != CL_VERSION_3_0
-+ #ifndef __opencl_c_images
-+ #define __opencl_c_images 1
-+ #endif
-+#endif
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+#ifndef __opencl_c_pipes
-+ #define __opencl_c_pipes 1
-+#endif
-+#ifndef __opencl_c_generic_address_space
-+ #define __opencl_c_generic_address_space 1
-+#endif
-+#ifndef __opencl_c_work_group_collective_functions
-+ #define __opencl_c_work_group_collective_functions 1
-+#endif
-+#ifndef __opencl_c_atomic_order_acq_rel
-+ #define __opencl_c_atomic_order_acq_rel 1
-+#endif
-+#ifndef __opencl_c_atomic_order_seq_cst
-+ #define __opencl_c_atomic_order_seq_cst 1
-+#endif
-+#ifndef __opencl_c_atomic_scope_device
-+ #define __opencl_c_atomic_scope_device 1
-+#endif
-+#ifndef __opencl_c_atomic_scope_all_devices
-+ #define __opencl_c_atomic_scope_all_devices 1
-+#endif
-+#ifndef __opencl_c_subgroups
-+ #define __opencl_c_subgroups 1
-+#endif
-+#ifndef __opencl_c_3d_image_writes
-+ #define __opencl_c_3d_image_writes 1
-+#endif
-+#ifndef __opencl_c_device_enqueue
-+ #define __opencl_c_device_enqueue 1
-+#endif
-+#ifndef __opencl_c_read_write_images
-+ #define __opencl_c_read_write_images 1
-+#endif
-+#ifndef __opencl_c_program_scope_global_variables
-+ #define __opencl_c_program_scope_global_variables 1
-+#endif
-+#endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+
- // built-in scalar data types:
-
- /**
-@@ -115,7 +168,12 @@ typedef half half4 __attribute__((ext_vector_type(4)));
- typedef half half8 __attribute__((ext_vector_type(8)));
- typedef half half16 __attribute__((ext_vector_type(16)));
- #endif
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+
-+#ifndef __opencl_c_fp64
-+ #define __opencl_c_fp64 1
-+#endif
-+
- #if __OPENCL_C_VERSION__ < CL_VERSION_1_2
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
- #endif
-@@ -281,9 +339,17 @@ typedef uint cl_mem_fence_flags;
- typedef enum memory_scope {
- memory_scope_work_item = __OPENCL_MEMORY_SCOPE_WORK_ITEM,
- memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP,
-+#ifdef __opencl_c_atomic_scope_device
- memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE,
-+#endif
-+#ifdef __opencl_c_atomic_scope_all_devices
-+ #if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+ memory_scope_all_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES,
-+ #endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
- memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES,
--#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups)
-+#endif
-+#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || \
-+ defined(__opencl_c_subgroups)
- memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP
- #endif
- } memory_scope;
-@@ -301,13 +367,14 @@ typedef enum memory_scope {
- #define ATOMIC_FLAG_INIT 0
-
- // enum values aligned with what clang uses in EmitAtomicExpr()
--typedef enum memory_order
--{
-+typedef enum memory_order {
- memory_order_relaxed = __ATOMIC_RELAXED,
- memory_order_acquire = __ATOMIC_ACQUIRE,
- memory_order_release = __ATOMIC_RELEASE,
- memory_order_acq_rel = __ATOMIC_ACQ_REL,
-+#ifdef __opencl_c_atomic_order_seq_cst
- memory_order_seq_cst = __ATOMIC_SEQ_CST
-+#endif //__opencl_c_atomic_order_seq_cst
- } memory_order;
-
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
-index 3210f93cc851..93a946cec5b1 100644
---- a/clang/lib/Headers/opencl-c.h
-+++ b/clang/lib/Headers/opencl-c.h
-@@ -35,7 +35,6 @@
- #define __purefn __attribute__((pure))
- #define __cnfn __attribute__((const))
-
--
- // OpenCL v1.1/1.2/2.0 s6.2.3 - Explicit conversions
-
- char __ovld __cnfn convert_char_rte(char);
-@@ -4632,7 +4631,7 @@ float16 __ovld __cnfn convert_float16(float16);
-
- // Conversions with double data type parameters or return value.
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- char __ovld __cnfn convert_char(double);
- char __ovld __cnfn convert_char_rte(double);
- char __ovld __cnfn convert_char_rtn(double);
-@@ -5452,7 +5451,7 @@ double16 __ovld __cnfn convert_double16_rtz(uchar16);
- double16 __ovld __cnfn convert_double16_rtz(uint16);
- double16 __ovld __cnfn convert_double16_rtz(ulong16);
- double16 __ovld __cnfn convert_double16_rtz(ushort16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- // Convert half types to non-double types.
-@@ -6270,7 +6269,7 @@ half16 __ovld __cnfn convert_half16_rtz(float16);
- half16 __ovld __cnfn convert_half16_rtz(half16);
-
- // Convert half types to double types.
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn convert_double(half);
- double __ovld __cnfn convert_double_rte(half);
- double __ovld __cnfn convert_double_rtp(half);
-@@ -6333,7 +6332,7 @@ half16 __ovld __cnfn convert_half16_rte(double16);
- half16 __ovld __cnfn convert_half16_rtp(double16);
- half16 __ovld __cnfn convert_half16_rtn(double16);
- half16 __ovld __cnfn convert_half16_rtz(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #endif // cl_khr_fp16
-
-@@ -6404,14 +6403,14 @@ half16 __ovld __cnfn convert_half16_rtz(double16);
- #define as_float8(x) __builtin_astype((x), float8)
- #define as_float16(x) __builtin_astype((x), float16)
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #define as_double(x) __builtin_astype((x), double)
- #define as_double2(x) __builtin_astype((x), double2)
- #define as_double3(x) __builtin_astype((x), double3)
- #define as_double4(x) __builtin_astype((x), double4)
- #define as_double8(x) __builtin_astype((x), double8)
- #define as_double16(x) __builtin_astype((x), double16)
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- #define as_half(x) __builtin_astype((x), half)
-@@ -6534,14 +6533,14 @@ float3 __ovld __cnfn acos(float3);
- float4 __ovld __cnfn acos(float4);
- float8 __ovld __cnfn acos(float8);
- float16 __ovld __cnfn acos(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acos(double);
- double2 __ovld __cnfn acos(double2);
- double3 __ovld __cnfn acos(double3);
- double4 __ovld __cnfn acos(double4);
- double8 __ovld __cnfn acos(double8);
- double16 __ovld __cnfn acos(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acos(half);
- half2 __ovld __cnfn acos(half2);
-@@ -6560,14 +6559,14 @@ float3 __ovld __cnfn acosh(float3);
- float4 __ovld __cnfn acosh(float4);
- float8 __ovld __cnfn acosh(float8);
- float16 __ovld __cnfn acosh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acosh(double);
- double2 __ovld __cnfn acosh(double2);
- double3 __ovld __cnfn acosh(double3);
- double4 __ovld __cnfn acosh(double4);
- double8 __ovld __cnfn acosh(double8);
- double16 __ovld __cnfn acosh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acosh(half);
- half2 __ovld __cnfn acosh(half2);
-@@ -6586,14 +6585,14 @@ float3 __ovld __cnfn acospi(float3 x);
- float4 __ovld __cnfn acospi(float4 x);
- float8 __ovld __cnfn acospi(float8 x);
- float16 __ovld __cnfn acospi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acospi(double x);
- double2 __ovld __cnfn acospi(double2 x);
- double3 __ovld __cnfn acospi(double3 x);
- double4 __ovld __cnfn acospi(double4 x);
- double8 __ovld __cnfn acospi(double8 x);
- double16 __ovld __cnfn acospi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acospi(half x);
- half2 __ovld __cnfn acospi(half2 x);
-@@ -6612,14 +6611,14 @@ float3 __ovld __cnfn asin(float3);
- float4 __ovld __cnfn asin(float4);
- float8 __ovld __cnfn asin(float8);
- float16 __ovld __cnfn asin(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asin(double);
- double2 __ovld __cnfn asin(double2);
- double3 __ovld __cnfn asin(double3);
- double4 __ovld __cnfn asin(double4);
- double8 __ovld __cnfn asin(double8);
- double16 __ovld __cnfn asin(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asin(half);
- half2 __ovld __cnfn asin(half2);
-@@ -6638,14 +6637,14 @@ float3 __ovld __cnfn asinh(float3);
- float4 __ovld __cnfn asinh(float4);
- float8 __ovld __cnfn asinh(float8);
- float16 __ovld __cnfn asinh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asinh(double);
- double2 __ovld __cnfn asinh(double2);
- double3 __ovld __cnfn asinh(double3);
- double4 __ovld __cnfn asinh(double4);
- double8 __ovld __cnfn asinh(double8);
- double16 __ovld __cnfn asinh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asinh(half);
- half2 __ovld __cnfn asinh(half2);
-@@ -6664,14 +6663,14 @@ float3 __ovld __cnfn asinpi(float3 x);
- float4 __ovld __cnfn asinpi(float4 x);
- float8 __ovld __cnfn asinpi(float8 x);
- float16 __ovld __cnfn asinpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asinpi(double x);
- double2 __ovld __cnfn asinpi(double2 x);
- double3 __ovld __cnfn asinpi(double3 x);
- double4 __ovld __cnfn asinpi(double4 x);
- double8 __ovld __cnfn asinpi(double8 x);
- double16 __ovld __cnfn asinpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asinpi(half x);
- half2 __ovld __cnfn asinpi(half2 x);
-@@ -6690,14 +6689,14 @@ float3 __ovld __cnfn atan(float3 y_over_x);
- float4 __ovld __cnfn atan(float4 y_over_x);
- float8 __ovld __cnfn atan(float8 y_over_x);
- float16 __ovld __cnfn atan(float16 y_over_x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan(double y_over_x);
- double2 __ovld __cnfn atan(double2 y_over_x);
- double3 __ovld __cnfn atan(double3 y_over_x);
- double4 __ovld __cnfn atan(double4 y_over_x);
- double8 __ovld __cnfn atan(double8 y_over_x);
- double16 __ovld __cnfn atan(double16 y_over_x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan(half y_over_x);
- half2 __ovld __cnfn atan(half2 y_over_x);
-@@ -6716,14 +6715,14 @@ float3 __ovld __cnfn atan2(float3 y, float3 x);
- float4 __ovld __cnfn atan2(float4 y, float4 x);
- float8 __ovld __cnfn atan2(float8 y, float8 x);
- float16 __ovld __cnfn atan2(float16 y, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan2(double y, double x);
- double2 __ovld __cnfn atan2(double2 y, double2 x);
- double3 __ovld __cnfn atan2(double3 y, double3 x);
- double4 __ovld __cnfn atan2(double4 y, double4 x);
- double8 __ovld __cnfn atan2(double8 y, double8 x);
- double16 __ovld __cnfn atan2(double16 y, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan2(half y, half x);
- half2 __ovld __cnfn atan2(half2 y, half2 x);
-@@ -6742,14 +6741,14 @@ float3 __ovld __cnfn atanh(float3);
- float4 __ovld __cnfn atanh(float4);
- float8 __ovld __cnfn atanh(float8);
- float16 __ovld __cnfn atanh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atanh(double);
- double2 __ovld __cnfn atanh(double2);
- double3 __ovld __cnfn atanh(double3);
- double4 __ovld __cnfn atanh(double4);
- double8 __ovld __cnfn atanh(double8);
- double16 __ovld __cnfn atanh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atanh(half);
- half2 __ovld __cnfn atanh(half2);
-@@ -6768,14 +6767,14 @@ float3 __ovld __cnfn atanpi(float3 x);
- float4 __ovld __cnfn atanpi(float4 x);
- float8 __ovld __cnfn atanpi(float8 x);
- float16 __ovld __cnfn atanpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atanpi(double x);
- double2 __ovld __cnfn atanpi(double2 x);
- double3 __ovld __cnfn atanpi(double3 x);
- double4 __ovld __cnfn atanpi(double4 x);
- double8 __ovld __cnfn atanpi(double8 x);
- double16 __ovld __cnfn atanpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atanpi(half x);
- half2 __ovld __cnfn atanpi(half2 x);
-@@ -6794,14 +6793,14 @@ float3 __ovld __cnfn atan2pi(float3 y, float3 x);
- float4 __ovld __cnfn atan2pi(float4 y, float4 x);
- float8 __ovld __cnfn atan2pi(float8 y, float8 x);
- float16 __ovld __cnfn atan2pi(float16 y, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan2pi(double y, double x);
- double2 __ovld __cnfn atan2pi(double2 y, double2 x);
- double3 __ovld __cnfn atan2pi(double3 y, double3 x);
- double4 __ovld __cnfn atan2pi(double4 y, double4 x);
- double8 __ovld __cnfn atan2pi(double8 y, double8 x);
- double16 __ovld __cnfn atan2pi(double16 y, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan2pi(half y, half x);
- half2 __ovld __cnfn atan2pi(half2 y, half2 x);
-@@ -6820,14 +6819,14 @@ float3 __ovld __cnfn cbrt(float3);
- float4 __ovld __cnfn cbrt(float4);
- float8 __ovld __cnfn cbrt(float8);
- float16 __ovld __cnfn cbrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cbrt(double);
- double2 __ovld __cnfn cbrt(double2);
- double3 __ovld __cnfn cbrt(double3);
- double4 __ovld __cnfn cbrt(double4);
- double8 __ovld __cnfn cbrt(double8);
- double16 __ovld __cnfn cbrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cbrt(half);
- half2 __ovld __cnfn cbrt(half2);
-@@ -6847,14 +6846,14 @@ float3 __ovld __cnfn ceil(float3);
- float4 __ovld __cnfn ceil(float4);
- float8 __ovld __cnfn ceil(float8);
- float16 __ovld __cnfn ceil(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn ceil(double);
- double2 __ovld __cnfn ceil(double2);
- double3 __ovld __cnfn ceil(double3);
- double4 __ovld __cnfn ceil(double4);
- double8 __ovld __cnfn ceil(double8);
- double16 __ovld __cnfn ceil(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn ceil(half);
- half2 __ovld __cnfn ceil(half2);
-@@ -6873,14 +6872,14 @@ float3 __ovld __cnfn copysign(float3 x, float3 y);
- float4 __ovld __cnfn copysign(float4 x, float4 y);
- float8 __ovld __cnfn copysign(float8 x, float8 y);
- float16 __ovld __cnfn copysign(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn copysign(double x, double y);
- double2 __ovld __cnfn copysign(double2 x, double2 y);
- double3 __ovld __cnfn copysign(double3 x, double3 y);
- double4 __ovld __cnfn copysign(double4 x, double4 y);
- double8 __ovld __cnfn copysign(double8 x, double8 y);
- double16 __ovld __cnfn copysign(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn copysign(half x, half y);
- half2 __ovld __cnfn copysign(half2 x, half2 y);
-@@ -6899,14 +6898,14 @@ float3 __ovld __cnfn cos(float3);
- float4 __ovld __cnfn cos(float4);
- float8 __ovld __cnfn cos(float8);
- float16 __ovld __cnfn cos(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cos(double);
- double2 __ovld __cnfn cos(double2);
- double3 __ovld __cnfn cos(double3);
- double4 __ovld __cnfn cos(double4);
- double8 __ovld __cnfn cos(double8);
- double16 __ovld __cnfn cos(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cos(half);
- half2 __ovld __cnfn cos(half2);
-@@ -6925,14 +6924,14 @@ float3 __ovld __cnfn cosh(float3);
- float4 __ovld __cnfn cosh(float4);
- float8 __ovld __cnfn cosh(float8);
- float16 __ovld __cnfn cosh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cosh(double);
- double2 __ovld __cnfn cosh(double2);
- double3 __ovld __cnfn cosh(double3);
- double4 __ovld __cnfn cosh(double4);
- double8 __ovld __cnfn cosh(double8);
- double16 __ovld __cnfn cosh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cosh(half);
- half2 __ovld __cnfn cosh(half2);
-@@ -6951,14 +6950,14 @@ float3 __ovld __cnfn cospi(float3 x);
- float4 __ovld __cnfn cospi(float4 x);
- float8 __ovld __cnfn cospi(float8 x);
- float16 __ovld __cnfn cospi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cospi(double x);
- double2 __ovld __cnfn cospi(double2 x);
- double3 __ovld __cnfn cospi(double3 x);
- double4 __ovld __cnfn cospi(double4 x);
- double8 __ovld __cnfn cospi(double8 x);
- double16 __ovld __cnfn cospi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cospi(half x);
- half2 __ovld __cnfn cospi(half2 x);
-@@ -6977,14 +6976,14 @@ float3 __ovld __cnfn erfc(float3);
- float4 __ovld __cnfn erfc(float4);
- float8 __ovld __cnfn erfc(float8);
- float16 __ovld __cnfn erfc(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn erfc(double);
- double2 __ovld __cnfn erfc(double2);
- double3 __ovld __cnfn erfc(double3);
- double4 __ovld __cnfn erfc(double4);
- double8 __ovld __cnfn erfc(double8);
- double16 __ovld __cnfn erfc(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn erfc(half);
- half2 __ovld __cnfn erfc(half2);
-@@ -7004,14 +7003,14 @@ float3 __ovld __cnfn erf(float3);
- float4 __ovld __cnfn erf(float4);
- float8 __ovld __cnfn erf(float8);
- float16 __ovld __cnfn erf(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn erf(double);
- double2 __ovld __cnfn erf(double2);
- double3 __ovld __cnfn erf(double3);
- double4 __ovld __cnfn erf(double4);
- double8 __ovld __cnfn erf(double8);
- double16 __ovld __cnfn erf(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn erf(half);
- half2 __ovld __cnfn erf(half2);
-@@ -7030,14 +7029,14 @@ float3 __ovld __cnfn exp(float3 x);
- float4 __ovld __cnfn exp(float4 x);
- float8 __ovld __cnfn exp(float8 x);
- float16 __ovld __cnfn exp(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp(double x);
- double2 __ovld __cnfn exp(double2 x);
- double3 __ovld __cnfn exp(double3 x);
- double4 __ovld __cnfn exp(double4 x);
- double8 __ovld __cnfn exp(double8 x);
- double16 __ovld __cnfn exp(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp(half x);
- half2 __ovld __cnfn exp(half2 x);
-@@ -7056,14 +7055,14 @@ float3 __ovld __cnfn exp2(float3);
- float4 __ovld __cnfn exp2(float4);
- float8 __ovld __cnfn exp2(float8);
- float16 __ovld __cnfn exp2(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp2(double);
- double2 __ovld __cnfn exp2(double2);
- double3 __ovld __cnfn exp2(double3);
- double4 __ovld __cnfn exp2(double4);
- double8 __ovld __cnfn exp2(double8);
- double16 __ovld __cnfn exp2(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp2(half);
- half2 __ovld __cnfn exp2(half2);
-@@ -7082,14 +7081,14 @@ float3 __ovld __cnfn exp10(float3);
- float4 __ovld __cnfn exp10(float4);
- float8 __ovld __cnfn exp10(float8);
- float16 __ovld __cnfn exp10(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp10(double);
- double2 __ovld __cnfn exp10(double2);
- double3 __ovld __cnfn exp10(double3);
- double4 __ovld __cnfn exp10(double4);
- double8 __ovld __cnfn exp10(double8);
- double16 __ovld __cnfn exp10(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp10(half);
- half2 __ovld __cnfn exp10(half2);
-@@ -7108,14 +7107,14 @@ float3 __ovld __cnfn expm1(float3 x);
- float4 __ovld __cnfn expm1(float4 x);
- float8 __ovld __cnfn expm1(float8 x);
- float16 __ovld __cnfn expm1(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn expm1(double x);
- double2 __ovld __cnfn expm1(double2 x);
- double3 __ovld __cnfn expm1(double3 x);
- double4 __ovld __cnfn expm1(double4 x);
- double8 __ovld __cnfn expm1(double8 x);
- double16 __ovld __cnfn expm1(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn expm1(half x);
- half2 __ovld __cnfn expm1(half2 x);
-@@ -7134,14 +7133,14 @@ float3 __ovld __cnfn fabs(float3);
- float4 __ovld __cnfn fabs(float4);
- float8 __ovld __cnfn fabs(float8);
- float16 __ovld __cnfn fabs(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fabs(double);
- double2 __ovld __cnfn fabs(double2);
- double3 __ovld __cnfn fabs(double3);
- double4 __ovld __cnfn fabs(double4);
- double8 __ovld __cnfn fabs(double8);
- double16 __ovld __cnfn fabs(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fabs(half);
- half2 __ovld __cnfn fabs(half2);
-@@ -7160,14 +7159,14 @@ float3 __ovld __cnfn fdim(float3 x, float3 y);
- float4 __ovld __cnfn fdim(float4 x, float4 y);
- float8 __ovld __cnfn fdim(float8 x, float8 y);
- float16 __ovld __cnfn fdim(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fdim(double x, double y);
- double2 __ovld __cnfn fdim(double2 x, double2 y);
- double3 __ovld __cnfn fdim(double3 x, double3 y);
- double4 __ovld __cnfn fdim(double4 x, double4 y);
- double8 __ovld __cnfn fdim(double8 x, double8 y);
- double16 __ovld __cnfn fdim(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fdim(half x, half y);
- half2 __ovld __cnfn fdim(half2 x, half2 y);
-@@ -7187,14 +7186,14 @@ float3 __ovld __cnfn floor(float3);
- float4 __ovld __cnfn floor(float4);
- float8 __ovld __cnfn floor(float8);
- float16 __ovld __cnfn floor(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn floor(double);
- double2 __ovld __cnfn floor(double2);
- double3 __ovld __cnfn floor(double3);
- double4 __ovld __cnfn floor(double4);
- double8 __ovld __cnfn floor(double8);
- double16 __ovld __cnfn floor(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn floor(half);
- half2 __ovld __cnfn floor(half2);
-@@ -7217,14 +7216,14 @@ float3 __ovld __cnfn fma(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn fma(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn fma(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn fma(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fma(double a, double b, double c);
- double2 __ovld __cnfn fma(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn fma(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn fma(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn fma(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn fma(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fma(half a, half b, half c);
- half2 __ovld __cnfn fma(half2 a, half2 b, half2 c);
-@@ -7251,7 +7250,7 @@ float3 __ovld __cnfn fmax(float3 x, float y);
- float4 __ovld __cnfn fmax(float4 x, float y);
- float8 __ovld __cnfn fmax(float8 x, float y);
- float16 __ovld __cnfn fmax(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmax(double x, double y);
- double2 __ovld __cnfn fmax(double2 x, double2 y);
- double3 __ovld __cnfn fmax(double3 x, double3 y);
-@@ -7263,7 +7262,7 @@ double3 __ovld __cnfn fmax(double3 x, double y);
- double4 __ovld __cnfn fmax(double4 x, double y);
- double8 __ovld __cnfn fmax(double8 x, double y);
- double16 __ovld __cnfn fmax(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmax(half x, half y);
- half2 __ovld __cnfn fmax(half2 x, half2 y);
-@@ -7295,7 +7294,7 @@ float3 __ovld __cnfn fmin(float3 x, float y);
- float4 __ovld __cnfn fmin(float4 x, float y);
- float8 __ovld __cnfn fmin(float8 x, float y);
- float16 __ovld __cnfn fmin(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmin(double x, double y);
- double2 __ovld __cnfn fmin(double2 x, double2 y);
- double3 __ovld __cnfn fmin(double3 x, double3 y);
-@@ -7307,7 +7306,7 @@ double3 __ovld __cnfn fmin(double3 x, double y);
- double4 __ovld __cnfn fmin(double4 x, double y);
- double8 __ovld __cnfn fmin(double8 x, double y);
- double16 __ovld __cnfn fmin(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmin(half x, half y);
- half2 __ovld __cnfn fmin(half2 x, half2 y);
-@@ -7331,14 +7330,14 @@ float3 __ovld __cnfn fmod(float3 x, float3 y);
- float4 __ovld __cnfn fmod(float4 x, float4 y);
- float8 __ovld __cnfn fmod(float8 x, float8 y);
- float16 __ovld __cnfn fmod(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmod(double x, double y);
- double2 __ovld __cnfn fmod(double2 x, double2 y);
- double3 __ovld __cnfn fmod(double3 x, double3 y);
- double4 __ovld __cnfn fmod(double4 x, double4 y);
- double8 __ovld __cnfn fmod(double8 x, double8 y);
- double16 __ovld __cnfn fmod(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmod(half x, half y);
- half2 __ovld __cnfn fmod(half2 x, half2 y);
-@@ -7352,21 +7351,21 @@ half16 __ovld __cnfn fmod(half16 x, half16 y);
- * Returns fmin(x - floor (x), 0x1.fffffep-1f ).
- * floor(x) is returned in iptr.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld fract(float x, float *iptr);
- float2 __ovld fract(float2 x, float2 *iptr);
- float3 __ovld fract(float3 x, float3 *iptr);
- float4 __ovld fract(float4 x, float4 *iptr);
- float8 __ovld fract(float8 x, float8 *iptr);
- float16 __ovld fract(float16 x, float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld fract(double x, double *iptr);
- double2 __ovld fract(double2 x, double2 *iptr);
- double3 __ovld fract(double3 x, double3 *iptr);
- double4 __ovld fract(double4 x, double4 *iptr);
- double8 __ovld fract(double8 x, double8 *iptr);
- double16 __ovld fract(double16 x, double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld fract(half x, half *iptr);
- half2 __ovld fract(half2 x, half2 *iptr);
-@@ -7375,7 +7374,9 @@ half4 __ovld fract(half4 x, half4 *iptr);
- half8 __ovld fract(half8 x, half8 *iptr);
- half16 __ovld fract(half16 x, half16 *iptr);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld fract(float x, __global float *iptr);
- float2 __ovld fract(float2 x, __global float2 *iptr);
- float3 __ovld fract(float3 x, __global float3 *iptr);
-@@ -7394,7 +7395,7 @@ float3 __ovld fract(float3 x, __private float3 *iptr);
- float4 __ovld fract(float4 x, __private float4 *iptr);
- float8 __ovld fract(float8 x, __private float8 *iptr);
- float16 __ovld fract(float16 x, __private float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld fract(double x, __global double *iptr);
- double2 __ovld fract(double2 x, __global double2 *iptr);
- double3 __ovld fract(double3 x, __global double3 *iptr);
-@@ -7413,7 +7414,7 @@ double3 __ovld fract(double3 x, __private double3 *iptr);
- double4 __ovld fract(double4 x, __private double4 *iptr);
- double8 __ovld fract(double8 x, __private double8 *iptr);
- double16 __ovld fract(double16 x, __private double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld fract(half x, __global half *iptr);
- half2 __ovld fract(half2 x, __global half2 *iptr);
-@@ -7434,29 +7435,29 @@ half4 __ovld fract(half4 x, __private half4 *iptr);
- half8 __ovld fract(half8 x, __private half8 *iptr);
- half16 __ovld fract(half16 x, __private half16 *iptr);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Extract mantissa and exponent from x. For each
- * component the mantissa returned is a float with
- * magnitude in the interval [1/2, 1) or 0. Each
- * component of x equals mantissa returned * 2^exp.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld frexp(float x, int *exp);
- float2 __ovld frexp(float2 x, int2 *exp);
- float3 __ovld frexp(float3 x, int3 *exp);
- float4 __ovld frexp(float4 x, int4 *exp);
- float8 __ovld frexp(float8 x, int8 *exp);
- float16 __ovld frexp(float16 x, int16 *exp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld frexp(double x, int *exp);
- double2 __ovld frexp(double2 x, int2 *exp);
- double3 __ovld frexp(double3 x, int3 *exp);
- double4 __ovld frexp(double4 x, int4 *exp);
- double8 __ovld frexp(double8 x, int8 *exp);
- double16 __ovld frexp(double16 x, int16 *exp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld frexp(half x, int *exp);
- half2 __ovld frexp(half2 x, int2 *exp);
-@@ -7465,7 +7466,9 @@ half4 __ovld frexp(half4 x, int4 *exp);
- half8 __ovld frexp(half8 x, int8 *exp);
- half16 __ovld frexp(half16 x, int16 *exp);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld frexp(float x, __global int *exp);
- float2 __ovld frexp(float2 x, __global int2 *exp);
- float3 __ovld frexp(float3 x, __global int3 *exp);
-@@ -7484,7 +7487,7 @@ float3 __ovld frexp(float3 x, __private int3 *exp);
- float4 __ovld frexp(float4 x, __private int4 *exp);
- float8 __ovld frexp(float8 x, __private int8 *exp);
- float16 __ovld frexp(float16 x, __private int16 *exp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld frexp(double x, __global int *exp);
- double2 __ovld frexp(double2 x, __global int2 *exp);
- double3 __ovld frexp(double3 x, __global int3 *exp);
-@@ -7503,7 +7506,7 @@ double3 __ovld frexp(double3 x, __private int3 *exp);
- double4 __ovld frexp(double4 x, __private int4 *exp);
- double8 __ovld frexp(double8 x, __private int8 *exp);
- double16 __ovld frexp(double16 x, __private int16 *exp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld frexp(half x, __global int *exp);
- half2 __ovld frexp(half2 x, __global int2 *exp);
-@@ -7524,7 +7527,8 @@ half4 __ovld frexp(half4 x, __private int4 *exp);
- half8 __ovld frexp(half8 x, __private int8 *exp);
- half16 __ovld frexp(half16 x, __private int16 *exp);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
-
- /**
- * Compute the value of the square root of x^2 + y^2
-@@ -7536,14 +7540,14 @@ float3 __ovld __cnfn hypot(float3 x, float3 y);
- float4 __ovld __cnfn hypot(float4 x, float4 y);
- float8 __ovld __cnfn hypot(float8 x, float8 y);
- float16 __ovld __cnfn hypot(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn hypot(double x, double y);
- double2 __ovld __cnfn hypot(double2 x, double2 y);
- double3 __ovld __cnfn hypot(double3 x, double3 y);
- double4 __ovld __cnfn hypot(double4 x, double4 y);
- double8 __ovld __cnfn hypot(double8 x, double8 y);
- double16 __ovld __cnfn hypot(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn hypot(half x, half y);
- half2 __ovld __cnfn hypot(half2 x, half2 y);
-@@ -7562,14 +7566,14 @@ int3 __ovld __cnfn ilogb(float3 x);
- int4 __ovld __cnfn ilogb(float4 x);
- int8 __ovld __cnfn ilogb(float8 x);
- int16 __ovld __cnfn ilogb(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn ilogb(double x);
- int2 __ovld __cnfn ilogb(double2 x);
- int3 __ovld __cnfn ilogb(double3 x);
- int4 __ovld __cnfn ilogb(double4 x);
- int8 __ovld __cnfn ilogb(double8 x);
- int16 __ovld __cnfn ilogb(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn ilogb(half x);
- int2 __ovld __cnfn ilogb(half2 x);
-@@ -7593,7 +7597,7 @@ float3 __ovld __cnfn ldexp(float3 x, int n);
- float4 __ovld __cnfn ldexp(float4 x, int n);
- float8 __ovld __cnfn ldexp(float8 x, int n);
- float16 __ovld __cnfn ldexp(float16 x, int n);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn ldexp(double x, int n);
- double2 __ovld __cnfn ldexp(double2 x, int2 n);
- double3 __ovld __cnfn ldexp(double3 x, int3 n);
-@@ -7605,7 +7609,7 @@ double3 __ovld __cnfn ldexp(double3 x, int n);
- double4 __ovld __cnfn ldexp(double4 x, int n);
- double8 __ovld __cnfn ldexp(double8 x, int n);
- double16 __ovld __cnfn ldexp(double16 x, int n);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn ldexp(half x, int n);
- half2 __ovld __cnfn ldexp(half2 x, int2 n);
-@@ -7632,14 +7636,14 @@ float3 __ovld __cnfn lgamma(float3 x);
- float4 __ovld __cnfn lgamma(float4 x);
- float8 __ovld __cnfn lgamma(float8 x);
- float16 __ovld __cnfn lgamma(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn lgamma(double x);
- double2 __ovld __cnfn lgamma(double2 x);
- double3 __ovld __cnfn lgamma(double3 x);
- double4 __ovld __cnfn lgamma(double4 x);
- double8 __ovld __cnfn lgamma(double8 x);
- double16 __ovld __cnfn lgamma(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn lgamma(half x);
- half2 __ovld __cnfn lgamma(half2 x);
-@@ -7649,21 +7653,21 @@ half8 __ovld __cnfn lgamma(half8 x);
- half16 __ovld __cnfn lgamma(half16 x);
- #endif //cl_khr_fp16
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld lgamma_r(float x, int *signp);
- float2 __ovld lgamma_r(float2 x, int2 *signp);
- float3 __ovld lgamma_r(float3 x, int3 *signp);
- float4 __ovld lgamma_r(float4 x, int4 *signp);
- float8 __ovld lgamma_r(float8 x, int8 *signp);
- float16 __ovld lgamma_r(float16 x, int16 *signp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld lgamma_r(double x, int *signp);
- double2 __ovld lgamma_r(double2 x, int2 *signp);
- double3 __ovld lgamma_r(double3 x, int3 *signp);
- double4 __ovld lgamma_r(double4 x, int4 *signp);
- double8 __ovld lgamma_r(double8 x, int8 *signp);
- double16 __ovld lgamma_r(double16 x, int16 *signp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld lgamma_r(half x, int *signp);
- half2 __ovld lgamma_r(half2 x, int2 *signp);
-@@ -7672,7 +7676,9 @@ half4 __ovld lgamma_r(half4 x, int4 *signp);
- half8 __ovld lgamma_r(half8 x, int8 *signp);
- half16 __ovld lgamma_r(half16 x, int16 *signp);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld lgamma_r(float x, __global int *signp);
- float2 __ovld lgamma_r(float2 x, __global int2 *signp);
- float3 __ovld lgamma_r(float3 x, __global int3 *signp);
-@@ -7691,7 +7697,7 @@ float3 __ovld lgamma_r(float3 x, __private int3 *signp);
- float4 __ovld lgamma_r(float4 x, __private int4 *signp);
- float8 __ovld lgamma_r(float8 x, __private int8 *signp);
- float16 __ovld lgamma_r(float16 x, __private int16 *signp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld lgamma_r(double x, __global int *signp);
- double2 __ovld lgamma_r(double2 x, __global int2 *signp);
- double3 __ovld lgamma_r(double3 x, __global int3 *signp);
-@@ -7710,7 +7716,7 @@ double3 __ovld lgamma_r(double3 x, __private int3 *signp);
- double4 __ovld lgamma_r(double4 x, __private int4 *signp);
- double8 __ovld lgamma_r(double8 x, __private int8 *signp);
- double16 __ovld lgamma_r(double16 x, __private int16 *signp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld lgamma_r(half x, __global int *signp);
- half2 __ovld lgamma_r(half2 x, __global int2 *signp);
-@@ -7731,8 +7737,8 @@ half4 __ovld lgamma_r(half4 x, __private int4 *signp);
- half8 __ovld lgamma_r(half8 x, __private int8 *signp);
- half16 __ovld lgamma_r(half16 x, __private int16 *signp);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Compute natural logarithm.
- */
-@@ -7742,14 +7748,14 @@ float3 __ovld __cnfn log(float3);
- float4 __ovld __cnfn log(float4);
- float8 __ovld __cnfn log(float8);
- float16 __ovld __cnfn log(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log(double);
- double2 __ovld __cnfn log(double2);
- double3 __ovld __cnfn log(double3);
- double4 __ovld __cnfn log(double4);
- double8 __ovld __cnfn log(double8);
- double16 __ovld __cnfn log(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log(half);
- half2 __ovld __cnfn log(half2);
-@@ -7760,7 +7766,7 @@ half16 __ovld __cnfn log(half16);
- #endif //cl_khr_fp16
-
- /**
-- * Compute a base 2 logarithm.
-+ * Compute a base 2 logarithm
- */
- float __ovld __cnfn log2(float);
- float2 __ovld __cnfn log2(float2);
-@@ -7768,14 +7774,14 @@ float3 __ovld __cnfn log2(float3);
- float4 __ovld __cnfn log2(float4);
- float8 __ovld __cnfn log2(float8);
- float16 __ovld __cnfn log2(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log2(double);
- double2 __ovld __cnfn log2(double2);
- double3 __ovld __cnfn log2(double3);
- double4 __ovld __cnfn log2(double4);
- double8 __ovld __cnfn log2(double8);
- double16 __ovld __cnfn log2(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log2(half);
- half2 __ovld __cnfn log2(half2);
-@@ -7794,14 +7800,14 @@ float3 __ovld __cnfn log10(float3);
- float4 __ovld __cnfn log10(float4);
- float8 __ovld __cnfn log10(float8);
- float16 __ovld __cnfn log10(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log10(double);
- double2 __ovld __cnfn log10(double2);
- double3 __ovld __cnfn log10(double3);
- double4 __ovld __cnfn log10(double4);
- double8 __ovld __cnfn log10(double8);
- double16 __ovld __cnfn log10(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log10(half);
- half2 __ovld __cnfn log10(half2);
-@@ -7820,14 +7826,14 @@ float3 __ovld __cnfn log1p(float3 x);
- float4 __ovld __cnfn log1p(float4 x);
- float8 __ovld __cnfn log1p(float8 x);
- float16 __ovld __cnfn log1p(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log1p(double x);
- double2 __ovld __cnfn log1p(double2 x);
- double3 __ovld __cnfn log1p(double3 x);
- double4 __ovld __cnfn log1p(double4 x);
- double8 __ovld __cnfn log1p(double8 x);
- double16 __ovld __cnfn log1p(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log1p(half x);
- half2 __ovld __cnfn log1p(half2 x);
-@@ -7847,14 +7853,14 @@ float3 __ovld __cnfn logb(float3 x);
- float4 __ovld __cnfn logb(float4 x);
- float8 __ovld __cnfn logb(float8 x);
- float16 __ovld __cnfn logb(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn logb(double x);
- double2 __ovld __cnfn logb(double2 x);
- double3 __ovld __cnfn logb(double3 x);
- double4 __ovld __cnfn logb(double4 x);
- double8 __ovld __cnfn logb(double8 x);
- double16 __ovld __cnfn logb(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn logb(half x);
- half2 __ovld __cnfn logb(half2 x);
-@@ -7877,14 +7883,14 @@ float3 __ovld __cnfn mad(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn mad(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn mad(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn mad(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn mad(double a, double b, double c);
- double2 __ovld __cnfn mad(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn mad(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn mad(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn mad(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn mad(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn mad(half a, half b, half c);
- half2 __ovld __cnfn mad(half2 a, half2 b, half2 c);
-@@ -7904,14 +7910,14 @@ float3 __ovld __cnfn maxmag(float3 x, float3 y);
- float4 __ovld __cnfn maxmag(float4 x, float4 y);
- float8 __ovld __cnfn maxmag(float8 x, float8 y);
- float16 __ovld __cnfn maxmag(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn maxmag(double x, double y);
- double2 __ovld __cnfn maxmag(double2 x, double2 y);
- double3 __ovld __cnfn maxmag(double3 x, double3 y);
- double4 __ovld __cnfn maxmag(double4 x, double4 y);
- double8 __ovld __cnfn maxmag(double8 x, double8 y);
- double16 __ovld __cnfn maxmag(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn maxmag(half x, half y);
- half2 __ovld __cnfn maxmag(half2 x, half2 y);
-@@ -7931,14 +7937,14 @@ float3 __ovld __cnfn minmag(float3 x, float3 y);
- float4 __ovld __cnfn minmag(float4 x, float4 y);
- float8 __ovld __cnfn minmag(float8 x, float8 y);
- float16 __ovld __cnfn minmag(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn minmag(double x, double y);
- double2 __ovld __cnfn minmag(double2 x, double2 y);
- double3 __ovld __cnfn minmag(double3 x, double3 y);
- double4 __ovld __cnfn minmag(double4 x, double4 y);
- double8 __ovld __cnfn minmag(double8 x, double8 y);
- double16 __ovld __cnfn minmag(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn minmag(half x, half y);
- half2 __ovld __cnfn minmag(half2 x, half2 y);
-@@ -7955,21 +7961,21 @@ half16 __ovld __cnfn minmag(half16 x, half16 y);
- * the argument. It stores the integral part in the object
- * pointed to by iptr.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld modf(float x, float *iptr);
- float2 __ovld modf(float2 x, float2 *iptr);
- float3 __ovld modf(float3 x, float3 *iptr);
- float4 __ovld modf(float4 x, float4 *iptr);
- float8 __ovld modf(float8 x, float8 *iptr);
- float16 __ovld modf(float16 x, float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld modf(double x, double *iptr);
- double2 __ovld modf(double2 x, double2 *iptr);
- double3 __ovld modf(double3 x, double3 *iptr);
- double4 __ovld modf(double4 x, double4 *iptr);
- double8 __ovld modf(double8 x, double8 *iptr);
- double16 __ovld modf(double16 x, double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld modf(half x, half *iptr);
- half2 __ovld modf(half2 x, half2 *iptr);
-@@ -7978,7 +7984,9 @@ half4 __ovld modf(half4 x, half4 *iptr);
- half8 __ovld modf(half8 x, half8 *iptr);
- half16 __ovld modf(half16 x, half16 *iptr);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld modf(float x, __global float *iptr);
- float2 __ovld modf(float2 x, __global float2 *iptr);
- float3 __ovld modf(float3 x, __global float3 *iptr);
-@@ -7997,7 +8005,7 @@ float3 __ovld modf(float3 x, __private float3 *iptr);
- float4 __ovld modf(float4 x, __private float4 *iptr);
- float8 __ovld modf(float8 x, __private float8 *iptr);
- float16 __ovld modf(float16 x, __private float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld modf(double x, __global double *iptr);
- double2 __ovld modf(double2 x, __global double2 *iptr);
- double3 __ovld modf(double3 x, __global double3 *iptr);
-@@ -8016,7 +8024,7 @@ double3 __ovld modf(double3 x, __private double3 *iptr);
- double4 __ovld modf(double4 x, __private double4 *iptr);
- double8 __ovld modf(double8 x, __private double8 *iptr);
- double16 __ovld modf(double16 x, __private double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld modf(half x, __global half *iptr);
- half2 __ovld modf(half2 x, __global half2 *iptr);
-@@ -8037,7 +8045,8 @@ half4 __ovld modf(half4 x, __private half4 *iptr);
- half8 __ovld modf(half8 x, __private half8 *iptr);
- half16 __ovld modf(half16 x, __private half16 *iptr);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
-
- /**
- * Returns a quiet NaN. The nancode may be placed
-@@ -8049,14 +8058,14 @@ float3 __ovld __cnfn nan(uint3 nancode);
- float4 __ovld __cnfn nan(uint4 nancode);
- float8 __ovld __cnfn nan(uint8 nancode);
- float16 __ovld __cnfn nan(uint16 nancode);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn nan(ulong nancode);
- double2 __ovld __cnfn nan(ulong2 nancode);
- double3 __ovld __cnfn nan(ulong3 nancode);
- double4 __ovld __cnfn nan(ulong4 nancode);
- double8 __ovld __cnfn nan(ulong8 nancode);
- double16 __ovld __cnfn nan(ulong16 nancode);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn nan(ushort nancode);
- half2 __ovld __cnfn nan(ushort2 nancode);
-@@ -8079,14 +8088,14 @@ float3 __ovld __cnfn nextafter(float3 x, float3 y);
- float4 __ovld __cnfn nextafter(float4 x, float4 y);
- float8 __ovld __cnfn nextafter(float8 x, float8 y);
- float16 __ovld __cnfn nextafter(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn nextafter(double x, double y);
- double2 __ovld __cnfn nextafter(double2 x, double2 y);
- double3 __ovld __cnfn nextafter(double3 x, double3 y);
- double4 __ovld __cnfn nextafter(double4 x, double4 y);
- double8 __ovld __cnfn nextafter(double8 x, double8 y);
- double16 __ovld __cnfn nextafter(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn nextafter(half x, half y);
- half2 __ovld __cnfn nextafter(half2 x, half2 y);
-@@ -8105,14 +8114,14 @@ float3 __ovld __cnfn pow(float3 x, float3 y);
- float4 __ovld __cnfn pow(float4 x, float4 y);
- float8 __ovld __cnfn pow(float8 x, float8 y);
- float16 __ovld __cnfn pow(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn pow(double x, double y);
- double2 __ovld __cnfn pow(double2 x, double2 y);
- double3 __ovld __cnfn pow(double3 x, double3 y);
- double4 __ovld __cnfn pow(double4 x, double4 y);
- double8 __ovld __cnfn pow(double8 x, double8 y);
- double16 __ovld __cnfn pow(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn pow(half x, half y);
- half2 __ovld __cnfn pow(half2 x, half2 y);
-@@ -8131,14 +8140,14 @@ float3 __ovld __cnfn pown(float3 x, int3 y);
- float4 __ovld __cnfn pown(float4 x, int4 y);
- float8 __ovld __cnfn pown(float8 x, int8 y);
- float16 __ovld __cnfn pown(float16 x, int16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn pown(double x, int y);
- double2 __ovld __cnfn pown(double2 x, int2 y);
- double3 __ovld __cnfn pown(double3 x, int3 y);
- double4 __ovld __cnfn pown(double4 x, int4 y);
- double8 __ovld __cnfn pown(double8 x, int8 y);
- double16 __ovld __cnfn pown(double16 x, int16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn pown(half x, int y);
- half2 __ovld __cnfn pown(half2 x, int2 y);
-@@ -8157,14 +8166,14 @@ float3 __ovld __cnfn powr(float3 x, float3 y);
- float4 __ovld __cnfn powr(float4 x, float4 y);
- float8 __ovld __cnfn powr(float8 x, float8 y);
- float16 __ovld __cnfn powr(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn powr(double x, double y);
- double2 __ovld __cnfn powr(double2 x, double2 y);
- double3 __ovld __cnfn powr(double3 x, double3 y);
- double4 __ovld __cnfn powr(double4 x, double4 y);
- double8 __ovld __cnfn powr(double8 x, double8 y);
- double16 __ovld __cnfn powr(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn powr(half x, half y);
- half2 __ovld __cnfn powr(half2 x, half2 y);
-@@ -8186,14 +8195,14 @@ float3 __ovld __cnfn remainder(float3 x, float3 y);
- float4 __ovld __cnfn remainder(float4 x, float4 y);
- float8 __ovld __cnfn remainder(float8 x, float8 y);
- float16 __ovld __cnfn remainder(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn remainder(double x, double y);
- double2 __ovld __cnfn remainder(double2 x, double2 y);
- double3 __ovld __cnfn remainder(double3 x, double3 y);
- double4 __ovld __cnfn remainder(double4 x, double4 y);
- double8 __ovld __cnfn remainder(double8 x, double8 y);
- double16 __ovld __cnfn remainder(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn remainder(half x, half y);
- half2 __ovld __cnfn remainder(half2 x, half2 y);
-@@ -8215,21 +8224,21 @@ half16 __ovld __cnfn remainder(half16 x, half16 y);
- * sign as x/y. It stores this signed value in the object
- * pointed to by quo.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld remquo(float x, float y, int *quo);
- float2 __ovld remquo(float2 x, float2 y, int2 *quo);
- float3 __ovld remquo(float3 x, float3 y, int3 *quo);
- float4 __ovld remquo(float4 x, float4 y, int4 *quo);
- float8 __ovld remquo(float8 x, float8 y, int8 *quo);
- float16 __ovld remquo(float16 x, float16 y, int16 *quo);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld remquo(double x, double y, int *quo);
- double2 __ovld remquo(double2 x, double2 y, int2 *quo);
- double3 __ovld remquo(double3 x, double3 y, int3 *quo);
- double4 __ovld remquo(double4 x, double4 y, int4 *quo);
- double8 __ovld remquo(double8 x, double8 y, int8 *quo);
- double16 __ovld remquo(double16 x, double16 y, int16 *quo);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld remquo(half x, half y, int *quo);
- half2 __ovld remquo(half2 x, half2 y, int2 *quo);
-@@ -8237,9 +8246,10 @@ half3 __ovld remquo(half3 x, half3 y, int3 *quo);
- half4 __ovld remquo(half4 x, half4 y, int4 *quo);
- half8 __ovld remquo(half8 x, half8 y, int8 *quo);
- half16 __ovld remquo(half16 x, half16 y, int16 *quo);
--
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld remquo(float x, float y, __global int *quo);
- float2 __ovld remquo(float2 x, float2 y, __global int2 *quo);
- float3 __ovld remquo(float3 x, float3 y, __global int3 *quo);
-@@ -8258,7 +8268,7 @@ float3 __ovld remquo(float3 x, float3 y, __private int3 *quo);
- float4 __ovld remquo(float4 x, float4 y, __private int4 *quo);
- float8 __ovld remquo(float8 x, float8 y, __private int8 *quo);
- float16 __ovld remquo(float16 x, float16 y, __private int16 *quo);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld remquo(double x, double y, __global int *quo);
- double2 __ovld remquo(double2 x, double2 y, __global int2 *quo);
- double3 __ovld remquo(double3 x, double3 y, __global int3 *quo);
-@@ -8277,7 +8287,7 @@ double3 __ovld remquo(double3 x, double3 y, __private int3 *quo);
- double4 __ovld remquo(double4 x, double4 y, __private int4 *quo);
- double8 __ovld remquo(double8 x, double8 y, __private int8 *quo);
- double16 __ovld remquo(double16 x, double16 y, __private int16 *quo);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld remquo(half x, half y, __global int *quo);
- half2 __ovld remquo(half2 x, half2 y, __global int2 *quo);
-@@ -8298,7 +8308,8 @@ half4 __ovld remquo(half4 x, half4 y, __private int4 *quo);
- half8 __ovld remquo(half8 x, half8 y, __private int8 *quo);
- half16 __ovld remquo(half16 x, half16 y, __private int16 *quo);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Round to integral value (using round to nearest
- * even rounding mode) in floating-point format.
-@@ -8311,14 +8322,14 @@ float3 __ovld __cnfn rint(float3);
- float4 __ovld __cnfn rint(float4);
- float8 __ovld __cnfn rint(float8);
- float16 __ovld __cnfn rint(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rint(double);
- double2 __ovld __cnfn rint(double2);
- double3 __ovld __cnfn rint(double3);
- double4 __ovld __cnfn rint(double4);
- double8 __ovld __cnfn rint(double8);
- double16 __ovld __cnfn rint(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rint(half);
- half2 __ovld __cnfn rint(half2);
-@@ -8337,14 +8348,14 @@ float3 __ovld __cnfn rootn(float3 x, int3 y);
- float4 __ovld __cnfn rootn(float4 x, int4 y);
- float8 __ovld __cnfn rootn(float8 x, int8 y);
- float16 __ovld __cnfn rootn(float16 x, int16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rootn(double x, int y);
- double2 __ovld __cnfn rootn(double2 x, int2 y);
- double3 __ovld __cnfn rootn(double3 x, int3 y);
- double4 __ovld __cnfn rootn(double4 x, int4 y);
- double8 __ovld __cnfn rootn(double8 x, int8 y);
- double16 __ovld __cnfn rootn(double16 x, int16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rootn(half x, int y);
- half2 __ovld __cnfn rootn(half2 x, int2 y);
-@@ -8365,14 +8376,14 @@ float3 __ovld __cnfn round(float3 x);
- float4 __ovld __cnfn round(float4 x);
- float8 __ovld __cnfn round(float8 x);
- float16 __ovld __cnfn round(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn round(double x);
- double2 __ovld __cnfn round(double2 x);
- double3 __ovld __cnfn round(double3 x);
- double4 __ovld __cnfn round(double4 x);
- double8 __ovld __cnfn round(double8 x);
- double16 __ovld __cnfn round(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn round(half x);
- half2 __ovld __cnfn round(half2 x);
-@@ -8391,14 +8402,14 @@ float3 __ovld __cnfn rsqrt(float3);
- float4 __ovld __cnfn rsqrt(float4);
- float8 __ovld __cnfn rsqrt(float8);
- float16 __ovld __cnfn rsqrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rsqrt(double);
- double2 __ovld __cnfn rsqrt(double2);
- double3 __ovld __cnfn rsqrt(double3);
- double4 __ovld __cnfn rsqrt(double4);
- double8 __ovld __cnfn rsqrt(double8);
- double16 __ovld __cnfn rsqrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rsqrt(half);
- half2 __ovld __cnfn rsqrt(half2);
-@@ -8417,14 +8428,14 @@ float3 __ovld __cnfn sin(float3);
- float4 __ovld __cnfn sin(float4);
- float8 __ovld __cnfn sin(float8);
- float16 __ovld __cnfn sin(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sin(double);
- double2 __ovld __cnfn sin(double2);
- double3 __ovld __cnfn sin(double3);
- double4 __ovld __cnfn sin(double4);
- double8 __ovld __cnfn sin(double8);
- double16 __ovld __cnfn sin(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sin(half);
- half2 __ovld __cnfn sin(half2);
-@@ -8439,21 +8450,21 @@ half16 __ovld __cnfn sin(half16);
- * is the return value and computed cosine is returned
- * in cosval.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld sincos(float x, float *cosval);
- float2 __ovld sincos(float2 x, float2 *cosval);
- float3 __ovld sincos(float3 x, float3 *cosval);
- float4 __ovld sincos(float4 x, float4 *cosval);
- float8 __ovld sincos(float8 x, float8 *cosval);
- float16 __ovld sincos(float16 x, float16 *cosval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld sincos(double x, double *cosval);
- double2 __ovld sincos(double2 x, double2 *cosval);
- double3 __ovld sincos(double3 x, double3 *cosval);
- double4 __ovld sincos(double4 x, double4 *cosval);
- double8 __ovld sincos(double8 x, double8 *cosval);
- double16 __ovld sincos(double16 x, double16 *cosval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld sincos(half x, half *cosval);
- half2 __ovld sincos(half2 x, half2 *cosval);
-@@ -8462,7 +8473,9 @@ half4 __ovld sincos(half4 x, half4 *cosval);
- half8 __ovld sincos(half8 x, half8 *cosval);
- half16 __ovld sincos(half16 x, half16 *cosval);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld sincos(float x, __global float *cosval);
- float2 __ovld sincos(float2 x, __global float2 *cosval);
- float3 __ovld sincos(float3 x, __global float3 *cosval);
-@@ -8481,7 +8494,7 @@ float3 __ovld sincos(float3 x, __private float3 *cosval);
- float4 __ovld sincos(float4 x, __private float4 *cosval);
- float8 __ovld sincos(float8 x, __private float8 *cosval);
- float16 __ovld sincos(float16 x, __private float16 *cosval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld sincos(double x, __global double *cosval);
- double2 __ovld sincos(double2 x, __global double2 *cosval);
- double3 __ovld sincos(double3 x, __global double3 *cosval);
-@@ -8500,7 +8513,7 @@ double3 __ovld sincos(double3 x, __private double3 *cosval);
- double4 __ovld sincos(double4 x, __private double4 *cosval);
- double8 __ovld sincos(double8 x, __private double8 *cosval);
- double16 __ovld sincos(double16 x, __private double16 *cosval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld sincos(half x, __global half *cosval);
- half2 __ovld sincos(half2 x, __global half2 *cosval);
-@@ -8521,8 +8534,8 @@ half4 __ovld sincos(half4 x, __private half4 *cosval);
- half8 __ovld sincos(half8 x, __private half8 *cosval);
- half16 __ovld sincos(half16 x, __private half16 *cosval);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Compute hyperbolic sine.
- */
-@@ -8532,14 +8545,14 @@ float3 __ovld __cnfn sinh(float3);
- float4 __ovld __cnfn sinh(float4);
- float8 __ovld __cnfn sinh(float8);
- float16 __ovld __cnfn sinh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sinh(double);
- double2 __ovld __cnfn sinh(double2);
- double3 __ovld __cnfn sinh(double3);
- double4 __ovld __cnfn sinh(double4);
- double8 __ovld __cnfn sinh(double8);
- double16 __ovld __cnfn sinh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sinh(half);
- half2 __ovld __cnfn sinh(half2);
-@@ -8558,14 +8571,14 @@ float3 __ovld __cnfn sinpi(float3 x);
- float4 __ovld __cnfn sinpi(float4 x);
- float8 __ovld __cnfn sinpi(float8 x);
- float16 __ovld __cnfn sinpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sinpi(double x);
- double2 __ovld __cnfn sinpi(double2 x);
- double3 __ovld __cnfn sinpi(double3 x);
- double4 __ovld __cnfn sinpi(double4 x);
- double8 __ovld __cnfn sinpi(double8 x);
- double16 __ovld __cnfn sinpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sinpi(half x);
- half2 __ovld __cnfn sinpi(half2 x);
-@@ -8584,14 +8597,14 @@ float3 __ovld __cnfn sqrt(float3);
- float4 __ovld __cnfn sqrt(float4);
- float8 __ovld __cnfn sqrt(float8);
- float16 __ovld __cnfn sqrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sqrt(double);
- double2 __ovld __cnfn sqrt(double2);
- double3 __ovld __cnfn sqrt(double3);
- double4 __ovld __cnfn sqrt(double4);
- double8 __ovld __cnfn sqrt(double8);
- double16 __ovld __cnfn sqrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sqrt(half);
- half2 __ovld __cnfn sqrt(half2);
-@@ -8610,14 +8623,14 @@ float3 __ovld __cnfn tan(float3);
- float4 __ovld __cnfn tan(float4);
- float8 __ovld __cnfn tan(float8);
- float16 __ovld __cnfn tan(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tan(double);
- double2 __ovld __cnfn tan(double2);
- double3 __ovld __cnfn tan(double3);
- double4 __ovld __cnfn tan(double4);
- double8 __ovld __cnfn tan(double8);
- double16 __ovld __cnfn tan(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tan(half);
- half2 __ovld __cnfn tan(half2);
-@@ -8636,14 +8649,14 @@ float3 __ovld __cnfn tanh(float3);
- float4 __ovld __cnfn tanh(float4);
- float8 __ovld __cnfn tanh(float8);
- float16 __ovld __cnfn tanh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tanh(double);
- double2 __ovld __cnfn tanh(double2);
- double3 __ovld __cnfn tanh(double3);
- double4 __ovld __cnfn tanh(double4);
- double8 __ovld __cnfn tanh(double8);
- double16 __ovld __cnfn tanh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tanh(half);
- half2 __ovld __cnfn tanh(half2);
-@@ -8662,14 +8675,14 @@ float3 __ovld __cnfn tanpi(float3 x);
- float4 __ovld __cnfn tanpi(float4 x);
- float8 __ovld __cnfn tanpi(float8 x);
- float16 __ovld __cnfn tanpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tanpi(double x);
- double2 __ovld __cnfn tanpi(double2 x);
- double3 __ovld __cnfn tanpi(double3 x);
- double4 __ovld __cnfn tanpi(double4 x);
- double8 __ovld __cnfn tanpi(double8 x);
- double16 __ovld __cnfn tanpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tanpi(half x);
- half2 __ovld __cnfn tanpi(half2 x);
-@@ -8688,14 +8701,14 @@ float3 __ovld __cnfn tgamma(float3);
- float4 __ovld __cnfn tgamma(float4);
- float8 __ovld __cnfn tgamma(float8);
- float16 __ovld __cnfn tgamma(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tgamma(double);
- double2 __ovld __cnfn tgamma(double2);
- double3 __ovld __cnfn tgamma(double3);
- double4 __ovld __cnfn tgamma(double4);
- double8 __ovld __cnfn tgamma(double8);
- double16 __ovld __cnfn tgamma(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tgamma(half);
- half2 __ovld __cnfn tgamma(half2);
-@@ -8715,14 +8728,14 @@ float3 __ovld __cnfn trunc(float3);
- float4 __ovld __cnfn trunc(float4);
- float8 __ovld __cnfn trunc(float8);
- float16 __ovld __cnfn trunc(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn trunc(double);
- double2 __ovld __cnfn trunc(double2);
- double3 __ovld __cnfn trunc(double3);
- double4 __ovld __cnfn trunc(double4);
- double8 __ovld __cnfn trunc(double8);
- double16 __ovld __cnfn trunc(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn trunc(half);
- half2 __ovld __cnfn trunc(half2);
-@@ -10108,7 +10121,7 @@ float3 __ovld __cnfn clamp(float3 x, float minval, float maxval);
- float4 __ovld __cnfn clamp(float4 x, float minval, float maxval);
- float8 __ovld __cnfn clamp(float8 x, float minval, float maxval);
- float16 __ovld __cnfn clamp(float16 x, float minval, float maxval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn clamp(double x, double minval, double maxval);
- double2 __ovld __cnfn clamp(double2 x, double2 minval, double2 maxval);
- double3 __ovld __cnfn clamp(double3 x, double3 minval, double3 maxval);
-@@ -10120,7 +10133,7 @@ double3 __ovld __cnfn clamp(double3 x, double minval, double maxval);
- double4 __ovld __cnfn clamp(double4 x, double minval, double maxval);
- double8 __ovld __cnfn clamp(double8 x, double minval, double maxval);
- double16 __ovld __cnfn clamp(double16 x, double minval, double maxval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn clamp(half x, half minval, half maxval);
- half2 __ovld __cnfn clamp(half2 x, half2 minval, half2 maxval);
-@@ -10145,14 +10158,14 @@ float3 __ovld __cnfn degrees(float3 radians);
- float4 __ovld __cnfn degrees(float4 radians);
- float8 __ovld __cnfn degrees(float8 radians);
- float16 __ovld __cnfn degrees(float16 radians);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn degrees(double radians);
- double2 __ovld __cnfn degrees(double2 radians);
- double3 __ovld __cnfn degrees(double3 radians);
- double4 __ovld __cnfn degrees(double4 radians);
- double8 __ovld __cnfn degrees(double8 radians);
- double16 __ovld __cnfn degrees(double16 radians);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn degrees(half radians);
- half2 __ovld __cnfn degrees(half2 radians);
-@@ -10177,7 +10190,7 @@ float3 __ovld __cnfn max(float3 x, float y);
- float4 __ovld __cnfn max(float4 x, float y);
- float8 __ovld __cnfn max(float8 x, float y);
- float16 __ovld __cnfn max(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn max(double x, double y);
- double2 __ovld __cnfn max(double2 x, double2 y);
- double3 __ovld __cnfn max(double3 x, double3 y);
-@@ -10189,7 +10202,7 @@ double3 __ovld __cnfn max(double3 x, double y);
- double4 __ovld __cnfn max(double4 x, double y);
- double8 __ovld __cnfn max(double8 x, double y);
- double16 __ovld __cnfn max(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn max(half x, half y);
- half2 __ovld __cnfn max(half2 x, half2 y);
-@@ -10219,7 +10232,7 @@ float3 __ovld __cnfn min(float3 x, float y);
- float4 __ovld __cnfn min(float4 x, float y);
- float8 __ovld __cnfn min(float8 x, float y);
- float16 __ovld __cnfn min(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn min(double x, double y);
- double2 __ovld __cnfn min(double2 x, double2 y);
- double3 __ovld __cnfn min(double3 x, double3 y);
-@@ -10231,7 +10244,7 @@ double3 __ovld __cnfn min(double3 x, double y);
- double4 __ovld __cnfn min(double4 x, double y);
- double8 __ovld __cnfn min(double8 x, double y);
- double16 __ovld __cnfn min(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn min(half x, half y);
- half2 __ovld __cnfn min(half2 x, half2 y);
-@@ -10264,7 +10277,7 @@ float3 __ovld __cnfn mix(float3 x, float3 y, float a);
- float4 __ovld __cnfn mix(float4 x, float4 y, float a);
- float8 __ovld __cnfn mix(float8 x, float8 y, float a);
- float16 __ovld __cnfn mix(float16 x, float16 y, float a);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn mix(double x, double y, double a);
- double2 __ovld __cnfn mix(double2 x, double2 y, double2 a);
- double3 __ovld __cnfn mix(double3 x, double3 y, double3 a);
-@@ -10276,7 +10289,7 @@ double3 __ovld __cnfn mix(double3 x, double3 y, double a);
- double4 __ovld __cnfn mix(double4 x, double4 y, double a);
- double8 __ovld __cnfn mix(double8 x, double8 y, double a);
- double16 __ovld __cnfn mix(double16 x, double16 y, double a);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn mix(half x, half y, half a);
- half2 __ovld __cnfn mix(half2 x, half2 y, half2 a);
-@@ -10301,14 +10314,14 @@ float3 __ovld __cnfn radians(float3 degrees);
- float4 __ovld __cnfn radians(float4 degrees);
- float8 __ovld __cnfn radians(float8 degrees);
- float16 __ovld __cnfn radians(float16 degrees);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn radians(double degrees);
- double2 __ovld __cnfn radians(double2 degrees);
- double3 __ovld __cnfn radians(double3 degrees);
- double4 __ovld __cnfn radians(double4 degrees);
- double8 __ovld __cnfn radians(double8 degrees);
- double16 __ovld __cnfn radians(double16 degrees);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn radians(half degrees);
- half2 __ovld __cnfn radians(half2 degrees);
-@@ -10332,7 +10345,7 @@ float3 __ovld __cnfn step(float edge, float3 x);
- float4 __ovld __cnfn step(float edge, float4 x);
- float8 __ovld __cnfn step(float edge, float8 x);
- float16 __ovld __cnfn step(float edge, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn step(double edge, double x);
- double2 __ovld __cnfn step(double2 edge, double2 x);
- double3 __ovld __cnfn step(double3 edge, double3 x);
-@@ -10344,7 +10357,7 @@ double3 __ovld __cnfn step(double edge, double3 x);
- double4 __ovld __cnfn step(double edge, double4 x);
- double8 __ovld __cnfn step(double edge, double8 x);
- double16 __ovld __cnfn step(double edge, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn step(half edge, half x);
- half2 __ovld __cnfn step(half2 edge, half2 x);
-@@ -10383,7 +10396,7 @@ float3 __ovld __cnfn smoothstep(float edge0, float edge1, float3 x);
- float4 __ovld __cnfn smoothstep(float edge0, float edge1, float4 x);
- float8 __ovld __cnfn smoothstep(float edge0, float edge1, float8 x);
- float16 __ovld __cnfn smoothstep(float edge0, float edge1, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn smoothstep(double edge0, double edge1, double x);
- double2 __ovld __cnfn smoothstep(double2 edge0, double2 edge1, double2 x);
- double3 __ovld __cnfn smoothstep(double3 edge0, double3 edge1, double3 x);
-@@ -10395,7 +10408,7 @@ double3 __ovld __cnfn smoothstep(double edge0, double edge1, double3 x);
- double4 __ovld __cnfn smoothstep(double edge0, double edge1, double4 x);
- double8 __ovld __cnfn smoothstep(double edge0, double edge1, double8 x);
- double16 __ovld __cnfn smoothstep(double edge0, double edge1, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn smoothstep(half edge0, half edge1, half x);
- half2 __ovld __cnfn smoothstep(half2 edge0, half2 edge1, half2 x);
-@@ -10420,14 +10433,14 @@ float3 __ovld __cnfn sign(float3 x);
- float4 __ovld __cnfn sign(float4 x);
- float8 __ovld __cnfn sign(float8 x);
- float16 __ovld __cnfn sign(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sign(double x);
- double2 __ovld __cnfn sign(double2 x);
- double3 __ovld __cnfn sign(double3 x);
- double4 __ovld __cnfn sign(double4 x);
- double8 __ovld __cnfn sign(double8 x);
- double16 __ovld __cnfn sign(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sign(half x);
- half2 __ovld __cnfn sign(half2 x);
-@@ -10445,10 +10458,10 @@ half16 __ovld __cnfn sign(half16 x);
- */
- float4 __ovld __cnfn cross(float4 p0, float4 p1);
- float3 __ovld __cnfn cross(float3 p0, float3 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double4 __ovld __cnfn cross(double4 p0, double4 p1);
- double3 __ovld __cnfn cross(double3 p0, double3 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half4 __ovld __cnfn cross(half4 p0, half4 p1);
- half3 __ovld __cnfn cross(half3 p0, half3 p1);
-@@ -10461,12 +10474,12 @@ float __ovld __cnfn dot(float p0, float p1);
- float __ovld __cnfn dot(float2 p0, float2 p1);
- float __ovld __cnfn dot(float3 p0, float3 p1);
- float __ovld __cnfn dot(float4 p0, float4 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn dot(double p0, double p1);
- double __ovld __cnfn dot(double2 p0, double2 p1);
- double __ovld __cnfn dot(double3 p0, double3 p1);
- double __ovld __cnfn dot(double4 p0, double4 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn dot(half p0, half p1);
- half __ovld __cnfn dot(half2 p0, half2 p1);
-@@ -10482,12 +10495,12 @@ float __ovld __cnfn distance(float p0, float p1);
- float __ovld __cnfn distance(float2 p0, float2 p1);
- float __ovld __cnfn distance(float3 p0, float3 p1);
- float __ovld __cnfn distance(float4 p0, float4 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn distance(double p0, double p1);
- double __ovld __cnfn distance(double2 p0, double2 p1);
- double __ovld __cnfn distance(double3 p0, double3 p1);
- double __ovld __cnfn distance(double4 p0, double4 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn distance(half p0, half p1);
- half __ovld __cnfn distance(half2 p0, half2 p1);
-@@ -10503,12 +10516,12 @@ float __ovld __cnfn length(float p);
- float __ovld __cnfn length(float2 p);
- float __ovld __cnfn length(float3 p);
- float __ovld __cnfn length(float4 p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn length(double p);
- double __ovld __cnfn length(double2 p);
- double __ovld __cnfn length(double3 p);
- double __ovld __cnfn length(double4 p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn length(half p);
- half __ovld __cnfn length(half2 p);
-@@ -10524,12 +10537,12 @@ float __ovld __cnfn normalize(float p);
- float2 __ovld __cnfn normalize(float2 p);
- float3 __ovld __cnfn normalize(float3 p);
- float4 __ovld __cnfn normalize(float4 p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn normalize(double p);
- double2 __ovld __cnfn normalize(double2 p);
- double3 __ovld __cnfn normalize(double3 p);
- double4 __ovld __cnfn normalize(double4 p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn normalize(half p);
- half2 __ovld __cnfn normalize(half2 p);
-@@ -10610,14 +10623,14 @@ int3 __ovld __cnfn isequal(float3 x, float3 y);
- int4 __ovld __cnfn isequal(float4 x, float4 y);
- int8 __ovld __cnfn isequal(float8 x, float8 y);
- int16 __ovld __cnfn isequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isequal(double x, double y);
- long2 __ovld __cnfn isequal(double2 x, double2 y);
- long3 __ovld __cnfn isequal(double3 x, double3 y);
- long4 __ovld __cnfn isequal(double4 x, double4 y);
- long8 __ovld __cnfn isequal(double8 x, double8 y);
- long16 __ovld __cnfn isequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isequal(half x, half y);
- short2 __ovld __cnfn isequal(half2 x, half2 y);
-@@ -10636,14 +10649,14 @@ int3 __ovld __cnfn isnotequal(float3 x, float3 y);
- int4 __ovld __cnfn isnotequal(float4 x, float4 y);
- int8 __ovld __cnfn isnotequal(float8 x, float8 y);
- int16 __ovld __cnfn isnotequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnotequal(double x, double y);
- long2 __ovld __cnfn isnotequal(double2 x, double2 y);
- long3 __ovld __cnfn isnotequal(double3 x, double3 y);
- long4 __ovld __cnfn isnotequal(double4 x, double4 y);
- long8 __ovld __cnfn isnotequal(double8 x, double8 y);
- long16 __ovld __cnfn isnotequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnotequal(half x, half y);
- short2 __ovld __cnfn isnotequal(half2 x, half2 y);
-@@ -10662,14 +10675,14 @@ int3 __ovld __cnfn isgreater(float3 x, float3 y);
- int4 __ovld __cnfn isgreater(float4 x, float4 y);
- int8 __ovld __cnfn isgreater(float8 x, float8 y);
- int16 __ovld __cnfn isgreater(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isgreater(double x, double y);
- long2 __ovld __cnfn isgreater(double2 x, double2 y);
- long3 __ovld __cnfn isgreater(double3 x, double3 y);
- long4 __ovld __cnfn isgreater(double4 x, double4 y);
- long8 __ovld __cnfn isgreater(double8 x, double8 y);
- long16 __ovld __cnfn isgreater(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isgreater(half x, half y);
- short2 __ovld __cnfn isgreater(half2 x, half2 y);
-@@ -10688,14 +10701,14 @@ int3 __ovld __cnfn isgreaterequal(float3 x, float3 y);
- int4 __ovld __cnfn isgreaterequal(float4 x, float4 y);
- int8 __ovld __cnfn isgreaterequal(float8 x, float8 y);
- int16 __ovld __cnfn isgreaterequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isgreaterequal(double x, double y);
- long2 __ovld __cnfn isgreaterequal(double2 x, double2 y);
- long3 __ovld __cnfn isgreaterequal(double3 x, double3 y);
- long4 __ovld __cnfn isgreaterequal(double4 x, double4 y);
- long8 __ovld __cnfn isgreaterequal(double8 x, double8 y);
- long16 __ovld __cnfn isgreaterequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isgreaterequal(half x, half y);
- short2 __ovld __cnfn isgreaterequal(half2 x, half2 y);
-@@ -10714,14 +10727,14 @@ int3 __ovld __cnfn isless(float3 x, float3 y);
- int4 __ovld __cnfn isless(float4 x, float4 y);
- int8 __ovld __cnfn isless(float8 x, float8 y);
- int16 __ovld __cnfn isless(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isless(double x, double y);
- long2 __ovld __cnfn isless(double2 x, double2 y);
- long3 __ovld __cnfn isless(double3 x, double3 y);
- long4 __ovld __cnfn isless(double4 x, double4 y);
- long8 __ovld __cnfn isless(double8 x, double8 y);
- long16 __ovld __cnfn isless(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isless(half x, half y);
- short2 __ovld __cnfn isless(half2 x, half2 y);
-@@ -10740,14 +10753,14 @@ int3 __ovld __cnfn islessequal(float3 x, float3 y);
- int4 __ovld __cnfn islessequal(float4 x, float4 y);
- int8 __ovld __cnfn islessequal(float8 x, float8 y);
- int16 __ovld __cnfn islessequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn islessequal(double x, double y);
- long2 __ovld __cnfn islessequal(double2 x, double2 y);
- long3 __ovld __cnfn islessequal(double3 x, double3 y);
- long4 __ovld __cnfn islessequal(double4 x, double4 y);
- long8 __ovld __cnfn islessequal(double8 x, double8 y);
- long16 __ovld __cnfn islessequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn islessequal(half x, half y);
- short2 __ovld __cnfn islessequal(half2 x, half2 y);
-@@ -10767,14 +10780,14 @@ int3 __ovld __cnfn islessgreater(float3 x, float3 y);
- int4 __ovld __cnfn islessgreater(float4 x, float4 y);
- int8 __ovld __cnfn islessgreater(float8 x, float8 y);
- int16 __ovld __cnfn islessgreater(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn islessgreater(double x, double y);
- long2 __ovld __cnfn islessgreater(double2 x, double2 y);
- long3 __ovld __cnfn islessgreater(double3 x, double3 y);
- long4 __ovld __cnfn islessgreater(double4 x, double4 y);
- long8 __ovld __cnfn islessgreater(double8 x, double8 y);
- long16 __ovld __cnfn islessgreater(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn islessgreater(half x, half y);
- short2 __ovld __cnfn islessgreater(half2 x, half2 y);
-@@ -10793,14 +10806,14 @@ int3 __ovld __cnfn isfinite(float3);
- int4 __ovld __cnfn isfinite(float4);
- int8 __ovld __cnfn isfinite(float8);
- int16 __ovld __cnfn isfinite(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isfinite(double);
- long2 __ovld __cnfn isfinite(double2);
- long3 __ovld __cnfn isfinite(double3);
- long4 __ovld __cnfn isfinite(double4);
- long8 __ovld __cnfn isfinite(double8);
- long16 __ovld __cnfn isfinite(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isfinite(half);
- short2 __ovld __cnfn isfinite(half2);
-@@ -10819,14 +10832,14 @@ int3 __ovld __cnfn isinf(float3);
- int4 __ovld __cnfn isinf(float4);
- int8 __ovld __cnfn isinf(float8);
- int16 __ovld __cnfn isinf(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isinf(double);
- long2 __ovld __cnfn isinf(double2);
- long3 __ovld __cnfn isinf(double3);
- long4 __ovld __cnfn isinf(double4);
- long8 __ovld __cnfn isinf(double8);
- long16 __ovld __cnfn isinf(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isinf(half);
- short2 __ovld __cnfn isinf(half2);
-@@ -10845,14 +10858,14 @@ int3 __ovld __cnfn isnan(float3);
- int4 __ovld __cnfn isnan(float4);
- int8 __ovld __cnfn isnan(float8);
- int16 __ovld __cnfn isnan(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnan(double);
- long2 __ovld __cnfn isnan(double2);
- long3 __ovld __cnfn isnan(double3);
- long4 __ovld __cnfn isnan(double4);
- long8 __ovld __cnfn isnan(double8);
- long16 __ovld __cnfn isnan(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnan(half);
- short2 __ovld __cnfn isnan(half2);
-@@ -10871,14 +10884,14 @@ int3 __ovld __cnfn isnormal(float3);
- int4 __ovld __cnfn isnormal(float4);
- int8 __ovld __cnfn isnormal(float8);
- int16 __ovld __cnfn isnormal(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnormal(double);
- long2 __ovld __cnfn isnormal(double2);
- long3 __ovld __cnfn isnormal(double3);
- long4 __ovld __cnfn isnormal(double4);
- long8 __ovld __cnfn isnormal(double8);
- long16 __ovld __cnfn isnormal(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnormal(half);
- short2 __ovld __cnfn isnormal(half2);
-@@ -10899,14 +10912,14 @@ int3 __ovld __cnfn isordered(float3 x, float3 y);
- int4 __ovld __cnfn isordered(float4 x, float4 y);
- int8 __ovld __cnfn isordered(float8 x, float8 y);
- int16 __ovld __cnfn isordered(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isordered(double x, double y);
- long2 __ovld __cnfn isordered(double2 x, double2 y);
- long3 __ovld __cnfn isordered(double3 x, double3 y);
- long4 __ovld __cnfn isordered(double4 x, double4 y);
- long8 __ovld __cnfn isordered(double8 x, double8 y);
- long16 __ovld __cnfn isordered(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isordered(half x, half y);
- short2 __ovld __cnfn isordered(half2 x, half2 y);
-@@ -10927,14 +10940,14 @@ int3 __ovld __cnfn isunordered(float3 x, float3 y);
- int4 __ovld __cnfn isunordered(float4 x, float4 y);
- int8 __ovld __cnfn isunordered(float8 x, float8 y);
- int16 __ovld __cnfn isunordered(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isunordered(double x, double y);
- long2 __ovld __cnfn isunordered(double2 x, double2 y);
- long3 __ovld __cnfn isunordered(double3 x, double3 y);
- long4 __ovld __cnfn isunordered(double4 x, double4 y);
- long8 __ovld __cnfn isunordered(double8 x, double8 y);
- long16 __ovld __cnfn isunordered(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isunordered(half x, half y);
- short2 __ovld __cnfn isunordered(half2 x, half2 y);
-@@ -10957,14 +10970,14 @@ int3 __ovld __cnfn signbit(float3);
- int4 __ovld __cnfn signbit(float4);
- int8 __ovld __cnfn signbit(float8);
- int16 __ovld __cnfn signbit(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn signbit(double);
- long2 __ovld __cnfn signbit(double2);
- long3 __ovld __cnfn signbit(double3);
- long4 __ovld __cnfn signbit(double4);
- long8 __ovld __cnfn signbit(double8);
- long16 __ovld __cnfn signbit(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn signbit(half);
- short2 __ovld __cnfn signbit(half2);
-@@ -11091,14 +11104,14 @@ float3 __ovld __cnfn bitselect(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn bitselect(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn bitselect(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn bitselect(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn bitselect(double a, double b, double c);
- double2 __ovld __cnfn bitselect(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn bitselect(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn bitselect(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn bitselect(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn bitselect(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn bitselect(half a, half b, half c);
- half2 __ovld __cnfn bitselect(half2 a, half2 b, half2 c);
-@@ -11231,7 +11244,7 @@ ulong8 __ovld __cnfn select(ulong8 a, ulong8 b, ulong8 c);
- long16 __ovld __cnfn select(long16 a, long16 b, ulong16 c);
- ulong16 __ovld __cnfn select(ulong16 a, ulong16 b, ulong16 c);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn select(double a, double b, long c);
- double2 __ovld __cnfn select(double2 a, double2 b, long2 c);
- double3 __ovld __cnfn select(double3 a, double3 b, long3 c);
-@@ -11244,7 +11257,7 @@ double3 __ovld __cnfn select(double3 a, double3 b, ulong3 c);
- double4 __ovld __cnfn select(double4 a, double4 b, ulong4 c);
- double8 __ovld __cnfn select(double8 a, double8 b, ulong8 c);
- double16 __ovld __cnfn select(double16 a, double16 b, ulong16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn select(half a, half b, short c);
- half2 __ovld __cnfn select(half2 a, half2 b, short2 c);
-@@ -11323,13 +11336,13 @@ uint16 __ovld vload16(size_t offset, const __constant uint *p);
- long16 __ovld vload16(size_t offset, const __constant long *p);
- ulong16 __ovld vload16(size_t offset, const __constant ulong *p);
- float16 __ovld vload16(size_t offset, const __constant float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const __constant double *p);
- double3 __ovld vload3(size_t offset, const __constant double *p);
- double4 __ovld vload4(size_t offset, const __constant double *p);
- double8 __ovld vload8(size_t offset, const __constant double *p);
- double16 __ovld vload16(size_t offset, const __constant double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const __constant half *p);
-@@ -11340,7 +11353,7 @@ half8 __ovld vload8(size_t offset, const __constant half *p);
- half16 __ovld vload16(size_t offset, const __constant half *p);
- #endif //cl_khr_fp16
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- char2 __ovld vload2(size_t offset, const char *p);
- uchar2 __ovld vload2(size_t offset, const uchar *p);
- short2 __ovld vload2(size_t offset, const short *p);
-@@ -11387,13 +11400,13 @@ long16 __ovld vload16(size_t offset, const long *p);
- ulong16 __ovld vload16(size_t offset, const ulong *p);
- float16 __ovld vload16(size_t offset, const float *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const double *p);
- double3 __ovld vload3(size_t offset, const double *p);
- double4 __ovld vload4(size_t offset, const double *p);
- double8 __ovld vload8(size_t offset, const double *p);
- double16 __ovld vload16(size_t offset, const double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const half *p);
-@@ -11403,7 +11416,7 @@ half4 __ovld vload4(size_t offset, const half *p);
- half8 __ovld vload8(size_t offset, const half *p);
- half16 __ovld vload16(size_t offset, const half *p);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
- char2 __ovld vload2(size_t offset, const __global char *p);
- uchar2 __ovld vload2(size_t offset, const __global uchar *p);
- short2 __ovld vload2(size_t offset, const __global short *p);
-@@ -11540,7 +11553,7 @@ long16 __ovld vload16(size_t offset, const __private long *p);
- ulong16 __ovld vload16(size_t offset, const __private ulong *p);
- float16 __ovld vload16(size_t offset, const __private float *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const __global double *p);
- double3 __ovld vload3(size_t offset, const __global double *p);
- double4 __ovld vload4(size_t offset, const __global double *p);
-@@ -11556,7 +11569,7 @@ double3 __ovld vload3(size_t offset, const __private double *p);
- double4 __ovld vload4(size_t offset, const __private double *p);
- double8 __ovld vload8(size_t offset, const __private double *p);
- double16 __ovld vload16(size_t offset, const __private double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const __global half *p);
-@@ -11578,9 +11591,8 @@ half4 __ovld vload4(size_t offset, const __private half *p);
- half8 __ovld vload8(size_t offset, const __private half *p);
- half16 __ovld vload16(size_t offset, const __private half *p);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore2(char2 data, size_t offset, char *p);
- void __ovld vstore2(uchar2 data, size_t offset, uchar *p);
- void __ovld vstore2(short2 data, size_t offset, short *p);
-@@ -11626,13 +11638,13 @@ void __ovld vstore16(uint16 data, size_t offset, uint *p);
- void __ovld vstore16(long16 data, size_t offset, long *p);
- void __ovld vstore16(ulong16 data, size_t offset, ulong *p);
- void __ovld vstore16(float16 data, size_t offset, float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore2(double2 data, size_t offset, double *p);
- void __ovld vstore3(double3 data, size_t offset, double *p);
- void __ovld vstore4(double4 data, size_t offset, double *p);
- void __ovld vstore8(double8 data, size_t offset, double *p);
- void __ovld vstore16(double16 data, size_t offset, double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld vstore(half data, size_t offset, half *p);
- void __ovld vstore2(half2 data, size_t offset, half *p);
-@@ -11641,7 +11653,7 @@ void __ovld vstore4(half4 data, size_t offset, half *p);
- void __ovld vstore8(half8 data, size_t offset, half *p);
- void __ovld vstore16(half16 data, size_t offset, half *p);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore2(char2 data, size_t offset, __global char *p);
- void __ovld vstore2(uchar2 data, size_t offset, __global uchar *p);
- void __ovld vstore2(short2 data, size_t offset, __global short *p);
-@@ -11777,7 +11789,7 @@ void __ovld vstore16(uint16 data, size_t offset, __private uint *p);
- void __ovld vstore16(long16 data, size_t offset, __private long *p);
- void __ovld vstore16(ulong16 data, size_t offset, __private ulong *p);
- void __ovld vstore16(float16 data, size_t offset, __private float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore2(double2 data, size_t offset, __global double *p);
- void __ovld vstore3(double3 data, size_t offset, __global double *p);
- void __ovld vstore4(double4 data, size_t offset, __global double *p);
-@@ -11793,7 +11805,7 @@ void __ovld vstore3(double3 data, size_t offset, __private double *p);
- void __ovld vstore4(double4 data, size_t offset, __private double *p);
- void __ovld vstore8(double8 data, size_t offset, __private double *p);
- void __ovld vstore16(double16 data, size_t offset, __private double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld vstore(half data, size_t offset, __global half *p);
- void __ovld vstore2(half2 data, size_t offset, __global half *p);
-@@ -11814,7 +11826,6 @@ void __ovld vstore4(half4 data, size_t offset, __private half *p);
- void __ovld vstore8(half8 data, size_t offset, __private half *p);
- void __ovld vstore16(half16 data, size_t offset, __private half *p);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * Read sizeof (half) bytes of data from address
-@@ -11825,13 +11836,12 @@ void __ovld vstore16(half16 data, size_t offset, __private half *p);
- * must be 16-bit aligned.
- */
- float __ovld vload_half(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld vload_half(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float __ovld vload_half(size_t offset, const __global half *p);
- float __ovld vload_half(size_t offset, const __local half *p);
- float __ovld vload_half(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * Read sizeof (halfn) bytes of data from address
-@@ -11846,13 +11856,13 @@ float3 __ovld vload_half3(size_t offset, const __constant half *p);
- float4 __ovld vload_half4(size_t offset, const __constant half *p);
- float8 __ovld vload_half8(size_t offset, const __constant half *p);
- float16 __ovld vload_half16(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float2 __ovld vload_half2(size_t offset, const half *p);
- float3 __ovld vload_half3(size_t offset, const half *p);
- float4 __ovld vload_half4(size_t offset, const half *p);
- float8 __ovld vload_half8(size_t offset, const half *p);
- float16 __ovld vload_half16(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float2 __ovld vload_half2(size_t offset, const __global half *p);
- float3 __ovld vload_half3(size_t offset, const __global half *p);
- float4 __ovld vload_half4(size_t offset, const __global half *p);
-@@ -11868,7 +11878,6 @@ float3 __ovld vload_half3(size_t offset, const __private half *p);
- float4 __ovld vload_half4(size_t offset, const __private half *p);
- float8 __ovld vload_half8(size_t offset, const __private half *p);
- float16 __ovld vload_half16(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * The float value given by data is first
-@@ -11881,20 +11890,20 @@ float16 __ovld vload_half16(size_t offset, const __private half *p);
- * The default current rounding mode is round to
- * nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore_half(float data, size_t offset, half *p);
- void __ovld vstore_half_rte(float data, size_t offset, half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, half *p);
- void __ovld vstore_half_rtp(float data, size_t offset, half *p);
- void __ovld vstore_half_rtn(float data, size_t offset, half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half(double data, size_t offset, half *p);
- void __ovld vstore_half_rte(double data, size_t offset, half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, half *p);
- void __ovld vstore_half_rtp(double data, size_t offset, half *p);
- void __ovld vstore_half_rtn(double data, size_t offset, half *p);
--#endif //cl_khr_fp64
--#else
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore_half(float data, size_t offset, __global half *p);
- void __ovld vstore_half_rte(float data, size_t offset, __global half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, __global half *p);
-@@ -11910,7 +11919,7 @@ void __ovld vstore_half_rte(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtp(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtn(float data, size_t offset, __private half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half(double data, size_t offset, __global half *p);
- void __ovld vstore_half_rte(double data, size_t offset, __global half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, __global half *p);
-@@ -11926,8 +11935,7 @@ void __ovld vstore_half_rte(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtp(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtn(double data, size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- /**
- * The floatn value given by data is converted to
-@@ -11940,7 +11948,7 @@ void __ovld vstore_half_rtn(double data, size_t offset, __private half *p);
- * The default current rounding mode is round to
- * nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore_half2(float2 data, size_t offset, half *p);
- void __ovld vstore_half3(float3 data, size_t offset, half *p);
- void __ovld vstore_half4(float4 data, size_t offset, half *p);
-@@ -11966,7 +11974,7 @@ void __ovld vstore_half3_rtn(float3 data, size_t offset, half *p);
- void __ovld vstore_half4_rtn(float4 data, size_t offset, half *p);
- void __ovld vstore_half8_rtn(float8 data, size_t offset, half *p);
- void __ovld vstore_half16_rtn(float16 data, size_t offset, half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half2(double2 data, size_t offset, half *p);
- void __ovld vstore_half3(double3 data, size_t offset, half *p);
- void __ovld vstore_half4(double4 data, size_t offset, half *p);
-@@ -11992,8 +12000,8 @@ void __ovld vstore_half3_rtn(double3 data, size_t offset, half *p);
- void __ovld vstore_half4_rtn(double4 data, size_t offset, half *p);
- void __ovld vstore_half8_rtn(double8 data, size_t offset, half *p);
- void __ovld vstore_half16_rtn(double16 data, size_t offset, half *p);
--#endif //cl_khr_fp64
--#else
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore_half2(float2 data, size_t offset, __global half *p);
- void __ovld vstore_half3(float3 data, size_t offset, __global half *p);
- void __ovld vstore_half4(float4 data, size_t offset, __global half *p);
-@@ -12069,7 +12077,7 @@ void __ovld vstore_half3_rtn(float3 data, size_t offset, __private half *p);
- void __ovld vstore_half4_rtn(float4 data, size_t offset, __private half *p);
- void __ovld vstore_half8_rtn(float8 data, size_t offset, __private half *p);
- void __ovld vstore_half16_rtn(float16 data, size_t offset, __private half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half2(double2 data, size_t offset, __global half *p);
- void __ovld vstore_half3(double3 data, size_t offset, __global half *p);
- void __ovld vstore_half4(double4 data, size_t offset, __global half *p);
-@@ -12145,8 +12153,7 @@ void __ovld vstore_half3_rtn(double3 data, size_t offset, __private half *p);
- void __ovld vstore_half4_rtn(double4 data, size_t offset, __private half *p);
- void __ovld vstore_half8_rtn(double8 data, size_t offset, __private half *p);
- void __ovld vstore_half16_rtn(double16 data, size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- /**
- * For n = 1, 2, 4, 8 and 16 read sizeof (halfn)
-@@ -12167,14 +12174,14 @@ float3 __ovld vloada_half3(size_t offset, const __constant half *p);
- float4 __ovld vloada_half4(size_t offset, const __constant half *p);
- float8 __ovld vloada_half8(size_t offset, const __constant half *p);
- float16 __ovld vloada_half16(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld vloada_half(size_t offset, const half *p);
- float2 __ovld vloada_half2(size_t offset, const half *p);
- float3 __ovld vloada_half3(size_t offset, const half *p);
- float4 __ovld vloada_half4(size_t offset, const half *p);
- float8 __ovld vloada_half8(size_t offset, const half *p);
- float16 __ovld vloada_half16(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float __ovld vloada_half(size_t offset, const __global half *p);
- float2 __ovld vloada_half2(size_t offset, const __global half *p);
- float3 __ovld vloada_half3(size_t offset, const __global half *p);
-@@ -12193,7 +12200,6 @@ float3 __ovld vloada_half3(size_t offset, const __private half *p);
- float4 __ovld vloada_half4(size_t offset, const __private half *p);
- float8 __ovld vloada_half8(size_t offset, const __private half *p);
- float16 __ovld vloada_half16(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * The floatn value given by data is converted to
-@@ -12211,7 +12217,7 @@ float16 __ovld vloada_half16(size_t offset, const __private half *p);
- * mode. The default current rounding mode is
- * round to nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstorea_half(float data, size_t offset, half *p);
- void __ovld vstorea_half2(float2 data, size_t offset, half *p);
- void __ovld vstorea_half3(float3 data, size_t offset, half *p);
-@@ -12247,7 +12253,7 @@ void __ovld vstorea_half4_rtn(float4 data, size_t offset, half *p);
- void __ovld vstorea_half8_rtn(float8 data, size_t offset, half *p);
- void __ovld vstorea_half16_rtn(float16 data, size_t offset, half *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstorea_half(double data, size_t offset, half *p);
- void __ovld vstorea_half2(double2 data, size_t offset, half *p);
- void __ovld vstorea_half3(double3 data, size_t offset, half *p);
-@@ -12282,9 +12288,9 @@ void __ovld vstorea_half3_rtn(double3 data, size_t offset, half *p);
- void __ovld vstorea_half4_rtn(double4 data, size_t offset, half *p);
- void __ovld vstorea_half8_rtn(double8 data, size_t offset, half *p);
- void __ovld vstorea_half16_rtn(double16 data, size_t offset, half *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
-
--#else
- void __ovld vstorea_half(float data, size_t offset, __global half *p);
- void __ovld vstorea_half2(float2 data, size_t offset, __global half *p);
- void __ovld vstorea_half3(float3 data, size_t offset, __global half *p);
-@@ -12390,7 +12396,7 @@ void __ovld vstorea_half4_rtn(float4 data, size_t offset, __private half *p);
- void __ovld vstorea_half8_rtn(float8 data, size_t offset, __private half *p);
- void __ovld vstorea_half16_rtn(float16 data, size_t offset, __private half *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstorea_half(double data, size_t offset, __global half *p);
- void __ovld vstorea_half2(double2 data, size_t offset, __global half *p);
- void __ovld vstorea_half3(double3 data, size_t offset, __global half *p);
-@@ -12495,8 +12501,7 @@ void __ovld vstorea_half3_rtn(double3 data,size_t offset, __private half *p);
- void __ovld vstorea_half4_rtn(double4 data,size_t offset, __private half *p);
- void __ovld vstorea_half8_rtn(double8 data,size_t offset, __private half *p);
- void __ovld vstorea_half16_rtn(double16 data,size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- // OpenCL v1.1 s6.11.8, v1.2 s6.12.8, v2.0 s6.13.8 - Synchronization Functions
-
-@@ -12580,7 +12585,7 @@ void __ovld write_mem_fence(cl_mem_fence_flags flags);
-
- // OpenCL v2.0 s6.13.9 - Address Space Qualifier Functions
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- cl_mem_fence_flags __ovld get_fence(const void *ptr);
- cl_mem_fence_flags __ovld get_fence(void *ptr);
-
-@@ -12591,7 +12596,7 @@ cl_mem_fence_flags __ovld get_fence(void *ptr);
- * where gentype is builtin type or user defined type.
- */
-
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //__opencl_c_generic_address_space
-
- // OpenCL v1.1 s6.11.10, v1.2 s6.12.10, v2.0 s6.13.10 - Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch
-
-@@ -12730,7 +12735,7 @@ event_t __ovld async_work_group_copy(__global uint16 *dst, const __local uint16
- event_t __ovld async_work_group_copy(__global long16 *dst, const __local long16 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global ulong16 *dst, const __local ulong16 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global float16 *dst, const __local float16 *src, size_t num_elements, event_t event);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- event_t __ovld async_work_group_copy(__local double *dst, const __global double *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local double2 *dst, const __global double2 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local double3 *dst, const __global double3 *src, size_t num_elements, event_t event);
-@@ -12743,7 +12748,7 @@ event_t __ovld async_work_group_copy(__global double3 *dst, const __local double
- event_t __ovld async_work_group_copy(__global double4 *dst, const __local double4 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global double8 *dst, const __local double8 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global double16 *dst, const __local double16 *src, size_t num_elements, event_t event);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- event_t __ovld async_work_group_copy(__local half *dst, const __global half *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local half2 *dst, const __global half2 *src, size_t num_elements, event_t event);
-@@ -12893,7 +12898,7 @@ event_t __ovld async_work_group_strided_copy(__global uint16 *dst, const __local
- event_t __ovld async_work_group_strided_copy(__global long16 *dst, const __local long16 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global ulong16 *dst, const __local ulong16 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global float16 *dst, const __local float16 *src, size_t num_elements, size_t dst_stride, event_t event);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- event_t __ovld async_work_group_strided_copy(__local double *dst, const __global double *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local double2 *dst, const __global double2 *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local double3 *dst, const __global double3 *src, size_t num_elements, size_t src_stride, event_t event);
-@@ -12906,7 +12911,7 @@ event_t __ovld async_work_group_strided_copy(__global double3 *dst, const __loca
- event_t __ovld async_work_group_strided_copy(__global double4 *dst, const __local double4 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global double8 *dst, const __local double8 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global double16 *dst, const __local double16 *src, size_t num_elements, size_t dst_stride, event_t event);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- event_t __ovld async_work_group_strided_copy(__local half *dst, const __global half *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local half2 *dst, const __global half2 *src, size_t num_elements, size_t src_stride, event_t event);
-@@ -12996,14 +13001,14 @@ void __ovld prefetch(const __global uint16 *p, size_t num_elements);
- void __ovld prefetch(const __global long16 *p, size_t num_elements);
- void __ovld prefetch(const __global ulong16 *p, size_t num_elements);
- void __ovld prefetch(const __global float16 *p, size_t num_elements);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld prefetch(const __global double *p, size_t num_elements);
- void __ovld prefetch(const __global double2 *p, size_t num_elements);
- void __ovld prefetch(const __global double3 *p, size_t num_elements);
- void __ovld prefetch(const __global double4 *p, size_t num_elements);
- void __ovld prefetch(const __global double8 *p, size_t num_elements);
- void __ovld prefetch(const __global double16 *p, size_t num_elements);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld prefetch(const __global half *p, size_t num_elements);
- void __ovld prefetch(const __global half2 *p, size_t num_elements);
-@@ -13026,9 +13031,11 @@ void __ovld prefetch(const __global half16 *p, size_t num_elements);
- * pointed by p. The function returns old.
- */
- int __ovld atomic_add(volatile __global int *p, int val);
--unsigned int __ovld atomic_add(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_add(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_add(volatile __local int *p, int val);
--unsigned int __ovld atomic_add(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_add(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_add(volatile int *p, int val);
- unsigned int __ovld atomic_add(volatile unsigned int *p, unsigned int val);
-@@ -13056,9 +13063,11 @@ unsigned long __ovld atom_add(volatile __local unsigned long *p, unsigned long v
- * returns old.
- */
- int __ovld atomic_sub(volatile __global int *p, int val);
--unsigned int __ovld atomic_sub(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_sub(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_sub(volatile __local int *p, int val);
--unsigned int __ovld atomic_sub(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_sub(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_sub(volatile int *p, int val);
- unsigned int __ovld atomic_sub(volatile unsigned int *p, unsigned int val);
-@@ -13086,9 +13095,11 @@ unsigned long __ovld atom_sub(volatile __local unsigned long *p, unsigned long v
- * value.
- */
- int __ovld atomic_xchg(volatile __global int *p, int val);
--unsigned int __ovld atomic_xchg(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xchg(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_xchg(volatile __local int *p, int val);
--unsigned int __ovld atomic_xchg(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xchg(volatile __local unsigned int *p,
-+ unsigned int val);
- float __ovld atomic_xchg(volatile __global float *p, float val);
- float __ovld atomic_xchg(volatile __local float *p, float val);
- #ifdef __OPENCL_CPP_VERSION__
-@@ -13183,12 +13194,15 @@ unsigned long __ovld atom_dec(volatile __local unsigned long *p);
- * returns old.
- */
- int __ovld atomic_cmpxchg(volatile __global int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile __global unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile __global unsigned int *p,
-+ unsigned int cmp, unsigned int val);
- int __ovld atomic_cmpxchg(volatile __local int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile __local unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile __local unsigned int *p,
-+ unsigned int cmp, unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_cmpxchg(volatile int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile unsigned int *p, unsigned int cmp,
-+ unsigned int val);
- #endif
-
- #if defined(cl_khr_global_int32_base_atomics)
-@@ -13215,9 +13229,11 @@ unsigned long __ovld atom_cmpxchg(volatile __local unsigned long *p, unsigned lo
- * returns old.
- */
- int __ovld atomic_min(volatile __global int *p, int val);
--unsigned int __ovld atomic_min(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_min(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_min(volatile __local int *p, int val);
--unsigned int __ovld atomic_min(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_min(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_min(volatile int *p, int val);
- unsigned int __ovld atomic_min(volatile unsigned int *p, unsigned int val);
-@@ -13247,9 +13263,11 @@ unsigned long __ovld atom_min(volatile __local unsigned long *p, unsigned long v
- * returns old.
- */
- int __ovld atomic_max(volatile __global int *p, int val);
--unsigned int __ovld atomic_max(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_max(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_max(volatile __local int *p, int val);
--unsigned int __ovld atomic_max(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_max(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_max(volatile int *p, int val);
- unsigned int __ovld atomic_max(volatile unsigned int *p, unsigned int val);
-@@ -13278,9 +13296,11 @@ unsigned long __ovld atom_max(volatile __local unsigned long *p, unsigned long v
- * pointed by p. The function returns old.
- */
- int __ovld atomic_and(volatile __global int *p, int val);
--unsigned int __ovld atomic_and(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_and(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_and(volatile __local int *p, int val);
--unsigned int __ovld atomic_and(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_and(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_and(volatile int *p, int val);
- unsigned int __ovld atomic_and(volatile unsigned int *p, unsigned int val);
-@@ -13309,9 +13329,11 @@ unsigned long __ovld atom_and(volatile __local unsigned long *p, unsigned long v
- * pointed by p. The function returns old.
- */
- int __ovld atomic_or(volatile __global int *p, int val);
--unsigned int __ovld atomic_or(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_or(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_or(volatile __local int *p, int val);
--unsigned int __ovld atomic_or(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_or(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_or(volatile int *p, int val);
- unsigned int __ovld atomic_or(volatile unsigned int *p, unsigned int val);
-@@ -13340,9 +13362,11 @@ unsigned long __ovld atom_or(volatile __local unsigned long *p, unsigned long va
- * pointed by p. The function returns old.
- */
- int __ovld atomic_xor(volatile __global int *p, int val);
--unsigned int __ovld atomic_xor(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xor(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_xor(volatile __local int *p, int val);
--unsigned int __ovld atomic_xor(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xor(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_xor(volatile int *p, int val);
- unsigned int __ovld atomic_xor(volatile unsigned int *p, unsigned int val);
-@@ -13380,120 +13404,78 @@ unsigned long __ovld atom_xor(volatile __local unsigned long *p, unsigned long v
- #endif
-
- // atomic_init()
-+#ifdef __opencl_c_generic_address_space
- void __ovld atomic_init(volatile atomic_int *object, int value);
- void __ovld atomic_init(volatile atomic_uint *object, uint value);
- void __ovld atomic_init(volatile atomic_float *object, float value);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
- void __ovld atomic_init(volatile atomic_long *object, long value);
- void __ovld atomic_init(volatile atomic_ulong *object, ulong value);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld atomic_init(volatile atomic_double *object, double value);
--#endif //cl_khr_fp64
--#endif
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+void __ovld atomic_init(volatile atomic_int __global *object, int value);
-+void __ovld atomic_init(volatile atomic_int __local *object, int value);
-+void __ovld atomic_init(volatile atomic_uint __global *object, uint value);
-+void __ovld atomic_init(volatile atomic_uint __local *object, uint value);
-+void __ovld atomic_init(volatile atomic_float __global *object, float value);
-+void __ovld atomic_init(volatile atomic_float __local *object, float value);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+void __ovld atomic_init(volatile atomic_long __global *object, long value);
-+void __ovld atomic_init(volatile atomic_long __local *object, long value);
-+void __ovld atomic_init(volatile atomic_ulong __global *object, ulong value);
-+void __ovld atomic_init(volatile atomic_ulong __local *object, ulong value);
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+void __ovld atomic_init(volatile atomic_double __global *object, double value);
-+void __ovld atomic_init(volatile atomic_double __local *object, double value);
-+#endif // cl_khr_fp64
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_work_item_fence()
--void __ovld atomic_work_item_fence(cl_mem_fence_flags flags, memory_order order, memory_scope scope);
-+void __ovld atomic_work_item_fence(cl_mem_fence_flags flags, memory_order order,
-+ memory_scope scope);
-
- // atomic_fetch()
--
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+#ifdef __opencl_c_generic_address_space
- int __ovld atomic_fetch_add(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_add(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_sub(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_sub(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_or(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_or(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_xor(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_xor(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_and(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_and(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_min(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_min(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
--uint __ovld atomic_fetch_min(volatile atomic_uint *object, int operand);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, int operand, memory_order order);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, int operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_max(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_max(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
--uint __ovld atomic_fetch_max(volatile atomic_uint *object, int operand);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, int operand, memory_order order);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, int operand, memory_order order, memory_scope scope);
-
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
- long __ovld atomic_fetch_add(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_add(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_sub(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_sub(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_or(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_or(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_xor(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_xor(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_and(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_and(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_min(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_min(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
--ulong __ovld atomic_fetch_min(volatile atomic_ulong *object, long operand);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, long operand, memory_order order);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, long operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_max(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_max(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
--ulong __ovld atomic_fetch_max(volatile atomic_ulong *object, long operand);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, long operand, memory_order order);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, long operand, memory_order order, memory_scope scope);
- #endif //defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-
- // OpenCL v2.0 s6.13.11.7.5:
-@@ -13501,196 +13483,2239 @@ ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, long opera
- // or/xor/and/min/max: atomic type argument can be intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object, ptrdiff_t operand);
--uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object, ptrdiff_t operand);
--uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope);
--
--uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object, intptr_t opermax);
--uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder);
--uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope);
--uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object, intptr_t opermax);
--uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder);
--uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope);
--
--intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object, uintptr_t opermax);
--intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder);
--intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
--intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object, uintptr_t opermax);
--intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder);
--intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand);
-+
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object,
-+ intptr_t opermax);
-+
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object,
-+ uintptr_t opermax);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if(__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+int __ovld atomic_fetch_add(volatile atomic_int __global *object, int operand);
-+uint __ovld atomic_fetch_add(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_sub(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_sub(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __local *object,
-+ uint operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __global *object,
-+ uint operand);
-+int __ovld atomic_fetch_or(volatile atomic_int __global *object, int operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __local *object,
-+ uint operand);
-+uint __ovld atomic_fetch_or(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_or(volatile atomic_uint __local *object, uint operand);
-+int __ovld atomic_fetch_xor(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_xor(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_xor(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_xor(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_and(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_and(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_and(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_and(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_min(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_min(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_min(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_min(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_max(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_max(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_max(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_max(volatile atomic_uint __local *object,
-+ uint operand);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+long __ovld atomic_fetch_add(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_add(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_add(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_add(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_sub(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_sub(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_sub(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_sub(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_or(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_or(volatile atomic_long __local *object, long operand);
-+ulong __ovld atomic_fetch_or(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_or(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_xor(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_xor(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_xor(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_xor(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_and(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_and(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_and(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_and(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_min(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_min(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_min(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_min(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_max(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_max(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_max(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_max(volatile atomic_ulong __local *object,
-+ ulong operand);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand);
-+
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax);
-+
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand,
-+ memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand,
-+ memory_order order, memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand,
-+ memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder);
-+uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder);
-+intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand,
-+ memory_order order);
-+intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand,
-+ memory_order order);
-+intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder);
-+intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder);
-+#endif // __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order,
-+ memory_scope scope);
-+
-+uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+
-+intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
- #endif
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+uintptr_t __ovld
-+atomic_fetch_add_explicit(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_add_explicit(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_sub_explicit(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_sub_explicit(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax, memory_order minder);
-+#endif // __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(
-+ volatile atomic_uintptr_t __global *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_add_explicit(
-+ volatile atomic_uintptr_t __local *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(
-+ volatile atomic_uintptr_t __global *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(
-+ volatile atomic_uintptr_t __local *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+
-+uintptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+
-+intptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_store()
-
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
- void __ovld atomic_store(volatile atomic_int *object, int desired);
--void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_uint *object, uint desired);
--void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_float *object, float desired);
--void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld atomic_store(volatile atomic_double *object, double desired);
--void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif
- void __ovld atomic_store(volatile atomic_long *object, long desired);
--void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_ulong *object, ulong desired);
--void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+void __ovld atomic_store(volatile atomic_int __global *object, int desired);
-+void __ovld atomic_store(volatile atomic_int __local *object, int desired);
-+void __ovld atomic_store(volatile atomic_uint __global *object, uint desired);
-+void __ovld atomic_store(volatile atomic_uint __local *object, uint desired);
-+void __ovld atomic_store(volatile atomic_float __global *object, float desired);
-+void __ovld atomic_store(volatile atomic_float __local *object, float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+void __ovld atomic_store(volatile atomic_double __global *object,
-+ double desired);
-+void __ovld atomic_store(volatile atomic_double __local *object,
-+ double desired);
- #endif
-+void __ovld atomic_store(volatile atomic_long __global *object, long desired);
-+void __ovld atomic_store(volatile atomic_long __local *object, long desired);
-+void __ovld atomic_store(volatile atomic_ulong __global *object, ulong desired);
-+void __ovld atomic_store(volatile atomic_ulong __local *object, ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int *object, int desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float *object, float desired,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int *object, int desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float *object, float desired,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double *object,
-+ double desired, memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long *object, long desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired,
-+ memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long *object, long desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // cl_khr_fp64
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_load()
--
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
- int __ovld atomic_load(volatile atomic_int *object);
--int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order);
--int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order, memory_scope scope);
- uint __ovld atomic_load(volatile atomic_uint *object);
--uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order);
--uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order, memory_scope scope);
- float __ovld atomic_load(volatile atomic_float *object);
--float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order);
--float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld atomic_load(volatile atomic_double *object);
--double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order);
--double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif // cl_khr_fp64
- long __ovld atomic_load(volatile atomic_long *object);
--long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order);
--long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order, memory_scope scope);
- ulong __ovld atomic_load(volatile atomic_ulong *object);
--ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order);
--ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order, memory_scope scope);
--#endif
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif //__opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+int __ovld atomic_load(volatile atomic_int __global *object);
-+int __ovld atomic_load(volatile atomic_int __local *object);
-+uint __ovld atomic_load(volatile atomic_uint __global *object);
-+uint __ovld atomic_load(volatile atomic_uint __local *object);
-+float __ovld atomic_load(volatile atomic_float __global *object);
-+float __ovld atomic_load(volatile atomic_float __local *object);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+double __ovld atomic_load(volatile atomic_double __global *object);
-+double __ovld atomic_load(volatile atomic_double __local *object);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+long __ovld atomic_load(volatile atomic_long __global *object);
-+long __ovld atomic_load(volatile atomic_long __local *object);
-+ulong __ovld atomic_load(volatile atomic_ulong __global *object);
-+ulong __ovld atomic_load(volatile atomic_ulong __local *object);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float *object,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong *object,
-+ memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int __global *object,
-+ memory_order order);
-+int __ovld atomic_load_explicit(volatile atomic_int __local *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __global *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __local *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float __global *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int __global *object,
-+ memory_order order, memory_scope scope);
-+int __ovld atomic_load_explicit(volatile atomic_int __local *object,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __global *object,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __local *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float __global *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float __local *object,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double __global *object,
-+ memory_order order);
-+double __ovld atomic_load_explicit(volatile atomic_double __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double __global *object,
-+ memory_order order, memory_scope scope);
-+double __ovld atomic_load_explicit(volatile atomic_double __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long __global *object,
-+ memory_order order);
-+long __ovld atomic_load_explicit(volatile atomic_long __local *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __global *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long __global *object,
-+ memory_order order, memory_scope scope);
-+long __ovld atomic_load_explicit(volatile atomic_long __local *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __global *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_exchange()
--
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
- int __ovld atomic_exchange(volatile atomic_int *object, int desired);
--int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order);
--int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope);
- uint __ovld atomic_exchange(volatile atomic_uint *object, uint desired);
--uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order);
--uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope);
- float __ovld atomic_exchange(volatile atomic_float *object, float desired);
--float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order);
--float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld atomic_exchange(volatile atomic_double *object, double desired);
--double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order);
--double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif
- long __ovld atomic_exchange(volatile atomic_long *object, long desired);
--long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order);
--long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope);
- ulong __ovld atomic_exchange(volatile atomic_ulong *object, ulong desired);
--ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order);
--ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+int __ovld atomic_exchange(volatile atomic_int __global *object, int desired);
-+int __ovld atomic_exchange(volatile atomic_int __local *object, int desired);
-+uint __ovld atomic_exchange(volatile atomic_uint __global *object,
-+ uint desired);
-+uint __ovld atomic_exchange(volatile atomic_uint __local *object, uint desired);
-+float __ovld atomic_exchange(volatile atomic_float __global *object,
-+ float desired);
-+float __ovld atomic_exchange(volatile atomic_float __local *object,
-+ float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+double __ovld atomic_exchange(volatile atomic_double __global *object,
-+ double desired);
-+double __ovld atomic_exchange(volatile atomic_double __local *object,
-+ double desired);
- #endif
-+long __ovld atomic_exchange(volatile atomic_long __global *object,
-+ long desired);
-+long __ovld atomic_exchange(volatile atomic_long __local *object, long desired);
-+ulong __ovld atomic_exchange(volatile atomic_ulong __global *object,
-+ ulong desired);
-+ulong __ovld atomic_exchange(volatile atomic_ulong __local *object,
-+ ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired,
-+ memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double *object,
-+ double desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired,
-+ memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order);
-+int __ovld atomic_exchange_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_exchange_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order);
-+double __ovld atomic_exchange_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_exchange_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order);
-+long __ovld atomic_exchange_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_exchange_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_compare_exchange_strong() and atomic_compare_exchange_weak()
--
--bool __ovld atomic_compare_exchange_strong(volatile atomic_int *object, int *expected, int desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object, uint *expected, uint desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object, int *expected, int desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object, uint *expected, uint desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object, float *expected, float desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object, float *expected, float desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure, memory_scope scope);
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int *object,
-+ int *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object,
-+ uint *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object,
-+ int *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object,
-+ uint *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object,
-+ float *expected, float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object,
-+ float *expected, float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object,
-+ double *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object,
-+ double *expected, double desired);
-+#endif
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object,
-+ long *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object,
-+ long *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object,
-+ ulong *expected, ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object,
-+ ulong *expected, ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __private *expected,
-+ int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __private *expected,
-+ int desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __global *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __local *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __private *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __private *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __private *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __global *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __global *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __local *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __local *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __private *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __private *expected, float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __global *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __global *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __local *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __local *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __private *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __private *expected,
-+ float desired);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
--bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object, double *expected, double desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object, double *expected, double desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure, memory_scope scope);
--#endif //cl_khr_fp64
--bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object, long *expected, long desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object, long *expected, long desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object, ulong *expected, ulong desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object, ulong *expected, ulong desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure, memory_scope scope);
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __global *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __global *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __local *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __local *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __private *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __private *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __global *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __global *expected,
-+ double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __local *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __local *expected,
-+ double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __private *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __private *expected,
-+ double desired);
- #endif
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __global *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __local *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __private *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __global *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __global *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __local *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __local *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __private *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __private *expected, ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __global *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __global *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __local *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __local *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __private *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __private *expected,
-+ ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint *object, uint *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object,
-+ uint *expected, uint desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object,
-+ float *expected,
-+ float desired,
-+ memory_order success,
-+ memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint *object, uint *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object,
-+ uint *expected, uint desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long *object, long *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object,
-+ long *expected, long desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object,
-+ ulong *expected,
-+ ulong desired,
-+ memory_order success,
-+ memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long *object, long *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object,
-+ long *expected, long desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_flag_test_and_set() and atomic_flag_clear()
--
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+#ifdef __opencl_c_generic_address_space
- bool __ovld atomic_flag_test_and_set(volatile atomic_flag *object);
--bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order);
--bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope);
- void __ovld atomic_flag_clear(volatile atomic_flag *object);
--void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order);
--void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope);
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+bool __ovld atomic_flag_test_and_set(volatile atomic_flag __global *object);
-+bool __ovld atomic_flag_test_and_set(volatile atomic_flag __local *object);
-+void __ovld atomic_flag_clear(volatile atomic_flag __global *object);
-+void __ovld atomic_flag_clear(volatile atomic_flag __local *object);
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
-+ memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
-+ memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object,
-+ memory_order order, memory_scope scope);
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(
-+ volatile atomic_flag __global *object, memory_order order);
-+bool __ovld atomic_flag_test_and_set_explicit(
-+ volatile atomic_flag __local *object, memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __global *object,
-+ memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld
-+atomic_flag_test_and_set_explicit(volatile atomic_flag __global *object,
-+ memory_order order, memory_scope scope);
-+bool __ovld
-+atomic_flag_test_and_set_explicit(volatile atomic_flag __local *object,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __global *object,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
-@@ -13918,7 +15943,7 @@ float16 __ovld __cnfn shuffle(float4 x, uint16 mask);
- float16 __ovld __cnfn shuffle(float8 x, uint16 mask);
- float16 __ovld __cnfn shuffle(float16 x, uint16 mask);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld __cnfn shuffle(double2 x, ulong2 mask);
- double2 __ovld __cnfn shuffle(double4 x, ulong2 mask);
- double2 __ovld __cnfn shuffle(double8 x, ulong2 mask);
-@@ -13938,7 +15963,7 @@ double16 __ovld __cnfn shuffle(double2 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double4 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double8 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double16 x, ulong16 mask);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half2 __ovld __cnfn shuffle(half2 x, ushort2 mask);
-@@ -14142,7 +16167,7 @@ float16 __ovld __cnfn shuffle2(float4 x, float4 y, uint16 mask);
- float16 __ovld __cnfn shuffle2(float8 x, float8 y, uint16 mask);
- float16 __ovld __cnfn shuffle2(float16 x, float16 y, uint16 mask);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld __cnfn shuffle2(double2 x, double2 y, ulong2 mask);
- double2 __ovld __cnfn shuffle2(double4 x, double4 y, ulong2 mask);
- double2 __ovld __cnfn shuffle2(double8 x, double8 y, ulong2 mask);
-@@ -14162,7 +16187,7 @@ double16 __ovld __cnfn shuffle2(double2 x, double2 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double4 x, double4 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double8 x, double8 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double16 x, double16 y, ulong16 mask);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half2 __ovld __cnfn shuffle2(half2 x, half2 y, ushort2 mask);
-@@ -14198,6 +16223,7 @@ int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)))
- #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
- #endif //cl_khr_gl_msaa_sharing
-
-+#ifdef __opencl_c_images
- /**
- * Use the coordinate (coord.xy) to do an element lookup in
- * the 2D image object specified by image.
-@@ -14476,6 +16502,7 @@ half4 __purefn __ovld read_imageh(read_only image1d_buffer_t image, int coord);
-
- // Image read functions for read_write images
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- float4 __purefn __ovld read_imagef(read_write image1d_t image, int coord);
- int4 __purefn __ovld read_imagei(read_write image1d_t image, int coord);
- uint4 __purefn __ovld read_imageui(read_write image1d_t image, int coord);
-@@ -14519,6 +16546,7 @@ float __purefn __ovld read_imagef(read_write image2d_array_msaa_depth_t image, i
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- #ifdef cl_khr_mipmap_image
- float4 __purefn __ovld read_imagef(read_write image1d_t image, sampler_t sampler, float coord, float lod);
- int4 __purefn __ovld read_imagei(read_write image1d_t image, sampler_t sampler, float coord, float lod);
-@@ -14569,6 +16597,7 @@ int4 __purefn __ovld read_imagei(read_write image3d_t image, sampler_t sampler,
- uint4 __purefn __ovld read_imageui(read_write image3d_t image, sampler_t sampler, float4 coord, float4 gradientX, float4 gradientY);
-
- #endif //cl_khr_mipmap_image
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // Image read functions returning half4 type
-@@ -14580,6 +16609,7 @@ half4 __purefn __ovld read_imageh(read_write image1d_array_t image, int2 coord);
- half4 __purefn __ovld read_imageh(read_write image2d_array_t image, int4 coord);
- half4 __purefn __ovld read_imageh(read_write image1d_buffer_t image, int coord);
- #endif //cl_khr_fp16
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14669,7 +16699,7 @@ void __ovld write_imagef(write_only image1d_array_t image_array, int2 coord, flo
- void __ovld write_imagei(write_only image1d_array_t image_array, int2 coord, int4 color);
- void __ovld write_imageui(write_only image1d_array_t image_array, int2 coord, uint4 color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(write_only image3d_t image, int4 coord, float4 color);
- void __ovld write_imagei(write_only image3d_t image, int4 coord, int4 color);
- void __ovld write_imageui(write_only image3d_t image, int4 coord, uint4 color);
-@@ -14702,7 +16732,7 @@ void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, in
- void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, int lod, float depth);
- void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, int lod, float depth);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(write_only image3d_t image, int4 coord, int lod, float4 color);
- void __ovld write_imagei(write_only image3d_t image, int4 coord, int lod, int4 color);
- void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4 color);
-@@ -14715,7 +16745,7 @@ void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4
- #ifdef cl_khr_fp16
- void __ovld write_imageh(write_only image1d_t image, int coord, half4 color);
- void __ovld write_imageh(write_only image2d_t image, int2 coord, half4 color);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imageh(write_only image3d_t image, int4 coord, half4 color);
- #endif
- void __ovld write_imageh(write_only image1d_array_t image, int2 coord, half4 color);
-@@ -14725,6 +16755,7 @@ void __ovld write_imageh(write_only image1d_buffer_t image, int coord, half4 col
-
- // Image write functions for read_write images
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- void __ovld write_imagef(read_write image2d_t image, int2 coord, float4 color);
- void __ovld write_imagei(read_write image2d_t image, int2 coord, int4 color);
- void __ovld write_imageui(read_write image2d_t image, int2 coord, uint4 color);
-@@ -14745,7 +16776,7 @@ void __ovld write_imagef(read_write image1d_array_t image_array, int2 coord, flo
- void __ovld write_imagei(read_write image1d_array_t image_array, int2 coord, int4 color);
- void __ovld write_imageui(read_write image1d_array_t image_array, int2 coord, uint4 color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(read_write image3d_t image, int4 coord, float4 color);
- void __ovld write_imagei(read_write image3d_t image, int4 coord, int4 color);
- void __ovld write_imageui(read_write image3d_t image, int4 coord, uint4 color);
-@@ -14777,7 +16808,7 @@ void __ovld write_imageui(read_write image2d_array_t image_array, int4 coord, in
- void __ovld write_imagef(read_write image2d_depth_t image, int2 coord, int lod, float color);
- void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int lod, float color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color);
- void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color);
- void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color);
-@@ -14790,13 +16821,14 @@ void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4
- #ifdef cl_khr_fp16
- void __ovld write_imageh(read_write image1d_t image, int coord, half4 color);
- void __ovld write_imageh(read_write image2d_t image, int2 coord, half4 color);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imageh(read_write image3d_t image, int4 coord, half4 color);
- #endif
- void __ovld write_imageh(read_write image1d_array_t image, int2 coord, half4 color);
- void __ovld write_imageh(read_write image2d_array_t image, int4 coord, half4 color);
- void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 color);
- #endif //cl_khr_fp16
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // Note: In OpenCL v1.0/1.1/1.2, image argument of image query builtin functions does not have
-@@ -14810,7 +16842,7 @@ void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 col
- int __ovld __cnfn get_image_width(read_only image1d_t image);
- int __ovld __cnfn get_image_width(read_only image1d_buffer_t image);
- int __ovld __cnfn get_image_width(read_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_width(read_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_width(read_only image1d_array_t image);
-@@ -14829,7 +16861,7 @@ int __ovld __cnfn get_image_width(read_only image2d_array_msaa_depth_t image);
- int __ovld __cnfn get_image_width(write_only image1d_t image);
- int __ovld __cnfn get_image_width(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_width(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_width(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_width(write_only image1d_array_t image);
-@@ -14846,6 +16878,7 @@ int __ovld __cnfn get_image_width(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_width(read_write image1d_t image);
- int __ovld __cnfn get_image_width(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_width(read_write image2d_t image);
-@@ -14862,6 +16895,7 @@ int __ovld __cnfn get_image_width(read_write image2d_msaa_depth_t image);
- int __ovld __cnfn get_image_width(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_width(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14882,7 +16916,7 @@ int __ovld __cnfn get_image_height(read_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- int __ovld __cnfn get_image_height(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_height(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_height(write_only image2d_array_t image);
-@@ -14898,6 +16932,7 @@ int __ovld __cnfn get_image_height(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_height(read_write image2d_t image);
- int __ovld __cnfn get_image_height(read_write image3d_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_t image);
-@@ -14911,6 +16946,7 @@ int __ovld __cnfn get_image_height(read_write image2d_msaa_depth_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14918,12 +16954,14 @@ int __ovld __cnfn get_image_height(read_write image2d_array_msaa_depth_t image);
- */
- int __ovld __cnfn get_image_depth(read_only image3d_t image);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_depth(write_only image3d_t image);
- #endif
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_depth(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL Extension v2.0 s9.18 - Mipmaps
-@@ -14939,13 +16977,15 @@ int __ovld get_image_num_mip_levels(read_only image3d_t image);
-
- int __ovld get_image_num_mip_levels(write_only image1d_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld get_image_num_mip_levels(write_only image3d_t image);
- #endif
-
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_mip_levels(read_write image1d_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_t image);
- int __ovld get_image_num_mip_levels(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
-
- int __ovld get_image_num_mip_levels(read_only image1d_array_t image);
- int __ovld get_image_num_mip_levels(read_only image2d_array_t image);
-@@ -14957,10 +16997,12 @@ int __ovld get_image_num_mip_levels(write_only image2d_array_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_array_depth_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_depth_t image);
-
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_mip_levels(read_write image1d_array_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_array_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_array_depth_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_depth_t image);
-+#endif //__opencl_c_read_write_images
-
- #endif //cl_khr_mipmap_image
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-@@ -15004,7 +17046,7 @@ int __ovld __cnfn get_image_channel_data_type(read_only image2d_array_msaa_depth
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_t image);
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_data_type(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_channel_data_type(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_array_t image);
-@@ -15021,6 +17063,7 @@ int __ovld __cnfn get_image_channel_data_type(write_only image2d_array_msaa_dept
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_channel_data_type(read_write image1d_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_t image);
-@@ -15037,6 +17080,7 @@ int __ovld __cnfn get_image_channel_data_type(read_write image2d_msaa_depth_t im
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15076,7 +17120,7 @@ int __ovld __cnfn get_image_channel_order(read_only image2d_array_msaa_depth_t i
- int __ovld __cnfn get_image_channel_order(write_only image1d_t image);
- int __ovld __cnfn get_image_channel_order(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_order(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_channel_order(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_channel_order(write_only image1d_array_t image);
-@@ -15093,6 +17137,7 @@ int __ovld __cnfn get_image_channel_order(write_only image2d_array_msaa_depth_t
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_channel_order(read_write image1d_t image);
- int __ovld __cnfn get_image_channel_order(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_order(read_write image2d_t image);
-@@ -15109,6 +17154,7 @@ int __ovld __cnfn get_image_channel_order(read_write image2d_msaa_depth_t image)
- int __ovld __cnfn get_image_channel_order(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_channel_order(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15143,6 +17189,7 @@ int2 __ovld __cnfn get_image_dim(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int2 __ovld __cnfn get_image_dim(read_write image2d_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_t image);
- #ifdef cl_khr_depth_images
-@@ -15155,6 +17202,7 @@ int2 __ovld __cnfn get_image_dim(read_write image2d_msaa_depth_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15164,11 +17212,13 @@ int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_depth_t image);
- * component and the w component is 0.
- */
- int4 __ovld __cnfn get_image_dim(read_only image3d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int4 __ovld __cnfn get_image_dim(write_only image3d_t image);
- #endif
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int4 __ovld __cnfn get_image_dim(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15196,6 +17246,7 @@ size_t __ovld __cnfn get_image_array_size(write_only image2d_array_msaa_depth_t
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- size_t __ovld __cnfn get_image_array_size(read_write image1d_array_t image_array);
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_t image_array);
- #ifdef cl_khr_depth_images
-@@ -15205,6 +17256,7 @@ size_t __ovld __cnfn get_image_array_size(read_write image2d_array_depth_t image
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_msaa_t image_array);
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_msaa_depth_t image_array);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15222,16 +17274,21 @@ int __ovld get_image_num_samples(write_only image2d_array_msaa_t image);
- int __ovld get_image_num_samples(write_only image2d_array_msaa_depth_t image);
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_samples(read_write image2d_msaa_t image);
- int __ovld get_image_num_samples(read_write image2d_msaa_depth_t image);
- int __ovld get_image_num_samples(read_write image2d_array_msaa_t image);
- int __ovld get_image_num_samples(read_write image2d_array_msaa_depth_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
- #endif
-
-+#endif //__opencl_c_images
-+
- // OpenCL v2.0 s6.13.15 - Work-group Functions
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_work_group_collective_functions
- int __ovld __conv work_group_all(int predicate);
- int __ovld __conv work_group_any(int predicate);
-
-@@ -15255,11 +17312,11 @@ ulong __ovld __conv work_group_broadcast(ulong a, size_t x, size_t y, size_t z);
- float __ovld __conv work_group_broadcast(float a, size_t local_id);
- float __ovld __conv work_group_broadcast(float a, size_t x, size_t y);
- float __ovld __conv work_group_broadcast(float a, size_t x, size_t y, size_t z);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv work_group_broadcast(double a, size_t local_id);
- double __ovld __conv work_group_broadcast(double a, size_t x, size_t y);
- double __ovld __conv work_group_broadcast(double a, size_t x, size_t y, size_t z);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld __conv work_group_reduce_add(half x);
-@@ -15317,7 +17374,7 @@ float __ovld __conv work_group_scan_exclusive_max(float x);
- float __ovld __conv work_group_scan_inclusive_add(float x);
- float __ovld __conv work_group_scan_inclusive_min(float x);
- float __ovld __conv work_group_scan_inclusive_max(float x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv work_group_reduce_add(double x);
- double __ovld __conv work_group_reduce_min(double x);
- double __ovld __conv work_group_reduce_max(double x);
-@@ -15327,19 +17384,18 @@ double __ovld __conv work_group_scan_exclusive_max(double x);
- double __ovld __conv work_group_scan_inclusive_add(double x);
- double __ovld __conv work_group_scan_inclusive_min(double x);
- double __ovld __conv work_group_scan_inclusive_max(double x);
--#endif //cl_khr_fp64
--
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_work_group_collective_functions
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL v2.0 s6.13.16 - Pipe Functions
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_pipes
- bool __ovld is_valid_reserve_id(reserve_id_t reserve_id);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //__opencl_c_pipes
-
- // OpenCL v2.0 s6.13.17 - Enqueue Kernels
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#ifdef __opencl_c_device_enqueue
- ndrange_t __ovld ndrange_1D(size_t);
- ndrange_t __ovld ndrange_1D(size_t, size_t);
- ndrange_t __ovld ndrange_1D(size_t, size_t, size_t);
-@@ -15367,11 +17423,13 @@ bool __ovld is_valid_event (clk_event_t event);
- void __ovld capture_event_profiling_info(clk_event_t, clk_profiling_info, __global void* value);
-
- queue_t __ovld get_default_queue(void);
-+#endif //__opencl_c_device_enqueue
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL Extension v2.0 s9.17 - Sub-groups
-
--#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups)
-+#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || \
-+ defined(__opencl_c_subgroups)
- // Shared Sub Group Functions
- uint __ovld get_sub_group_size(void);
- uint __ovld get_max_sub_group_size(void);
-@@ -15457,7 +17515,7 @@ half __ovld __conv sub_group_scan_inclusive_min(half x);
- half __ovld __conv sub_group_scan_inclusive_max(half x);
- #endif //cl_khr_fp16
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv sub_group_broadcast(double x, uint sub_group_local_id);
- double __ovld __conv sub_group_reduce_add(double x);
- double __ovld __conv sub_group_reduce_min(double x);
-@@ -15468,7 +17526,7 @@ double __ovld __conv sub_group_scan_exclusive_max(double x);
- double __ovld __conv sub_group_scan_inclusive_add(double x);
- double __ovld __conv sub_group_scan_inclusive_min(double x);
- double __ovld __conv sub_group_scan_inclusive_max(double x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #endif //cl_khr_subgroups cl_intel_subgroups
-
-@@ -15570,16 +17628,22 @@ uint16 __ovld __conv intel_sub_group_shuffle_xor( uint16 x, uint c );
- long __ovld __conv intel_sub_group_shuffle_xor( long x, uint c );
- ulong __ovld __conv intel_sub_group_shuffle_xor( ulong x, uint c );
-
-+#ifdef __opencl_c_images
- uint __ovld __conv intel_sub_group_block_read( read_only image2d_t image, int2 coord );
- uint2 __ovld __conv intel_sub_group_block_read2( read_only image2d_t image, int2 coord );
- uint4 __ovld __conv intel_sub_group_block_read4( read_only image2d_t image, int2 coord );
- uint8 __ovld __conv intel_sub_group_block_read8( read_only image2d_t image, int2 coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- uint __ovld __conv intel_sub_group_block_read(read_write image2d_t image, int2 coord);
- uint2 __ovld __conv intel_sub_group_block_read2(read_write image2d_t image, int2 coord);
- uint4 __ovld __conv intel_sub_group_block_read4(read_write image2d_t image, int2 coord);
- uint8 __ovld __conv intel_sub_group_block_read8(read_write image2d_t image, int2 coord);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- uint __ovld __conv intel_sub_group_block_read( const __global uint* p );
-@@ -15587,16 +17651,22 @@ uint2 __ovld __conv intel_sub_group_block_read2( const __global uint* p );
- uint4 __ovld __conv intel_sub_group_block_read4( const __global uint* p );
- uint8 __ovld __conv intel_sub_group_block_read8( const __global uint* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write(write_only image2d_t image, int2 coord, uint data);
- void __ovld __conv intel_sub_group_block_write2(write_only image2d_t image, int2 coord, uint2 data);
- void __ovld __conv intel_sub_group_block_write4(write_only image2d_t image, int2 coord, uint4 data);
- void __ovld __conv intel_sub_group_block_write8(write_only image2d_t image, int2 coord, uint8 data);
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write(read_write image2d_t image, int2 coord, uint data);
- void __ovld __conv intel_sub_group_block_write2(read_write image2d_t image, int2 coord, uint2 data);
- void __ovld __conv intel_sub_group_block_write4(read_write image2d_t image, int2 coord, uint4 data);
- void __ovld __conv intel_sub_group_block_write8(read_write image2d_t image, int2 coord, uint8 data);
-+#endif // __opencl_c_read_write_images
-+#endif // __opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write( __global uint* p, uint data );
-@@ -15611,7 +17681,7 @@ half __ovld __conv intel_sub_group_shuffle_up( half prev, half cur, uint c );
- half __ovld __conv intel_sub_group_shuffle_xor( half x, uint c );
- #endif
-
--#if defined(cl_khr_fp64)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv intel_sub_group_shuffle( double x, uint c );
- double __ovld __conv intel_sub_group_shuffle_down( double prev, double cur, uint c );
- double __ovld __conv intel_sub_group_shuffle_up( double prev, double cur, uint c );
-@@ -15710,16 +17780,22 @@ ushort __ovld __conv intel_sub_group_scan_inclusive_min( ushort x );
- short __ovld __conv intel_sub_group_scan_inclusive_max( short x );
- ushort __ovld __conv intel_sub_group_scan_inclusive_max( ushort x );
-
-+#ifdef __opencl_c_images
- uint __ovld __conv intel_sub_group_block_read_ui( read_only image2d_t image, int2 byte_coord );
- uint2 __ovld __conv intel_sub_group_block_read_ui2( read_only image2d_t image, int2 byte_coord );
- uint4 __ovld __conv intel_sub_group_block_read_ui4( read_only image2d_t image, int2 byte_coord );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( read_only image2d_t image, int2 byte_coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- uint __ovld __conv intel_sub_group_block_read_ui( read_write image2d_t image, int2 byte_coord );
- uint2 __ovld __conv intel_sub_group_block_read_ui2( read_write image2d_t image, int2 byte_coord );
- uint4 __ovld __conv intel_sub_group_block_read_ui4( read_write image2d_t image, int2 byte_coord );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( read_write image2d_t image, int2 byte_coord );
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- uint __ovld __conv intel_sub_group_block_read_ui( const __global uint* p );
-@@ -15727,16 +17803,22 @@ uint2 __ovld __conv intel_sub_group_block_read_ui2( const __global uint* p
- uint4 __ovld __conv intel_sub_group_block_read_ui4( const __global uint* p );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( const __global uint* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write_ui( read_only image2d_t image, int2 byte_coord, uint data );
- void __ovld __conv intel_sub_group_block_write_ui2( read_only image2d_t image, int2 byte_coord, uint2 data );
- void __ovld __conv intel_sub_group_block_write_ui4( read_only image2d_t image, int2 byte_coord, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( read_only image2d_t image, int2 byte_coord, uint8 data );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write_ui( read_write image2d_t image, int2 byte_coord, uint data );
- void __ovld __conv intel_sub_group_block_write_ui2( read_write image2d_t image, int2 byte_coord, uint2 data );
- void __ovld __conv intel_sub_group_block_write_ui4( read_write image2d_t image, int2 byte_coord, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( read_write image2d_t image, int2 byte_coord, uint8 data );
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write_ui( __global uint* p, uint data );
-@@ -15744,16 +17826,22 @@ void __ovld __conv intel_sub_group_block_write_ui2( __global uint* p, uint
- void __ovld __conv intel_sub_group_block_write_ui4( __global uint* p, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( __global uint* p, uint8 data );
-
-+#ifdef __opencl_c_images
- ushort __ovld __conv intel_sub_group_block_read_us( read_only image2d_t image, int2 coord );
- ushort2 __ovld __conv intel_sub_group_block_read_us2( read_only image2d_t image, int2 coord );
- ushort4 __ovld __conv intel_sub_group_block_read_us4( read_only image2d_t image, int2 coord );
- ushort8 __ovld __conv intel_sub_group_block_read_us8( read_only image2d_t image, int2 coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- ushort __ovld __conv intel_sub_group_block_read_us(read_write image2d_t image, int2 coord);
- ushort2 __ovld __conv intel_sub_group_block_read_us2(read_write image2d_t image, int2 coord);
- ushort4 __ovld __conv intel_sub_group_block_read_us4(read_write image2d_t image, int2 coord);
- ushort8 __ovld __conv intel_sub_group_block_read_us8(read_write image2d_t image, int2 coord);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- ushort __ovld __conv intel_sub_group_block_read_us( const __global ushort* p );
-@@ -15761,16 +17849,22 @@ ushort2 __ovld __conv intel_sub_group_block_read_us2( const __global ushort*
- ushort4 __ovld __conv intel_sub_group_block_read_us4( const __global ushort* p );
- ushort8 __ovld __conv intel_sub_group_block_read_us8( const __global ushort* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write_us(write_only image2d_t image, int2 coord, ushort data);
- void __ovld __conv intel_sub_group_block_write_us2(write_only image2d_t image, int2 coord, ushort2 data);
- void __ovld __conv intel_sub_group_block_write_us4(write_only image2d_t image, int2 coord, ushort4 data);
- void __ovld __conv intel_sub_group_block_write_us8(write_only image2d_t image, int2 coord, ushort8 data);
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write_us(read_write image2d_t image, int2 coord, ushort data);
- void __ovld __conv intel_sub_group_block_write_us2(read_write image2d_t image, int2 coord, ushort2 data);
- void __ovld __conv intel_sub_group_block_write_us4(read_write image2d_t image, int2 coord, ushort4 data);
- void __ovld __conv intel_sub_group_block_write_us8(read_write image2d_t image, int2 coord, ushort8 data);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write_us( __global ushort* p, ushort data );
-@@ -15889,6 +17983,7 @@ short2 __ovld intel_sub_group_avc_ime_adjust_ref_offset(
- short2 ref_offset, ushort2 src_coord, ushort2 ref_window_size,
- ushort2 image_size);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_ime_result_t __ovld
- intel_sub_group_avc_ime_evaluate_with_single_reference(
- read_only image2d_t src_image, read_only image2d_t ref_image,
-@@ -15929,6 +18024,7 @@ intel_sub_group_avc_ime_evaluate_with_dual_reference_streaminout(
- read_only image2d_t bwd_ref_image, sampler_t vme_media_sampler,
- intel_sub_group_avc_ime_payload_t payload,
- intel_sub_group_avc_ime_dual_reference_streamin_t streamin_components);
-+#endif //__opencl_c_images
-
- intel_sub_group_avc_ime_single_reference_streamin_t __ovld
- intel_sub_group_avc_ime_get_single_reference_streamin(
-@@ -15993,6 +18089,7 @@ intel_sub_group_avc_ref_payload_t __ovld
- intel_sub_group_avc_ref_set_bilinear_filter_enable(
- intel_sub_group_avc_ref_payload_t payload);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_ref_result_t __ovld
- intel_sub_group_avc_ref_evaluate_with_single_reference(
- read_only image2d_t src_image, read_only image2d_t ref_image,
-@@ -16011,6 +18108,7 @@ intel_sub_group_avc_ref_evaluate_with_multi_reference(
- read_only image2d_t src_image, uint packed_reference_ids,
- uchar packed_reference_field_polarities, sampler_t vme_media_sampler,
- intel_sub_group_avc_ref_payload_t payload);
-+#endif //__opencl_c_images
-
- // SIC built-in functions
- intel_sub_group_avc_sic_payload_t __ovld
-@@ -16061,6 +18159,7 @@ intel_sub_group_avc_sic_set_block_based_raw_skip_sad(
- uchar block_based_skip_type,
- intel_sub_group_avc_sic_payload_t payload);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_sic_result_t __ovld
- intel_sub_group_avc_sic_evaluate_ipe(
- read_only image2d_t src_image, sampler_t vme_media_sampler,
-@@ -16083,6 +18182,7 @@ intel_sub_group_avc_sic_evaluate_with_multi_reference(
- read_only image2d_t src_image, uint packed_reference_ids,
- uchar packed_reference_field_polarities, sampler_t vme_media_sampler,
- intel_sub_group_avc_sic_payload_t payload);
-+#endif //__opencl_c_images
-
- uchar __ovld intel_sub_group_avc_sic_get_ipe_luma_shape(
- intel_sub_group_avc_sic_result_t result);
-diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
-index 6353e14bc41a..a8c216de6e04 100644
---- a/clang/lib/Parse/ParseDecl.cpp
-+++ b/clang/lib/Parse/ParseDecl.cpp
-@@ -3904,8 +3904,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
- isInvalid = DS.SetTypeAltiVecBool(true, Loc, PrevSpec, DiagID, Policy);
- break;
- case tok::kw_pipe:
-- if (!getLangOpts().OpenCL || (getLangOpts().OpenCLVersion < 200 &&
-- !getLangOpts().OpenCLCPlusPlus)) {
-+ if (!getLangOpts().OpenCLPipeKeyword) {
- // OpenCL 2.0 defined this keyword. OpenCL 1.2 and earlier should
- // support the "pipe" word as identifier.
- Tok.getIdentifierInfo()->revertTokenIDToIdentifier();
-@@ -4027,8 +4026,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
- case tok::kw___generic:
- // generic address space is introduced only in OpenCL v2.0
- // see OpenCL C Spec v2.0 s6.5.5
-- if (Actions.getLangOpts().OpenCLVersion < 200 &&
-- !Actions.getLangOpts().OpenCLCPlusPlus) {
-+ if (!Actions.getLangOpts().OpenCLGenericKeyword) {
- DiagID = diag::err_opencl_unknown_type_specifier;
- PrevSpec = Tok.getIdentifierInfo()->getNameStart();
- isInvalid = true;
-@@ -5050,8 +5048,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
- default: return false;
-
- case tok::kw_pipe:
-- return (getLangOpts().OpenCL && getLangOpts().OpenCLVersion >= 200) ||
-- getLangOpts().OpenCLCPlusPlus;
-+ return getLangOpts().OpenCLPipeKeyword;
-
- case tok::identifier: // foo::bar
- // Unfortunate hack to support "Class.factoryMethod" notation.
-@@ -5557,8 +5554,7 @@ static bool isPtrOperatorToken(tok::TokenKind Kind, const LangOptions &Lang,
- if (Kind == tok::star || Kind == tok::caret)
- return true;
-
-- if (Kind == tok::kw_pipe &&
-- ((Lang.OpenCL && Lang.OpenCLVersion >= 200) || Lang.OpenCLCPlusPlus))
-+ if (Kind == tok::kw_pipe && Lang.OpenCLPipeKeyword)
- return true;
-
- if (!Lang.CPlusPlus)
-diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
-index df411e1928d6..9a40ce888695 100644
---- a/clang/lib/Parse/ParsePragma.cpp
-+++ b/clang/lib/Parse/ParsePragma.cpp
-@@ -697,12 +697,14 @@ void Parser::HandlePragmaOpenCLExtension() {
- if (Name == "all") {
- if (State == Disable) {
- Opt.disableAll();
-- Opt.enableSupportedCore(getLangOpts());
-+ Opt.enableSupportedCore();
- } else {
- PP.Diag(NameLoc, diag::warn_pragma_expected_predicate) << 1;
- }
-+ } else if (Opt.isFeature(Name)) {
-+ PP.Diag(NameLoc, diag::warn_opencl_pragma_feature_ignore) << Ident;
- } else if (State == Begin) {
-- if (!Opt.isKnown(Name) || !Opt.isSupported(Name, getLangOpts())) {
-+ if (!Opt.isKnown(Name) || !Opt.isSupported(Name)) {
- Opt.support(Name);
- }
- Actions.setCurrentOpenCLExtension(Name);
-@@ -712,9 +714,9 @@ void Parser::HandlePragmaOpenCLExtension() {
- Actions.setCurrentOpenCLExtension("");
- } else if (!Opt.isKnown(Name))
- PP.Diag(NameLoc, diag::warn_pragma_unknown_extension) << Ident;
-- else if (Opt.isSupportedExtension(Name, getLangOpts()))
-+ else if (Opt.isSupportedExtension(Name))
- Opt.enable(Name, State == Enable);
-- else if (Opt.isSupportedCore(Name, getLangOpts()))
-+ else if (Opt.isSupportedCore(Name))
- PP.Diag(NameLoc, diag::warn_pragma_extension_is_core) << Ident;
- else
- PP.Diag(NameLoc, diag::warn_pragma_unsupported_extension) << Ident;
-diff --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
-index 9d6bb411eff8..d352d35f1e46 100644
---- a/clang/lib/Sema/OpenCLBuiltins.td
-+++ b/clang/lib/Sema/OpenCLBuiltins.td
-@@ -22,11 +22,13 @@
- class Version<int _Version> {
- int ID = _Version;
- }
-+
- def CLAll : Version< 0>;
- def CL10 : Version<100>;
- def CL11 : Version<110>;
- def CL12 : Version<120>;
- def CL20 : Version<200>;
-+def CL30 : Version<300>;
-
- // Address spaces
- // Pointer types need to be assigned an address space.
-@@ -65,6 +67,14 @@ def FuncExtKhrGlMsaaSharing : FunctionExtension<"cl_khr_gl_msaa_sha
- // Multiple extensions
- def FuncExtKhrMipmapAndWrite3d : FunctionExtension<"cl_khr_mipmap_image cl_khr_3d_image_writes">;
-
-+// Features
-+def FuncExtGenericAddressSpace : FunctionExtension<"__opencl_c_generic_address_space">;
-+def FuncExtWorkGroupCollective : FunctionExtension<"__opencl_c_work_group_collective_functions">;
-+def FuncExtPipes : FunctionExtension<"__opencl_c_pipes">;
-+def FuncExtDeviceSidEenqueue : FunctionExtension<"__opencl_c_device_enqueue">;
-+def FuncNonExplicitAtomicFeatures : FunctionExtension<"__opencl_c_atomic_order_seq_cst __opencl_c_atomic_scope_device">;
-+def FuncNonExplicitAtomicFeaturesAndGenericAS : FunctionExtension<"__opencl_c_atomic_order_seq_cst __opencl_c_atomic_scope_device __opencl_c_generic_address_space">;
-+
- // Qualified Type. These map to ASTContext::QualType.
- class QualType<string _Name, bit _IsAbstract=0> {
- // Name of the field or function in a clang::ASTContext
-@@ -230,13 +240,9 @@ class Builtin<string _Name, list<Type> _Signature, list<bit> _Attributes = Attr.
- bit IsConv = _Attributes[2];
- // OpenCL extensions to which the function belongs.
- FunctionExtension Extension = FuncExtNone;
-- // Version of OpenCL from which the function is available (e.g.: CL10).
-- // MinVersion is inclusive.
-- Version MinVersion = CL10;
-- // Version of OpenCL from which the function is not supported anymore.
-- // MaxVersion is exclusive.
-+ // List of OpenCL version in which this function available.
- // CLAll makes the function available for all versions.
-- Version MaxVersion = CLAll;
-+ list<Version> Versions = [CLAll];
- }
-
- //===----------------------------------------------------------------------===//
-@@ -398,7 +404,7 @@ foreach name = ["get_global_size", "get_global_id", "get_local_size",
- def : Builtin<name, [Size, UInt], Attr.Const>;
- }
-
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
- def : Builtin<"get_enqueued_local_size", [Size, UInt]>;
- foreach name = ["get_global_linear_id", "get_local_linear_id"] in {
- def : Builtin<name, [Size]>;
-@@ -471,7 +477,7 @@ foreach name = ["fma", "mad"] in {
- }
-
- // --- Version dependent ---
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- foreach name = ["fract", "modf", "sincos"] in {
- def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, AS>]>;
-@@ -488,7 +494,9 @@ let MaxVersion = CL20 in {
- }
- }
- }
--let MinVersion = CL20 in {
-+
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach name = ["fract", "modf", "sincos"] in {
- def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, GenericAS>]>;
- }
-@@ -501,6 +509,7 @@ let MinVersion = CL20 in {
- def : Builtin<name, [Type, Type, Type, PointerType<GenTypeIntVecAndScalar, GenericAS>]>;
- }
- }
-+ }
- }
-
- // --- Table 9 ---
-@@ -531,7 +540,7 @@ foreach name = ["abs"] in {
- foreach name = ["clz", "popcount"] in {
- def : Builtin<name, [AIGenTypeN, AIGenTypeN], Attr.Const>;
- }
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
- foreach name = ["ctz"] in {
- def : Builtin<name, [AIGenTypeN, AIGenTypeN]>;
- }
-@@ -705,7 +714,7 @@ foreach name = ["select"] in {
- // --- Table 15 ---
- // Variants for OpenCL versions below 2.0, using pointers to the global, local
- // and private address spaces.
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- foreach VSize = [2, 3, 4, 8, 16] in {
- foreach name = ["vload" # VSize] in {
-@@ -748,7 +757,8 @@ let MaxVersion = CL20 in {
- }
- // Variants for OpenCL versions above 2.0, using pointers to the generic
- // address space.
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach VSize = [2, 3, 4, 8, 16] in {
- foreach name = ["vload" # VSize] in {
- def : Builtin<name, [VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, GenericAS>]>;
-@@ -786,6 +796,7 @@ let MinVersion = CL20 in {
- }
- }
- }
-+ }
- }
- // Variants using pointers to the constant address space.
- foreach VSize = [2, 3, 4, 8, 16] in {
-@@ -812,7 +823,7 @@ foreach VSize = [2, 3, 4, 8, 16] in {
- }
- }
- }
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
- foreach VSize = [2, 3, 4, 8, 16] in {
-@@ -832,7 +843,8 @@ let MaxVersion = CL20 in {
- }
- }
- }
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach AS = [GenericAS] in {
- def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
- foreach VSize = [2, 3, 4, 8, 16] in {
-@@ -851,6 +863,7 @@ let MinVersion = CL20 in {
- }
- }
- }
-+ }
- }
-
- foreach AS = [ConstantAS] in {
-@@ -875,7 +888,9 @@ foreach name = ["async_work_group_strided_copy"] in {
- def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Size, Event]>;
- }
- foreach name = ["wait_group_events"] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- def : Builtin<name, [Void, Int, PointerType<Event, GenericAS>]>;
-+ }
- }
- foreach name = ["prefetch"] in {
- def : Builtin<name, [Void, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size]>;
-@@ -1154,7 +1169,8 @@ foreach aQual = ["WO", "RW"] in {
- //--------------------------------------------------------------------
- // OpenCL v2.0 s6.13.15 - Work-group Functions
- // --- Table 26 ---
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtWorkGroupCollective in {
- foreach name = ["work_group_all", "work_group_any"] in {
- def : Builtin<name, [Int, Int], Attr.Convergent>;
- }
-@@ -1169,11 +1185,12 @@ let MinVersion = CL20 in {
- def : Builtin<name # op, [IntLongFloatGenType1, IntLongFloatGenType1], Attr.Convergent>;
- }
- }
-+ }
- }
-
-
- // OpenCL v2.0 s9.17.3: Additions to section 6.13.1: Work-Item Functions
--let MinVersion = CL20 in {
-+let Versions = [CL20] in {
- let Extension = FuncExtKhrSubgroups in {
- def get_sub_group_size : Builtin<"get_sub_group_size", [UInt]>;
- def get_max_sub_group_size : Builtin<"get_max_sub_group_size", [UInt]>;
-diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
-index 9cfce5a63b1d..c26f45f62668 100644
---- a/clang/lib/Sema/Sema.cpp
-+++ b/clang/lib/Sema/Sema.cpp
-@@ -286,9 +286,10 @@ void Sema::Initialize() {
- // Initialize predefined OpenCL types and supported extensions and (optional)
- // core features.
- if (getLangOpts().OpenCL) {
-+ getOpenCLOptions().setOpenCLVersion(getLangOpts());
- getOpenCLOptions().addSupport(
- Context.getTargetInfo().getSupportedOpenCLOpts());
-- getOpenCLOptions().enableSupportedCore(getLangOpts());
-+ getOpenCLOptions().enableSupportedCore();
- addImplicitTypedef("sampler_t", Context.OCLSamplerTy);
- addImplicitTypedef("event_t", Context.OCLEventTy);
- if (getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) {
-@@ -344,12 +345,18 @@ void Sema::Initialize() {
- "cl_khr_int64_base_atomics cl_khr_int64_extended_atomics");
-
- setOpenCLExtensionForType(AtomicDoubleT, "cl_khr_fp64");
-+ setOpenCLExtensionForType(Context.OCLReserveIDTy, "__opencl_c_pipes");
-+ setOpenCLExtensionForType(Context.OCLClkEventTy,
-+ "__opencl_c_device_enqueue");
-+ setOpenCLExtensionForType(Context.OCLQueueTy,
-+ "__opencl_c_device_enqueue");
- }
-
- setOpenCLExtensionForType(Context.DoubleTy, "cl_khr_fp64");
-
--#define GENERIC_IMAGE_TYPE_EXT(Type, Id, Ext) \
-- setOpenCLExtensionForType(Context.Id, Ext);
-+#define GENERIC_IMAGE_TYPE_EXT(Type, Id, Ext) \
-+ setOpenCLExtensionForType(Context.Id, Ext); \
-+ setOpenCLExtensionForType(Context.Id, "__opencl_c_images");
- #include "clang/Basic/OpenCLImageTypes.def"
- #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
- addImplicitTypedef(#ExtType, Context.Id##Ty); \
-@@ -2293,6 +2300,27 @@ bool Sema::isOpenCLDisabledDecl(Decl *FD) {
- return false;
- }
-
-+template <typename DiagLocT, typename DiagInfoT>
-+void Sema::DiagnoseOpenCLRequiresOption(llvm::StringRef OpenCLOptName,
-+ DiagLocT DiagLoc, DiagInfoT DiagInfo,
-+ unsigned Selector,
-+ SourceRange SrcRange) {
-+ const auto &LO = getLangOpts();
-+ auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
-+ // For versions higher that 3.0 diagnosing feature
-+ if (CLVer >= 300) {
-+ OpenCLOptName =
-+ llvm::StringSwitch<llvm::StringRef>(OpenCLOptName)
-+ .Case("cl_khr_3d_image_writes", "__opencl_c_3d_image_writes")
-+ .Case("cl_khr_subgroups", "__opencl_c_subgroups")
-+ .Case("cl_khr_fp64", "__opencl_c_fp64")
-+ .Default(OpenCLOptName);
-+ }
-+
-+ Diag(DiagLoc, diag::err_opencl_requires_extension)
-+ << Selector << DiagInfo << OpenCLOptName << SrcRange;
-+}
-+
- template <typename T, typename DiagLocT, typename DiagInfoT, typename MapT>
- bool Sema::checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc,
- DiagInfoT DiagInfo, MapT &Map,
-@@ -2304,8 +2332,7 @@ bool Sema::checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc,
- bool Disabled = false;
- for (auto &I : Loc->second) {
- if (I != CurrOpenCLExtension && !getOpenCLOptions().isEnabled(I)) {
-- Diag(DiagLoc, diag::err_opencl_requires_extension) << Selector << DiagInfo
-- << I << SrcRange;
-+ DiagnoseOpenCLRequiresOption(I, DiagLoc, DiagInfo, Selector, SrcRange);
- Disabled = true;
- }
- }
-@@ -2341,3 +2368,13 @@ bool Sema::checkOpenCLDisabledDecl(const NamedDecl &D, const Expr &E) {
- return checkOpenCLDisabledTypeOrDecl(&D, E.getBeginLoc(), FnName,
- OpenCLDeclExtMap, 1, D.getSourceRange());
- }
-+
-+bool Sema::checkOpenCLSubgroupExtForCallExpr(CallExpr *Call) {
-+ if (!getOpenCLOptions().isEnabled("cl_khr_subgroups")) {
-+ DiagnoseOpenCLRequiresOption("cl_khr_subgroups", Call->getBeginLoc(),
-+ Call->getDirectCallee(), 1,
-+ Call->getSourceRange());
-+ return true;
-+ }
-+ return false;
-+}
-diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
-index 74742023d1b3..efa3b6ab0eb6 100644
---- a/clang/lib/Sema/SemaChecking.cpp
-+++ b/clang/lib/Sema/SemaChecking.cpp
-@@ -597,20 +597,11 @@ static bool checkOpenCLBlockArgs(Sema &S, Expr *BlockArg) {
- return IllegalParams;
- }
-
--static bool checkOpenCLSubgroupExt(Sema &S, CallExpr *Call) {
-- if (!S.getOpenCLOptions().isEnabled("cl_khr_subgroups")) {
-- S.Diag(Call->getBeginLoc(), diag::err_opencl_requires_extension)
-- << 1 << Call->getDirectCallee() << "cl_khr_subgroups";
-- return true;
-- }
-- return false;
--}
--
- static bool SemaOpenCLBuiltinNDRangeAndBlock(Sema &S, CallExpr *TheCall) {
- if (checkArgCount(S, TheCall, 2))
- return true;
-
-- if (checkOpenCLSubgroupExt(S, TheCall))
-+ if (S.checkOpenCLSubgroupExtForCallExpr(TheCall))
- return true;
-
- // First argument is an ndrange_t type.
-@@ -1564,7 +1555,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
- break;
- case Builtin::BIsub_group_reserve_read_pipe:
- case Builtin::BIsub_group_reserve_write_pipe:
-- if (checkOpenCLSubgroupExt(*this, TheCall) ||
-+ if (checkOpenCLSubgroupExtForCallExpr(TheCall) ||
- SemaBuiltinReserveRWPipe(*this, TheCall))
- return ExprError();
- break;
-@@ -1577,7 +1568,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
- break;
- case Builtin::BIsub_group_commit_read_pipe:
- case Builtin::BIsub_group_commit_write_pipe:
-- if (checkOpenCLSubgroupExt(*this, TheCall) ||
-+ if (checkOpenCLSubgroupExtForCallExpr(TheCall) ||
- SemaBuiltinCommitRWPipe(*this, TheCall))
- return ExprError();
- break;
-@@ -4314,6 +4305,20 @@ DiagnoseCStringFormatDirectiveInCFAPI(Sema &S,
- }
- }
-
-+bool Sema::isSupportedOpenCLOMemoryOrdering(int64_t Ordering) const {
-+ assert(llvm::isValidAtomicOrderingCABI(Ordering));
-+ auto OrderingCABI = (llvm::AtomicOrderingCABI)Ordering;
-+ switch (OrderingCABI) {
-+ case llvm::AtomicOrderingCABI::acquire:
-+ case llvm::AtomicOrderingCABI::release:
-+ case llvm::AtomicOrderingCABI::acq_rel:
-+ return OpenCLFeatures.isEnabled("__opencl_c_atomic_order_acq_rel");
-+
-+ default:
-+ return true;
-+ }
-+}
-+
- /// Determine whether the given type has a non-null nullability annotation.
- static bool isNonNullType(ASTContext &ctx, QualType type) {
- if (auto nullability = type->getNullability(ctx))
-@@ -5067,10 +5072,17 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
- if (SubExprs.size() >= 2 && Form != Init) {
- llvm::APSInt Result(32);
- if (SubExprs[1]->isIntegerConstantExpr(Result, Context) &&
-- !isValidOrderingForOp(Result.getSExtValue(), Op))
-+ !isValidOrderingForOp(Result.getSExtValue(), Op)) {
- Diag(SubExprs[1]->getBeginLoc(),
- diag::warn_atomic_op_has_invalid_memory_order)
- << SubExprs[1]->getSourceRange();
-+ } else if (IsOpenCL &&
-+ !isSupportedOpenCLOMemoryOrdering(Result.getSExtValue())) {
-+ Diag(SubExprs[1]->getBeginLoc(),
-+ diag::err_opencl_memory_ordering_require_feat)
-+ << SubExprs[1]->getSourceRange();
-+ return ExprError();
-+ }
- }
-
- if (auto ScopeModel = AtomicExpr::getScopeModel(Op)) {
-diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
-index 64146f4a912f..c1e629b5dc76 100644
---- a/clang/lib/Sema/SemaDecl.cpp
-+++ b/clang/lib/Sema/SemaDecl.cpp
-@@ -6152,7 +6152,9 @@ void Sema::deduceOpenCLAddressSpace(ValueDecl *Decl) {
- if (Type->isSamplerT() || Type->isVoidType())
- return;
- LangAS ImplAS = LangAS::opencl_private;
-- if ((getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) &&
-+ if ((getLangOpts().OpenCLCPlusPlus ||
-+ getOpenCLOptions().isEnabled(
-+ "__opencl_c_program_scope_global_variables")) &&
- Var->hasGlobalStorage())
- ImplAS = LangAS::opencl_global;
- // If the original type from a decayed type is an array type and that array
-@@ -7682,6 +7684,10 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
- // OpenCL C v2.0 s6.5.1 - Variables defined at program scope and static
- // variables inside a function can also be declared in the global
- // address space.
-+ // OpenCL C v3.0 s5.5 - For OpenCL C 2.0, or with the
-+ // __opencl_c_program_scope_global_variables feature macro, the
-+ // address space for a variable at program scope or a static variable
-+ // also be __global
- // C++ for OpenCL inherits rule from OpenCL C v2.0.
- // FIXME: Adding local AS in C++ for OpenCL might make sense.
- if (NewVD->isFileVarDecl() || NewVD->isStaticLocal() ||
-@@ -7689,10 +7695,11 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
- if (!T->isSamplerT() &&
- !(T.getAddressSpace() == LangAS::opencl_constant ||
- (T.getAddressSpace() == LangAS::opencl_global &&
-- (getLangOpts().OpenCLVersion == 200 ||
-- getLangOpts().OpenCLCPlusPlus)))) {
-+ (OpenCLFeatures.isEnabled(
-+ "__opencl_c_program_scope_global_variables"))))) {
- int Scope = NewVD->isStaticLocal() | NewVD->hasExternalStorage() << 1;
-- if (getLangOpts().OpenCLVersion == 200 || getLangOpts().OpenCLCPlusPlus)
-+ if (OpenCLFeatures.isEnabled(
-+ "__opencl_c_program_scope_global_variables"))
- Diag(NewVD->getLocation(), diag::err_opencl_global_invalid_addr_space)
- << Scope << "global or constant";
- else
-diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
-index 849bc09063b3..c963b95b131a 100644
---- a/clang/lib/Sema/SemaDeclAttr.cpp
-+++ b/clang/lib/Sema/SemaDeclAttr.cpp
-@@ -6362,7 +6362,7 @@ static void handleInternalLinkageAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
- }
-
- static void handleOpenCLNoSVMAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
-- if (S.LangOpts.OpenCLVersion != 200)
-+ if (S.LangOpts.OpenCLVersion < 200)
- S.Diag(AL.getLoc(), diag::err_attribute_requires_opencl_version)
- << AL << "2.0" << 0;
- else
-@@ -6446,6 +6446,13 @@ static void handleOpenCLAccessAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
- << AL << PDecl->getType() << DeclTy->isImageType();
- D->setInvalidDecl(true);
- return;
-+ } else if ((!S.getLangOpts().OpenCLCPlusPlus &&
-+ S.getLangOpts().OpenCLVersion >= 200) &&
-+ !S.getOpenCLOptions().isEnabled(
-+ "__opencl_c_read_write_images")) {
-+ S.Diag(AL.getLoc(), diag::err_opencl_requires_extension)
-+ << 0 << PDecl->getType() << "__opencl_c_read_write_images";
-+ return;
- }
- }
- }
-diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
-index 831e55046e80..4481a59b4517 100644
---- a/clang/lib/Sema/SemaDeclCXX.cpp
-+++ b/clang/lib/Sema/SemaDeclCXX.cpp
-@@ -14906,6 +14906,11 @@ CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
- if (auto *PtrTy = ResultType->getAs<PointerType>()) {
- ResultType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy);
- }
-+ if (CanQual<PointerType> ExpectedPtrTy =
-+ ExpectedResultType->getAs<PointerType>()) {
-+ ExpectedResultType = SemaRef.Context.getCanonicalType(
-+ RemoveAddressSpaceFromPtr(SemaRef, ExpectedPtrTy->getTypePtr()));
-+ }
- }
-
- // Check that the result type is what we expect.
-@@ -14939,6 +14944,11 @@ CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
- FnDecl->getParamDecl(0)->getType()->getAs<PointerType>()) {
- FirstParamType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy);
- }
-+ if (CanQual<PointerType> ExpectedPtrTy =
-+ ExpectedFirstParamType->getAs<PointerType>()) {
-+ ExpectedFirstParamType = SemaRef.Context.getCanonicalType(
-+ RemoveAddressSpaceFromPtr(SemaRef, ExpectedPtrTy->getTypePtr()));
-+ }
- }
- if (SemaRef.Context.getCanonicalType(FirstParamType).getUnqualifiedType() !=
- ExpectedFirstParamType)
-diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
-index 8d96404a5c27..8f21203b9508 100644
---- a/clang/lib/Sema/SemaLookup.cpp
-+++ b/clang/lib/Sema/SemaLookup.cpp
-@@ -771,19 +771,20 @@ static void InsertOCLBuiltinDeclarationsFromTable(Sema &S, LookupResult &LR,
- // as argument. Only meaningful for generic types, otherwise equals 1.
- unsigned GenTypeMaxCnt;
-
-+ ASTContext &Context = S.Context;
-+
-+ // Ignore this BIF if its version does not match the language options.
-+ unsigned OpenCLVersion = Context.getLangOpts().OpenCLVersion;
-+ if (Context.getLangOpts().OpenCLCPlusPlus)
-+ OpenCLVersion = 200;
-+
-+ unsigned short VersionCode = OpenCLOptions::EncodeVersion(OpenCLVersion);
-+
- for (unsigned SignatureIndex = 0; SignatureIndex < Len; SignatureIndex++) {
- const OpenCLBuiltinStruct &OpenCLBuiltin =
- BuiltinTable[FctIndex + SignatureIndex];
-- ASTContext &Context = S.Context;
-
-- // Ignore this BIF if its version does not match the language options.
-- unsigned OpenCLVersion = Context.getLangOpts().OpenCLVersion;
-- if (Context.getLangOpts().OpenCLCPlusPlus)
-- OpenCLVersion = 200;
-- if (OpenCLVersion < OpenCLBuiltin.MinVersion)
-- continue;
-- if ((OpenCLBuiltin.MaxVersion != 0) &&
-- (OpenCLVersion >= OpenCLBuiltin.MaxVersion))
-+ if (!(OpenCLBuiltin.AllVersions & VersionCode))
- continue;
-
- SmallVector<QualType, 1> RetTypes;
-diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
-index 93ddd047e09b..93211b801f8d 100644
---- a/clang/lib/Sema/SemaType.cpp
-+++ b/clang/lib/Sema/SemaType.cpp
-@@ -2016,7 +2016,7 @@ static QualType deduceOpenCLPointeeAddrSpace(Sema &S, QualType PointeeType) {
- !PointeeType.hasAddressSpace())
- PointeeType = S.getASTContext().getAddrSpaceQualType(
- PointeeType,
-- S.getLangOpts().OpenCLCPlusPlus || S.getLangOpts().OpenCLVersion == 200
-+ S.getOpenCLOptions().isEnabled("__opencl_c_generic_address_space")
- ? LangAS::opencl_generic
- : LangAS::opencl_private);
- return PointeeType;
-@@ -5160,9 +5160,15 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
- }
-
- case DeclaratorChunk::Pipe: {
-- T = S.BuildReadPipeType(T, DeclType.Loc);
-- processTypeAttrs(state, T, TAL_DeclSpec,
-- D.getMutableDeclSpec().getAttributes());
-+ if (S.getOpenCLOptions().isEnabled("__opencl_c_pipes")) {
-+ T = S.BuildReadPipeType(T, DeclType.Loc);
-+ processTypeAttrs(state, T, TAL_DeclSpec,
-+ D.getMutableDeclSpec().getAttributes());
-+ } else {
-+ D.setInvalidType(true);
-+ T = Context.IntTy;
-+ S.Diag(D.getIdentifierLoc(), diag::err_opencl_pipes_require_feat);
-+ }
- break;
- }
- }
-diff --git a/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl b/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-index cdbf28bbcad8..0bedff5ef0f3 100644
---- a/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-+++ b/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-@@ -2,7 +2,8 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -O0 -triple amdgcn | FileCheck -enable-var-scope -check-prefixes=COM,AMDGCN %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL2.0 -O0 -triple amdgcn | FileCheck -enable-var-scope -check-prefixes=COM,AMDGCN,AMDGCN20 %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
--
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -cl-ext=__opencl_c_program_scope_global_variables -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
- typedef int int2 __attribute__((ext_vector_type(2)));
-
- typedef struct {
-@@ -39,7 +40,7 @@ struct LargeStructTwoMember {
- int2 y[20];
- };
-
--#if __OPENCL_C_VERSION__ >= 200
-+#ifdef __opencl_c_program_scope_global_variables
- struct LargeStructOneMember g_s;
- #endif
-
-@@ -98,7 +99,7 @@ void FuncOneLargeMember(struct LargeStructOneMember u) {
- // AMDGCN20: %[[r0:.*]] = bitcast %struct.LargeStructOneMember addrspace(5)* %[[byval_temp]] to i8 addrspace(5)*
- // AMDGCN20: call void @llvm.memcpy.p5i8.p1i8.i64(i8 addrspace(5)* align 8 %[[r0]], i8 addrspace(1)* align 8 bitcast (%struct.LargeStructOneMember addrspace(1)* @g_s to i8 addrspace(1)*), i64 800, i1 false)
- // AMDGCN20: call void @FuncOneLargeMember(%struct.LargeStructOneMember addrspace(5)* byval(%struct.LargeStructOneMember) align 8 %[[byval_temp]])
--#if __OPENCL_C_VERSION__ >= 200
-+#ifdef __opencl_c_program_scope_global_variables
- void test_indirect_arg_globl(void) {
- FuncOneLargeMember(g_s);
- }
-diff --git a/clang/test/CodeGenOpenCL/address-spaces-conversions.cl b/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-index 52feccc540bb..9ecffcca5ee9 100644
---- a/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-@@ -1,5 +1,7 @@
- // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -ffake-address-space-map -cl-std=CL2.0 -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -ffake-address-space-map -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -cl-std=CL2.0 -emit-llvm -o - | FileCheck --check-prefix=CHECK-NOFAKE %s
-+// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -emit-llvm -o - | FileCheck --check-prefix=CHECK-NOFAKE %s
- // When -ffake-address-space-map is not used, all addr space mapped to 0 for x86_64.
-
- // test that we generate address space casts everywhere we need conversions of
-diff --git a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-index 50622f099143..e19ec8451d0d 100644
---- a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-@@ -6,6 +6,7 @@
- // We check that the address spaces are mangled the same in both version of OpenCL
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
-
- // We can't name this f as private is equivalent to default
- // no specifier given address space so we get multiple definition
-@@ -47,7 +48,7 @@ void f(constant int *arg) { }
- // OCL-20-DAG: @_Z1fPU3AS2i
- // OCL-12-DAG: @_Z1fPU3AS2i
-
--#if __OPENCL_C_VERSION__ >= 200
-+#if __OPENCL_C_VERSION__ == 200
- __attribute__((overloadable))
- void f(generic int *arg) { }
- // ASMANG20: @_Z1fPU3AS4i
-diff --git a/clang/test/CodeGenOpenCL/address-spaces.cl b/clang/test/CodeGenOpenCL/address-spaces.cl
-index 3c8fea2a80bc..26a741338b3a 100644
---- a/clang/test/CodeGenOpenCL/address-spaces.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces.cl
-@@ -1,9 +1,13 @@
- // RUN: %clang_cc1 %s -O0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,SPIR
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,SPIR
- // RUN: %clang_cc1 %s -O0 -DCL20 -cl-std=CL2.0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CL20,CL20SPIR
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-amd-amdhsa -DCL20 -cl-std=CL2.0 -emit-llvm -o - | FileCheck %s --check-prefixes=CL20,CL20AMDGCN
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-mesa-mesa3d -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple amdgcn-mesa-mesa3d -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
- // RUN: %clang_cc1 %s -O0 -triple r600-- -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple r600-- -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-
- // SPIR: %struct.S = type { i32, i32, i32* }
- // CL20SPIR: %struct.S = type { i32, i32, i32 addrspace(4)* }
-diff --git a/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl b/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-index 7216cb517495..8d3b30fe8074 100644
---- a/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-+++ b/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 -O0 -cl-std=CL1.2 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL12 %s
-+// RUN: %clang_cc1 -O0 -cl-std=CL3.0 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL12 %s
- // RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL20 %s
-
- // CL12-LABEL: define void @func1(i32 addrspace(5)* %x)
-diff --git a/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl b/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-index a5d438933fa4..8073c7756eb6 100644
---- a/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-+++ b/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-@@ -4,6 +4,17 @@
- // RUN: %clang_cc1 -triple amdgcn---opencl -cl-std=CL2.0 %s -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL1.2 %s -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL2.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple r600 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple r600 -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-
- #ifdef __AMDGCN__
- #define PTSIZE 8
-@@ -11,7 +22,7 @@
- #define PTSIZE 4
- #endif
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
- #endif
- #ifdef cl_khr_fp16
-@@ -59,8 +70,12 @@ void test() {
- check(__alignof__(double) == 8);
- #endif
-
-- check(sizeof(void*) == (__OPENCL_C_VERSION__ >= 200 ? 8 : 4));
-- check(__alignof__(void*) == (__OPENCL_C_VERSION__ >= 200 ? 8 : 4));
-+ check(sizeof(private void*) == 4);
-+ check(__alignof__(private void*) == 4);
-+#ifdef __opencl_c_generic_address_space
-+ check(sizeof(generic void*) == 8);
-+ check(__alignof__(generic void*) == 8);
-+#endif
- check(sizeof(global_ptr_t) == PTSIZE);
- check(__alignof__(global_ptr_t) == PTSIZE);
- check(sizeof(constant_ptr_t) == PTSIZE);
-diff --git a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-index d1ab6aceac5c..70c5bace023b 100644
---- a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-+++ b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -cl-std=CL1.2 -emit-llvm -o - -O0 | FileCheck %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -cl-std=CL3.0 -emit-llvm -o - -O0 | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : enable
- void test_int8(uchar4 ua, uchar4 ub, char4 sa, char4 sb) {
-diff --git a/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl b/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-index 76ace5dca21e..5dc43e222f75 100644
---- a/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-+++ b/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-@@ -1,6 +1,8 @@
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL1.2 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-NONUNIFORM
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -cl-uniform-work-group-size -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-NONUNIFORM
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -cl-uniform-work-group-size -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
-
- kernel void ker() {};
- // CHECK: define{{.*}}@ker() #0
-diff --git a/clang/test/CodeGenOpenCL/fpmath.cl b/clang/test/CodeGenOpenCL/fpmath.cl
-index 0108d909c94e..b28392739c71 100644
---- a/clang/test/CodeGenOpenCL/fpmath.cl
-+++ b/clang/test/CodeGenOpenCL/fpmath.cl
-@@ -2,6 +2,8 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown -cl-fp32-correctly-rounded-divide-sqrt | FileCheck --check-prefix=CHECK --check-prefix=DIVOPT %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -DNOFP64 -cl-std=CL1.2 -triple r600-unknown-unknown -target-cpu r600 -pedantic | FileCheck --check-prefix=CHECK-FLT %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -DFP64 -cl-std=CL1.2 -triple spir-unknown-unknown -pedantic | FileCheck --check-prefix=CHECK-DBL %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -DNOFP64 -cl-std=CL3.0 -triple r600-unknown-unknown -target-cpu r600 -pedantic | FileCheck --check-prefix=CHECK-FLT %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -DFP64 -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -triple spir-unknown-unknown -pedantic | FileCheck --check-prefix=CHECK-DBL %s
-
- typedef __attribute__(( ext_vector_type(4) )) float float4;
-
-diff --git a/clang/test/CodeGenOpenCL/generic-address-space-feature.cl b/clang/test/CodeGenOpenCL/generic-address-space-feature.cl
-new file mode 100644
-index 000000000000..890860abe4d9
---- /dev/null
-+++ b/clang/test/CodeGenOpenCL/generic-address-space-feature.cl
-@@ -0,0 +1,28 @@
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL12
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL12
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL20
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL20
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL30
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64,__opencl_c_generic_address_space -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL30-GENERIC
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL30
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64,__opencl_c_generic_address_space -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL30-GENERIC
-+
-+void test(global float* src1, local float *src2, private float *src3, float *src4, float tmp) {
-+ // CL20: %{{.+}} = addrspacecast float addrspace(1)* %{{.+}} to float addrspace(4)*
-+ // CL12-NOT: addrspacecast
-+ // CL30-NOT: addrspacecast
-+ // CL30-GENERIC-NOT: addrspacecast
-+ tmp = sincos(tmp, src1);
-+ // CL20: %{{.+}} = addrspacecast float addrspace(3)* %{{.+}} to float addrspace(4)*
-+ // CL12-NOT: addrspacecast
-+ // CL30-NOT: addrspacecast
-+ // CL30-GENERIC-NOT: addrspacecast
-+ tmp = sincos(tmp, src2);
-+
-+ // CL12: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float* {{.+}})
-+ // CL20: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float addrspace(4)* {{.+}})
-+ // CL30: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float* {{.+}})
-+ // CL30-GENERIC: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float addrspace(4)* {{.+}})
-+ // CHECK: addrspacecast
-+ tmp = sincos(tmp, src4);
-+}
-diff --git a/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl b/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-index 515f13f6e768..5aa31ac6f345 100644
---- a/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-+++ b/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -cl-ext=+cl_intel_device_side_avc_motion_estimation -emit-llvm -o - -O0 | FileCheck %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -cl-ext=+cl_intel_device_side_avc_motion_estimation -emit-llvm -o - -O0 | FileCheck %s
-
- // CHECK: %opencl.intel_sub_group_avc_mce_payload_t = type opaque
- // CHECK: %opencl.intel_sub_group_avc_ime_payload_t = type opaque
-diff --git a/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl b/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-index e89237623478..3d6708ac361f 100644
---- a/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-+++ b/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-@@ -1,5 +1,8 @@
- // RUN: %clang_cc1 %s -cl-std=CL1.2 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=CL1.2 -emit-llvm -triple amdgcn-unknown-unknown -o - | FileCheck -check-prefixes=AMDGCN %s
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -triple amdgcn-unknown-unknown -o - | FileCheck -check-prefixes=AMDGCN %s
-+
- // Test that the kernels always use the SPIR calling convention
- // to have unambiguous mapping of arguments to feasibly implement
- // clSetKernelArg().
-diff --git a/clang/test/CodeGenOpenCL/logical-ops.cl b/clang/test/CodeGenOpenCL/logical-ops.cl
-index f083a8580ee7..499eab65039b 100644
---- a/clang/test/CodeGenOpenCL/logical-ops.cl
-+++ b/clang/test/CodeGenOpenCL/logical-ops.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=clc++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
-diff --git a/clang/test/CodeGenOpenCL/no-half.cl b/clang/test/CodeGenOpenCL/no-half.cl
-index aee8f678f01a..46da7fa339e8 100644
---- a/clang/test/CodeGenOpenCL/no-half.cl
-+++ b/clang/test/CodeGenOpenCL/no-half.cl
-@@ -1,6 +1,7 @@
- // RUN: %clang_cc1 %s -cl-std=cl2.0 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=cl1.2 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=cl1.1 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
-+// RUN: %clang_cc1 %s -cl-std=cl3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_khr_fp64:enable
-
-diff --git a/clang/test/CodeGenOpenCL/pipe_builtin.cl b/clang/test/CodeGenOpenCL/pipe_builtin.cl
-index 02b9669b7ab1..0bf35c336199 100644
---- a/clang/test/CodeGenOpenCL/pipe_builtin.cl
-+++ b/clang/test/CodeGenOpenCL/pipe_builtin.cl
-@@ -1,4 +1,7 @@
- // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=cl2.0 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=cl3.0 -cl-ext=__opencl_c_pipes,__opencl_c_subgroups -o - %s | FileCheck %s
-+
- // FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple
- // above to support OpenCL in the MS C++ ABI.
-
-diff --git a/clang/test/CodeGenOpenCL/pipe_types.cl b/clang/test/CodeGenOpenCL/pipe_types.cl
-index ba064c6d7557..b7a523d4f084 100644
---- a/clang/test/CodeGenOpenCL/pipe_types.cl
-+++ b/clang/test/CodeGenOpenCL/pipe_types.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -o - %s | FileCheck %s
-
- // CHECK: %opencl.pipe_ro_t = type opaque
- // CHECK: %opencl.pipe_wo_t = type opaque
-diff --git a/clang/test/CodeGenOpenCL/printf.cl b/clang/test/CodeGenOpenCL/printf.cl
-index fc139d776db6..0133c5595d81 100644
---- a/clang/test/CodeGenOpenCL/printf.cl
-+++ b/clang/test/CodeGenOpenCL/printf.cl
-@@ -1,5 +1,7 @@
- // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-+cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
- // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
-
- typedef __attribute__((ext_vector_type(2))) float float2;
- typedef __attribute__((ext_vector_type(2))) half half2;
-diff --git a/clang/test/CodeGenOpenCL/unroll-hint.cl b/clang/test/CodeGenOpenCL/unroll-hint.cl
-index 0f84450a1ae6..9347c935869b 100644
---- a/clang/test/CodeGenOpenCL/unroll-hint.cl
-+++ b/clang/test/CodeGenOpenCL/unroll-hint.cl
-@@ -1,5 +1,6 @@
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL1.2 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -o - %s | FileCheck %s
-
- /*** for ***/
- void for_count()
-diff --git a/clang/test/Driver/autocomplete.c b/clang/test/Driver/autocomplete.c
-index 5c0bfb69f9a3..eabdf0b5938d 100644
---- a/clang/test/Driver/autocomplete.c
-+++ b/clang/test/Driver/autocomplete.c
-@@ -43,6 +43,8 @@
- // CLSTDALL-NEXT: CL1.2
- // CLSTDALL-NEXT: cl2.0
- // CLSTDALL-NEXT: CL2.0
-+// CLSTDALL-NEXT: cl3.0
-+// CLSTDALL-NEXT: CL3.0
- // CLSTDALL-NEXT: clc++
- // CLSTDALL-NEXT: CLC++
- // RUN: %clang --autocomplete=-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER
-diff --git a/clang/test/Driver/opencl.cl b/clang/test/Driver/opencl.cl
-index 63b04bc1af41..ffdd4f7d65bb 100644
---- a/clang/test/Driver/opencl.cl
-+++ b/clang/test/Driver/opencl.cl
-@@ -2,6 +2,7 @@
- // RUN: %clang -S -### -cl-std=CL1.1 %s 2>&1 | FileCheck --check-prefix=CHECK-CL11 %s
- // RUN: %clang -S -### -cl-std=CL1.2 %s 2>&1 | FileCheck --check-prefix=CHECK-CL12 %s
- // RUN: %clang -S -### -cl-std=CL2.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL20 %s
-+// RUN: %clang -S -### -cl-std=CL3.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL30 %s
- // RUN: %clang -S -### -cl-std=clc++ %s 2>&1 | FileCheck --check-prefix=CHECK-CLCPP %s
- // RUN: %clang -S -### -cl-opt-disable %s 2>&1 | FileCheck --check-prefix=CHECK-OPT-DISABLE %s
- // RUN: %clang -S -### -cl-strict-aliasing %s 2>&1 | FileCheck --check-prefix=CHECK-STRICT-ALIASING %s
-@@ -22,6 +23,7 @@
- // CHECK-CL11: "-cc1" {{.*}} "-cl-std=CL1.1"
- // CHECK-CL12: "-cc1" {{.*}} "-cl-std=CL1.2"
- // CHECK-CL20: "-cc1" {{.*}} "-cl-std=CL2.0"
-+// CHECK-CL30: "-cc1" {{.*}} "-cl-std=CL3.0"
- // CHECK-CLCPP: "-cc1" {{.*}} "-cl-std=clc++"
- // CHECK-OPT-DISABLE: "-cc1" {{.*}} "-cl-opt-disable"
- // CHECK-STRICT-ALIASING: "-cc1" {{.*}} "-cl-strict-aliasing"
-diff --git a/clang/test/Driver/unknown-std.cl b/clang/test/Driver/unknown-std.cl
-index 6f371bac13ac..00209fb62556 100644
---- a/clang/test/Driver/unknown-std.cl
-+++ b/clang/test/Driver/unknown-std.cl
-@@ -10,6 +10,7 @@
- // CHECK-NEXT: note: use 'cl1.1' for 'OpenCL 1.1' standard
- // CHECK-NEXT: note: use 'cl1.2' for 'OpenCL 1.2' standard
- // CHECK-NEXT: note: use 'cl2.0' for 'OpenCL 2.0' standard
-+// CHECK-NEXT: note: use 'cl3.0' for 'OpenCL 3.0' standard
- // CHECK-NEXT: note: use 'clc++' for 'C++ for OpenCL' standard
-
- // Make sure that no other output is present.
-diff --git a/clang/test/Frontend/stdlang.c b/clang/test/Frontend/stdlang.c
-index 51484999e37a..eac4632fbdd6 100644
---- a/clang/test/Frontend/stdlang.c
-+++ b/clang/test/Frontend/stdlang.c
-@@ -9,6 +9,7 @@
- // RUN: %clang_cc1 -x cl -cl-std=CL1.1 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CL1.2 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CL2.0 -DOPENCL %s
-+// RUN: %clang_cc1 -x cl -cl-std=CL3.0 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CLC++ -DOPENCL %s
- // RUN: not %clang_cc1 -x cl -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
- // RUN: not %clang_cc1 -x cl -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
-diff --git a/clang/test/Headers/opencl-c-header.cl b/clang/test/Headers/opencl-c-header.cl
-index 1b151ffdd16a..2716076acdcf 100644
---- a/clang/test/Headers/opencl-c-header.cl
-+++ b/clang/test/Headers/opencl-c-header.cl
-@@ -1,6 +1,7 @@
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1 | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2 | FileCheck %s
-+// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL3.0 | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=clc++ | FileCheck %s --check-prefix=CHECK20
-
- // Test including the default header as a module.
-@@ -39,9 +40,11 @@
- // RUN: rm -rf %t
- // RUN: mkdir -p %t
- // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
-+// RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL3.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
- // RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s
- // RUN: chmod u-w %t
- // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
-+// RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL3.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
- // RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s
- // RUN: chmod u+w %t
-
-@@ -67,7 +70,7 @@ char f(char x) {
- // from OpenCL 2.0 onwards.
-
- // CHECK20: _Z12write_imagef14ocl_image3d_wo
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
- void test_image3dwo(write_only image3d_t img) {
- write_imagef(img, (0), (0.0f));
- }
-@@ -81,7 +84,7 @@ void test_atomics(__generic volatile unsigned int* a) {
- #endif
-
- // Verify that ATOMIC_VAR_INIT is defined.
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
- global atomic_int z = ATOMIC_VAR_INIT(99);
- #endif //__OPENCL_C_VERSION__
-
-diff --git a/clang/test/Index/pipe-size.cl b/clang/test/Index/pipe-size.cl
-index 94a1255f0a48..59b76051eda1 100644
---- a/clang/test/Index/pipe-size.cl
-+++ b/clang/test/Index/pipe-size.cl
-@@ -2,6 +2,13 @@
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple spir-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple spir64-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR64
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefix=AMDGCN
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=X86
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple spir-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple spir64-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR64
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefix=AMDGCN
-+
-+
-+
- __kernel void testPipe( pipe int test )
- {
- int s = sizeof(test);
-diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c
-index def105f4c52e..b088a37ba665 100644
---- a/clang/test/Preprocessor/predefined-macros.c
-+++ b/clang/test/Preprocessor/predefined-macros.c
-@@ -129,6 +129,8 @@
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL12
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL2.0 \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL20
-+// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL3.0 \
-+// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL30
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++ \
-@@ -137,26 +139,37 @@
- // CHECK-CL10: #define CL_VERSION_1_1 110
- // CHECK-CL10: #define CL_VERSION_1_2 120
- // CHECK-CL10: #define CL_VERSION_2_0 200
-+// CHECK-CL10: #define CL_VERSION_3_0 300
- // CHECK-CL10: #define __OPENCL_C_VERSION__ 100
- // CHECK-CL10-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL11: #define CL_VERSION_1_0 100
- // CHECK-CL11: #define CL_VERSION_1_1 110
- // CHECK-CL11: #define CL_VERSION_1_2 120
- // CHECK-CL11: #define CL_VERSION_2_0 200
-+// CHECK-CL11: #define CL_VERSION_3_0 300
- // CHECK-CL11: #define __OPENCL_C_VERSION__ 110
- // CHECK-CL11-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL12: #define CL_VERSION_1_0 100
- // CHECK-CL12: #define CL_VERSION_1_1 110
- // CHECK-CL12: #define CL_VERSION_1_2 120
- // CHECK-CL12: #define CL_VERSION_2_0 200
-+// CHECK-CL12: #define CL_VERSION_3_0 300
- // CHECK-CL12: #define __OPENCL_C_VERSION__ 120
- // CHECK-CL12-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL20: #define CL_VERSION_1_0 100
- // CHECK-CL20: #define CL_VERSION_1_1 110
- // CHECK-CL20: #define CL_VERSION_1_2 120
- // CHECK-CL20: #define CL_VERSION_2_0 200
-+// CHECK-CL20: #define CL_VERSION_3_0 300
- // CHECK-CL20: #define __OPENCL_C_VERSION__ 200
- // CHECK-CL20-NOT: #define __FAST_RELAXED_MATH__ 1
-+// CHECK-CL30: #define CL_VERSION_1_0 100
-+// CHECK-CL30: #define CL_VERSION_1_1 110
-+// CHECK-CL30: #define CL_VERSION_1_2 120
-+// CHECK-CL30: #define CL_VERSION_2_0 200
-+// CHECK-CL30: #define CL_VERSION_3_0 300
-+// CHECK-CL30: #define __OPENCL_C_VERSION__ 300
-+// CHECK-CL30-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CLCPP10: #define __CL_CPP_VERSION_1_0__ 100
- // CHECK-CLCPP10: #define __OPENCL_CPP_VERSION__ 100
-diff --git a/clang/test/Sema/feature-extensions-simult-support.cl b/clang/test/Sema/feature-extensions-simult-support.cl
-new file mode 100644
-index 000000000000..0789105002b2
---- /dev/null
-+++ b/clang/test/Sema/feature-extensions-simult-support.cl
-@@ -0,0 +1,75 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_subgroups
-+
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_subgroups
-+
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_device_enqueue
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_read_write_images
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64,-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_3d_image_writes,-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_subgroups,-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_subgroups
-+
-+// expected-no-diagnostics
-+
-+#ifdef cl_khr_fp64
-+ #ifndef __opencl_c_fp64
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_fp64
-+ #ifndef cl_khr_fp64
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#ifdef cl_khr_3d_image_writes
-+ #ifndef __opencl_c_3d_image_writes
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_3d_image_writes
-+ #ifndef cl_khr_3d_image_writes
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#ifdef cl_khr_subgroups
-+ #ifndef __opencl_c_subgroups
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_subgroups
-+ #ifndef cl_khr_subgroups
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#if defined(__opencl_c_pipes) || defined(__opencl_c_device_enqueue)
-+ #ifndef __opencl_c_generic_address_space
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#if defined(__opencl_c_3d_image_writes) || defined(__opencl_c_read_write_images)
-+ #ifndef __opencl_c_images
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+kernel void test(){}
-diff --git a/clang/test/Sema/features-ignore-pragma.cl b/clang/test/Sema/features-ignore-pragma.cl
-new file mode 100644
-index 000000000000..046ce5390754
---- /dev/null
-+++ b/clang/test/Sema/features-ignore-pragma.cl
-@@ -0,0 +1,24 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_3d_image_writes
-+
-+#pragma OPENCL EXTENSION __opencl_c_fp64 : enable
-+// expected-warning@-1 {{OpenCL feature support can't be controlled via pragma, ignoring}}
-+
-+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-+#ifndef __opencl_c_fp64
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}}
-+#endif
-+
-+#pragma OPENCL EXTENSION cl_khr_subgroups : enable
-+#ifndef __opencl_c_subgroups
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}}
-+#endif
-+
-+#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
-+#ifndef __opencl_c_3d_image_writes
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_3d_image_writes' - ignoring}}
-+#endif
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/opencl-features-pipes.cl b/clang/test/Sema/opencl-features-pipes.cl
-new file mode 100644
-index 000000000000..c0ac778f24a6
---- /dev/null
-+++ b/clang/test/Sema/opencl-features-pipes.cl
-@@ -0,0 +1,18 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.1
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DHAS
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -DHAS
-+// expected-no-diagnostics
-+
-+#ifdef HAS
-+ #ifndef __opencl_c_pipes
-+ #error Feature should be defined
-+ #endif
-+#else
-+ #ifdef __opencl_c_pipes
-+ #error Feature should not be defined
-+ #endif
-+#endif
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/opencl-features.cl b/clang/test/Sema/opencl-features.cl
-new file mode 100644
-index 000000000000..aa432f6b60bf
---- /dev/null
-+++ b/clang/test/Sema/opencl-features.cl
-@@ -0,0 +1,128 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-__opencl_c_device_enqueue,-__opencl_c_pipes,-__opencl_c_read_write_images
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CLC++
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// expected-no-diagnostics
-+
-+#ifndef __opencl_c_int64
-+ #error Feature __opencl_c_int64 shouldn't be defined
-+#endif
-+
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+ #ifndef __opencl_c_3d_image_writes
-+ #error Feature __opencl_c_3d_image_writes should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_order_acq_rel
-+ #error Feature __opencl_c_atomic_order_acq_rel should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_order_seq_cst
-+ #error Feature __opencl_c_atomic_order_seq_cst should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_scope_device
-+ #error Feature __opencl_c_atomic_scope_device should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_scope_all_devices
-+ #error Feature __opencl_c_atomic_scope_all_devices should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_device_enqueue
-+ #error Feature __opencl_c_device_enqueue should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_generic_address_space
-+ #error Feature __opencl_c_generic_address_space should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_pipes
-+ #error Feature __opencl_c_pipes should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_program_scope_global_variables
-+ #error Feature __opencl_c_program_scope_global_variables should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_read_write_images
-+ #error Feature __opencl_c_read_write_images should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_subgroups
-+ #error Feature __opencl_c_subgroups should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_work_group_collective_functions
-+ #error Feature __opencl_c_work_group_collective_functions should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_fp64
-+ #error Feature __opencl_c_fp64 should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_images
-+ #error Feature __opencl_c_images should be defined
-+ #endif
-+#endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+
-+
-+#if __OPENCL_C_VERSION__ == CL_VERSION_3_0
-+ #ifdef __opencl_c_3d_image_writes
-+ #error Feature __opencl_c_3d_image_writes shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_order_acq_rel
-+ #error Feature __opencl_c_atomic_order_acq_rel shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_order_seq_cst
-+ #error Feature __opencl_c_atomic_order_seq_cst shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_scope_device
-+ #error Feature __opencl_c_atomic_scope_device shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_scope_all_devices
-+ #error Feature __opencl_c_atomic_scope_all_devices shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_device_enqueue
-+ #error Feature __opencl_c_device_enqueue shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_generic_address_space
-+ #error Feature __opencl_c_generic_address_space shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_pipes
-+ #error Feature __opencl_c_pipes shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_program_scope_global_variables
-+ #error Feature __opencl_c_program_scope_global_variables shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_read_write_images
-+ #error Feature __opencl_c_read_write_images shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_subgroups
-+ #error Feature __opencl_c_subgroups shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_work_group_collective_functions
-+ #error Feature __opencl_c_work_group_collective_functions shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_fp64
-+ #error Feature __opencl_c_fp64 shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_images
-+ #error Feature __opencl_c_images shouldn't be defined
-+ #endif
-+#endif // __OPENCL_C_VERSION__ == CL_VERSION_3_0
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/pipe_builtins_feature.cl b/clang/test/Sema/pipe_builtins_feature.cl
-new file mode 100644
-index 000000000000..56fa94fc7705
---- /dev/null
-+++ b/clang/test/Sema/pipe_builtins_feature.cl
-@@ -0,0 +1,21 @@
-+// RUN: %clang_cc1 -cl-std=CL2.0 -fsyntax-only -verify %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -fsyntax-only -verify %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -fsyntax-only -verify %s
-+
-+#ifdef __opencl_c_pipes
-+ #ifndef __opencl_c_generic_address_space
-+ #error Generic address space feature must also be defined
-+ #endif
-+// CHECK: expected-no-diagnostics
-+// check that pragma disable all doesn't touch feature support
-+ #pragma OPENCL EXTENSION all : disable
-+#endif
-+
-+void test(read_only pipe int p, global int *ptr) {
-+ reserve_id_t rid;
-+}
-+
-+#ifndef __opencl_c_pipes
-+// expected-error@-5 {{expected parameter declarator}} expected-error@-5 {{expected ')'}} expected-note@-5 {{to match this '('}}
-+// expected-error@-5 {{use of type 'reserve_id_t' requires __opencl_c_pipes extension to be enabled}}
-+#endif
-diff --git a/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl b/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-index 5efea216346a..09aea27ae6de 100644
---- a/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-+++ b/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-@@ -1,6 +1,9 @@
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL2.0
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL2.0
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=clc++
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=clc++
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=clc++
-diff --git a/clang/test/SemaOpenCL/address-spaces.cl b/clang/test/SemaOpenCL/address-spaces.cl
-index 07547ea19680..e367a7c57292 100644
---- a/clang/test/SemaOpenCL/address-spaces.cl
-+++ b/clang/test/SemaOpenCL/address-spaces.cl
-@@ -1,5 +1,6 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -verify -pedantic -fsyntax-only
- // RUN: %clang_cc1 %s -cl-std=clc++ -verify -pedantic -fsyntax-only
-
- __constant int ci = 1;
-diff --git a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-index f63e2913c749..727141190a0b 100644
---- a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-+++ b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-@@ -2,6 +2,12 @@
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir-unknown-unknown" -verify -pedantic -fsyntax-only -DB32 -DQUALS="const volatile"
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir64-unknown-unknown" -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS=
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir64-unknown-unknown" -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS="const volatile"
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -DB32 -DQUALS=
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -DB32 -DQUALS="const volatile"
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir64-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS=
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir64-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS="const volatile"
-+
-+
-
- typedef struct {int a;} ndrange_t;
- // Diagnostic tests for different overloads of enqueue_kernel from Table 6.13.17.1 of OpenCL 2.0 Spec.
-@@ -235,11 +241,17 @@ kernel void bar(global unsigned int *buf)
- kernel void foo1(global unsigned int *buf)
- {
- ndrange_t n;
-- buf[0] = get_kernel_max_sub_group_size_for_ndrange(n, ^(){}); // expected-error {{use of declaration 'get_kernel_max_sub_group_size_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+ buf[0] = get_kernel_max_sub_group_size_for_ndrange(n, ^(){});
-+#if __OPENCL_C_VERSION__ < 300
-+// expected-error@-2 {{use of declaration 'get_kernel_max_sub_group_size_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+#endif
- }
-
- kernel void bar1(global unsigned int *buf)
- {
- ndrange_t n;
-- buf[0] = get_kernel_sub_group_count_for_ndrange(n, ^(){}); // expected-error {{use of declaration 'get_kernel_sub_group_count_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+ buf[0] = get_kernel_sub_group_count_for_ndrange(n, ^(){});
-+#if __OPENCL_C_VERSION__ < 300
-+// expected-error@-2 {{use of declaration 'get_kernel_sub_group_count_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+#endif
- }
-diff --git a/clang/test/SemaOpenCL/forget-unsupported-builtins.cl b/clang/test/SemaOpenCL/forget-unsupported-builtins.cl
-new file mode 100644
-index 000000000000..14dd03e2c7db
---- /dev/null
-+++ b/clang/test/SemaOpenCL/forget-unsupported-builtins.cl
-@@ -0,0 +1,22 @@
-+// RUN: %clang_cc1 -cl-std=cl3.0 -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -fsyntax-only -cl-ext=__opencl_c_pipes,__opencl_c_generic_address_space,__opencl_c_device_enqueue -verify %s -triple spir-unknown-unknown -DFEATURES
-+
-+#ifndef FEATURES
-+ // expected-no-diagnostics
-+#else
-+ // expected-error@+10 {{cannot redeclare builtin function 'get_pipe_max_packets'}}
-+ // expected-note@+9 {{'get_pipe_max_packets' is a builtin with type 'unsigned int ()'}}
-+ // expected-error@+9 {{cannot redeclare builtin function 'to_local'}}
-+ // expected-note@+8 {{'to_local' is a builtin with type 'void *(void *)'}}
-+ // expected-error@+8 {{cannot redeclare builtin function 'to_global'}}
-+ // expected-note@+7 {{'to_global' is a builtin with type 'void *(void *)'}}
-+ // expected-error@+7 {{cannot redeclare builtin function 'get_kernel_work_group_size'}}
-+ // expected-note@+6 {{'get_kernel_work_group_size' is a builtin with type 'unsigned int ()'}}
-+#endif
-+
-+int get_pipe_max_packets(int);
-+int to_local(int);
-+int to_global(int);
-+int get_kernel_work_group_size(int);
-+
-+kernel void test(global int *dst) {}
-diff --git a/clang/test/SemaOpenCL/image-features.cl b/clang/test/SemaOpenCL/image-features.cl
-new file mode 100644
-index 000000000000..ace6913bb31e
---- /dev/null
-+++ b/clang/test/SemaOpenCL/image-features.cl
-@@ -0,0 +1,20 @@
-+// RUN: %clang_cc1 -cl-std=cl2.0 -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_images -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_3d_image_writes -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_read_write_images -fsyntax-only -verify %s -triple spir-unknown-unknown
-+
-+#if defined(__opencl_c_read_write_images) && defined(__opencl_c_3d_image_writes)
-+ // expected-no-diagnostics
-+#endif
-+
-+__kernel void write_3d_image(__write_only image3d_t i) {}
-+
-+#ifndef __opencl_c_3d_image_writes
-+ // expected-error@-3 {{use of type '__write_only image3d_t' requires __opencl_c_3d_image_writes extension to be enabled}}
-+#endif
-+
-+__kernel void read_write_3d_image(__read_write image3d_t i) { }
-+
-+#ifndef __opencl_c_read_write_images
-+ // expected-error@-3 {{use of type '__read_write image3d_t' requires __opencl_c_read_write_images extension to be enabled}}
-+#endif
-diff --git a/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl b/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-index 36e76621d24a..38b0a04726e3 100644
---- a/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-+++ b/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_subgroups,__opencl_c_pipes
-
- #pragma OPENCL EXTENSION cl_khr_subgroups : enable
-
-diff --git a/clang/test/SemaOpenCL/storageclass-cl20.cl b/clang/test/SemaOpenCL/storageclass-cl20.cl
-index 581701d2a6a5..469c526ebc30 100644
---- a/clang/test/SemaOpenCL/storageclass-cl20.cl
-+++ b/clang/test/SemaOpenCL/storageclass-cl20.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_program_scope_global_variables,__opencl_c_generic_address_space
-
- int G2 = 0;
- global int G3 = 0;
-diff --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-index 41d33b550680..f50652493e5e 100644
---- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-@@ -56,6 +56,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "TableGenBackends.h"
-+#include "clang/Basic/OpenCLOptions.h"
- #include "llvm/ADT/MapVector.h"
- #include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/SmallString.h"
-@@ -69,6 +70,7 @@
- #include "llvm/TableGen/Record.h"
- #include "llvm/TableGen/StringMatcher.h"
- #include "llvm/TableGen/TableGenBackend.h"
-+#include <numeric>
- #include <set>
-
- using namespace llvm;
-@@ -228,6 +230,10 @@ private:
- // The function "tan", having the same signatures, would be mapped to the
- // same entry (<I1, I2, I3>).
- MapVector<BuiltinIndexListTy *, BuiltinTableEntries> SignatureListMap;
-+
-+ // Encode all versions
-+ unsigned short
-+ EncodeBuiltinVersions(std::vector<Record *> BuiltinVersionsRecords) const;
- };
- } // namespace
-
-@@ -338,12 +344,10 @@ struct OpenCLBuiltinStruct {
- const bool IsConst;
- // Function attribute __attribute__((convergent))
- const bool IsConv;
-+ // All opencl versions encoded
-+ const unsigned char AllVersions : 5;
- // OpenCL extension(s) required for this overload.
- const unsigned short Extension;
-- // First OpenCL version in which this overload was introduced (e.g. CL20).
-- const unsigned short MinVersion;
-- // First OpenCL version in which this overload was removed (e.g. CL20).
-- const unsigned short MaxVersion;
- };
-
- )";
-@@ -503,11 +507,9 @@ void BuiltinNameEmitter::EmitBuiltinTable() {
- << (Overload.first->getValueAsBit("IsPure")) << ", "
- << (Overload.first->getValueAsBit("IsConst")) << ", "
- << (Overload.first->getValueAsBit("IsConv")) << ", "
-- << FunctionExtensionIndex[ExtName] << ", "
-- << Overload.first->getValueAsDef("MinVersion")->getValueAsInt("ID")
-- << ", "
-- << Overload.first->getValueAsDef("MaxVersion")->getValueAsInt("ID")
-- << " },\n";
-+ << EncodeBuiltinVersions(
-+ Overload.first->getValueAsListOfDefs("Versions"))
-+ << ", " << FunctionExtensionIndex[ExtName] << " },\n";
- Index++;
- }
- }
-@@ -528,10 +530,8 @@ bool BuiltinNameEmitter::CanReuseSignature(
- if (Rec->getValueAsBit("IsPure") == Rec2->getValueAsBit("IsPure") &&
- Rec->getValueAsBit("IsConst") == Rec2->getValueAsBit("IsConst") &&
- Rec->getValueAsBit("IsConv") == Rec2->getValueAsBit("IsConv") &&
-- Rec->getValueAsDef("MinVersion")->getValueAsInt("ID") ==
-- Rec2->getValueAsDef("MinVersion")->getValueAsInt("ID") &&
-- Rec->getValueAsDef("MaxVersion")->getValueAsInt("ID") ==
-- Rec2->getValueAsDef("MaxVersion")->getValueAsInt("ID") &&
-+ EncodeBuiltinVersions(Rec->getValueAsListOfDefs("Versions")) ==
-+ EncodeBuiltinVersions(Rec2->getValueAsListOfDefs("Versions")) &&
- Rec->getValueAsDef("Extension")->getName() ==
- Rec2->getValueAsDef("Extension")->getName()) {
- return true;
-@@ -806,6 +806,15 @@ static void OCL2Qual(ASTContext &Context, const OpenCLTypeStruct &Ty,
- OS << "\n} // OCL2Qual\n";
- }
-
-+unsigned short BuiltinNameEmitter::EncodeBuiltinVersions(
-+ std::vector<Record *> BuiltinVersionsRecords) const {
-+ return std::accumulate(
-+ BuiltinVersionsRecords.begin(), BuiltinVersionsRecords.end(),
-+ (unsigned short)0, [](unsigned short C, Record *R) {
-+ return C |= clang::OpenCLOptions::EncodeVersion(R->getValueAsInt("ID"));
-+ });
-+}
-+
- void clang::EmitClangOpenCLBuiltins(RecordKeeper &Records, raw_ostream &OS) {
- BuiltinNameEmitter NameChecker(Records, OS);
- NameChecker.Emit();
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Remove-repo-name-in-LLVM-IR.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Remove-repo-name-in-LLVM-IR.patch
deleted file mode 100644
index 232ae063..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Remove-repo-name-in-LLVM-IR.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From b53fd86ffdeacb9b13624bdb110fd25e8c35cb92 Mon Sep 17 00:00:00 2001
-From: Feng Zou <feng.zou@intel.com>
-Date: Mon, 19 Oct 2020 14:43:38 +0800
-Subject: [PATCH] Remove repo name in LLVM IR
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/llvm/0003-Remove-repo-name-in-LLVM-IR.patch]
-Signed-off-by: Feng Zou <feng.zou@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
-
----
- llvm/cmake/modules/VersionFromVCS.cmake | 23 ++++++++++++-----------
- 1 file changed, 12 insertions(+), 11 deletions(-)
-
-diff --git a/llvm/cmake/modules/VersionFromVCS.cmake b/llvm/cmake/modules/VersionFromVCS.cmake
-index 1b6519b4b7c..8fd6b23bb34 100644
---- a/llvm/cmake/modules/VersionFromVCS.cmake
-+++ b/llvm/cmake/modules/VersionFromVCS.cmake
-@@ -33,17 +33,18 @@ function(get_source_info path revision repository)
- else()
- set(remote "origin")
- endif()
-- execute_process(COMMAND ${GIT_EXECUTABLE} remote get-url ${remote}
-- WORKING_DIRECTORY ${path}
-- RESULT_VARIABLE git_result
-- OUTPUT_VARIABLE git_output
-- ERROR_QUIET)
-- if(git_result EQUAL 0)
-- string(STRIP "${git_output}" git_output)
-- set(${repository} ${git_output} PARENT_SCOPE)
-- else()
-- set(${repository} ${path} PARENT_SCOPE)
-- endif()
-+ # Do not show repo name in IR
-+ # execute_process(COMMAND ${GIT_EXECUTABLE} remote get-url ${remote}
-+ # WORKING_DIRECTORY ${path}
-+ # RESULT_VARIABLE git_result
-+ # OUTPUT_VARIABLE git_output
-+ # ERROR_QUIET)
-+ # if(git_result EQUAL 0)
-+ # string(STRIP "${git_output}" git_output)
-+ # set(${repository} ${git_output} PARENT_SCOPE)
-+ # else()
-+ # set(${repository} ${path} PARENT_SCOPE)
-+ # endif()
- endif()
- endif()
- endfunction()
---
-2.18.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-skip-building-tests.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-skip-building-tests.patch
deleted file mode 100644
index 8e58ec25..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-skip-building-tests.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 455ce9c25df5313f4a6649cc27075bdfbe25af18 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 21 Aug 2019 14:35:31 +0800
-Subject: [PATCH] llvm-spirv: skip building tests
-
-Some of these need clang to be built and since we're building this in-tree,
-that leads to problems when compiling libcxx, compiler-rt which aren't built
-in-tree.
-
-Instead of using SPIRV_SKIP_CLANG_BUILD to skip clang build and adding this to
-all components, disable the building of tests altogether.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- CMakeLists.txt | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index b718c00..9805140 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -24,13 +24,6 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
- set(CMAKE_CXX_STANDARD 14)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-- if(LLVM_SPIRV_INCLUDE_TESTS)
-- set(LLVM_TEST_COMPONENTS
-- llvm-as
-- llvm-dis
-- )
-- endif(LLVM_SPIRV_INCLUDE_TESTS)
--
- find_package(LLVM 10.0.0 REQUIRED
- COMPONENTS
- Analysis
-@@ -61,9 +54,6 @@ set(LLVM_SPIRV_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
-
- add_subdirectory(lib/SPIRV)
- add_subdirectory(tools/llvm-spirv)
--if(LLVM_SPIRV_INCLUDE_TESTS)
-- add_subdirectory(test)
--endif(LLVM_SPIRV_INCLUDE_TESTS)
-
- install(
- FILES
---
-2.7.4
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-OpenCL-3.0-support.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-OpenCL-3.0-support.patch
deleted file mode 100644
index 98545db0..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-OpenCL-3.0-support.patch
+++ /dev/null
@@ -1,8453 +0,0 @@
-From d767afa79d1c8153081eac1ef33e348cadbea5bb Mon Sep 17 00:00:00 2001
-From: Anton Zabaznov <anton.zabaznov@intel.com>
-Date: Tue, 22 Sep 2020 19:03:50 +0300
-Subject: [PATCH] OpenCL 3.0 support
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-110/patches/clang/0001-OpenCL-3.0-support.patch]
-Signed-off-by: Anton Zabaznov <anton.zabaznov@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
-
-
----
- clang/include/clang/Basic/Builtins.def | 65 +-
- clang/include/clang/Basic/Builtins.h | 13 +-
- .../clang/Basic/DiagnosticParseKinds.td | 2 +
- .../clang/Basic/DiagnosticSemaKinds.td | 7 +
- clang/include/clang/Basic/LangOptions.def | 2 +
- clang/include/clang/Basic/LangStandards.def | 4 +
- .../include/clang/Basic/OpenCLExtensions.def | 15 +
- clang/include/clang/Basic/OpenCLOptions.h | 174 +-
- clang/include/clang/Driver/Options.td | 2 +-
- clang/include/clang/Sema/Sema.h | 9 +
- clang/lib/AST/ASTContext.cpp | 3 +-
- clang/lib/Basic/Builtins.cpp | 28 +-
- clang/lib/Basic/TargetInfo.cpp | 11 +
- clang/lib/Basic/Targets.cpp | 1 -
- clang/lib/CodeGen/CodeGenFunction.cpp | 6 +-
- clang/lib/Frontend/CompilerInvocation.cpp | 22 +-
- clang/lib/Frontend/InitPreprocessor.cpp | 6 +-
- clang/lib/Headers/opencl-c-base.h | 75 +-
- clang/lib/Headers/opencl-c.h | 3216 ++++++++++++++---
- clang/lib/Parse/ParseDecl.cpp | 12 +-
- clang/lib/Parse/ParsePragma.cpp | 10 +-
- clang/lib/Sema/OpenCLBuiltins.td | 153 +-
- clang/lib/Sema/Sema.cpp | 47 +-
- clang/lib/Sema/SemaChecking.cpp | 38 +-
- clang/lib/Sema/SemaDecl.cpp | 18 +-
- clang/lib/Sema/SemaDeclAttr.cpp | 9 +-
- clang/lib/Sema/SemaDeclCXX.cpp | 12 +-
- clang/lib/Sema/SemaLookup.cpp | 19 +-
- clang/lib/Sema/SemaType.cpp | 14 +-
- .../CodeGenOpenCL/addr-space-struct-arg.cl | 7 +-
- .../address-spaces-conversions.cl | 2 +
- .../CodeGenOpenCL/address-spaces-mangling.cl | 3 +-
- clang/test/CodeGenOpenCL/address-spaces.cl | 4 +
- .../amdgcn-automatic-variable.cl | 1 +
- .../CodeGenOpenCL/amdgpu-sizeof-alignof.cl | 21 +-
- .../CodeGenOpenCL/arm-integer-dot-product.cl | 1 +
- .../test/CodeGenOpenCL/cl-uniform-wg-size.cl | 2 +
- clang/test/CodeGenOpenCL/fpmath.cl | 2 +
- .../generic-address-space-feature.cl | 28 +
- .../intel-subgroups-avc-ext-types.cl | 1 +
- .../kernels-have-spir-cc-by-default.cl | 3 +
- clang/test/CodeGenOpenCL/logical-ops.cl | 1 +
- clang/test/CodeGenOpenCL/no-half.cl | 1 +
- clang/test/CodeGenOpenCL/pipe_builtin.cl | 3 +
- clang/test/CodeGenOpenCL/pipe_types.cl | 1 +
- clang/test/CodeGenOpenCL/printf.cl | 2 +
- clang/test/CodeGenOpenCL/unroll-hint.cl | 1 +
- clang/test/Driver/autocomplete.c | 2 +
- clang/test/Driver/opencl.cl | 2 +
- clang/test/Driver/unknown-std.cl | 1 +
- clang/test/Frontend/stdlang.c | 1 +
- clang/test/Headers/opencl-c-header.cl | 7 +-
- clang/test/Index/pipe-size.cl | 7 +
- clang/test/Preprocessor/init-aarch64.c | 12 +-
- clang/test/Preprocessor/predefined-macros.c | 13 +
- .../Sema/feature-extensions-simult-support.cl | 75 +
- clang/test/Sema/features-ignore-pragma.cl | 24 +
- clang/test/Sema/opencl-features-pipes.cl | 18 +
- clang/test/Sema/opencl-features.cl | 128 +
- clang/test/Sema/pipe_builtins_feature.cl | 21 +
- .../address-spaces-conversions-cl2.0.cl | 3 +
- clang/test/SemaOpenCL/address-spaces.cl | 1 +
- .../SemaOpenCL/cl20-device-side-enqueue.cl | 16 +-
- .../SemaOpenCL/forget-unsupported-builtins.cl | 22 +
- clang/test/SemaOpenCL/image-features.cl | 20 +
- .../SemaOpenCL/invalid-pipe-builtin-cl2.0.cl | 1 +
- clang/test/SemaOpenCL/storageclass-cl20.cl | 1 +
- .../TableGen/ClangOpenCLBuiltinEmitter.cpp | 35 +-
- 68 files changed, 3749 insertions(+), 738 deletions(-)
- create mode 100644 clang/test/CodeGenOpenCL/generic-address-space-feature.cl
- create mode 100644 clang/test/Sema/feature-extensions-simult-support.cl
- create mode 100644 clang/test/Sema/features-ignore-pragma.cl
- create mode 100644 clang/test/Sema/opencl-features-pipes.cl
- create mode 100644 clang/test/Sema/opencl-features.cl
- create mode 100644 clang/test/Sema/pipe_builtins_feature.cl
- create mode 100644 clang/test/SemaOpenCL/forget-unsupported-builtins.cl
- create mode 100644 clang/test/SemaOpenCL/image-features.cl
-
-diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def
-index 5463b7dfc18c..e094beab9a6c 100644
---- a/clang/include/clang/Basic/Builtins.def
-+++ b/clang/include/clang/Basic/Builtins.def
-@@ -111,6 +111,10 @@
- # define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
- #endif
-
-+#if defined(BUILTIN) && !defined(OPENCLBUILTIN)
-+# define OPENCLBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG, FEATURE) BUILTIN(ID, TYPE, ATTRS)
-+#endif
-+
- // Standard libc/libm functions:
- BUILTIN(__builtin_atan2 , "ddd" , "Fne")
- BUILTIN(__builtin_atan2f, "fff" , "Fne")
-@@ -1529,50 +1533,54 @@ BUILTIN(__builtin_coro_param, "bv*v*", "n")
-
- // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.
- // We need the generic prototype, since the packet type could be anything.
--LANGBUILTIN(read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(commit_write_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(commit_read_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
--LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
--LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-+OPENCLBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_pipes")
-
- // OpenCL v2.0 s6.13.17 - Enqueue kernel functions.
- // Custom builtin check allows to perform special check of passed block arguments.
--LANGBUILTIN(enqueue_kernel, "i.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCLC20_LANG)
--LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(enqueue_kernel, "i.", "tn", OCLC2P_LANG,
-+ "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC2P_LANG,
-+ "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn",
-+ OCLC2P_LANG, "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn",
-+ OCLC2P_LANG, "__opencl_c_device_enqueue")
-+OPENCLBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC2P_LANG, "__opencl_c_device_enqueue")
-
- // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
- // FIXME: Pointer parameters of OpenCL builtins should have their address space
- // requirement defined.
--LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG)
--LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG)
--LANGBUILTIN(to_private, "v*v*", "tn", OCLC20_LANG)
-+OPENCLBUILTIN(to_global, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-+OPENCLBUILTIN(to_local, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-+OPENCLBUILTIN(to_private, "v*v*", "tn", OCLC2P_LANG, "__opencl_c_generic_address_space")
-
- // OpenCL half load/store builtin
--LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES)
--LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES)
-+OPENCLBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES, "")
-+OPENCLBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES, "")
-
- // Builtins for os_log/os_trace
- BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut")
-@@ -1593,3 +1601,4 @@ BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n")
- #undef BUILTIN
- #undef LIBBUILTIN
- #undef LANGBUILTIN
-+#undef OPENCLBUILTIN
-diff --git a/clang/include/clang/Basic/Builtins.h b/clang/include/clang/Basic/Builtins.h
-index 15bfcf797917..ba3e7853444c 100644
---- a/clang/include/clang/Basic/Builtins.h
-+++ b/clang/include/clang/Basic/Builtins.h
-@@ -33,13 +33,13 @@ enum LanguageID {
- CXX_LANG = 0x4, // builtin for cplusplus only.
- OBJC_LANG = 0x8, // builtin for objective-c and objective-c++
- MS_LANG = 0x10, // builtin requires MS mode.
-- OCLC20_LANG = 0x20, // builtin for OpenCL C 2.0 only.
-+ OCLC2P_LANG = 0x20, // builtin for OpenCL C 2.0+ versions.
- OCLC1X_LANG = 0x40, // builtin for OpenCL C 1.x only.
- OMP_LANG = 0x80, // builtin requires OpenMP.
- ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages.
- ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode.
- ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG, // builtin requires MS mode.
-- ALL_OCLC_LANGUAGES = OCLC1X_LANG | OCLC20_LANG // builtin for OCLC languages.
-+ ALL_OCLC_LANGUAGES = OCLC1X_LANG | OCLC2P_LANG // builtin for OCLC languages.
- };
-
- namespace Builtin {
-@@ -235,6 +235,10 @@ public:
- /// for non-builtins.
- bool canBeRedeclared(unsigned ID) const;
-
-+ bool requiresFeatures(unsigned ID) const {
-+ return requiresFeatures(getRecord(ID));
-+ }
-+
- private:
- const Info &getRecord(unsigned ID) const;
-
-@@ -242,6 +246,11 @@ private:
- bool builtinIsSupported(const Builtin::Info &BuiltinInfo,
- const LangOptions &LangOpts);
-
-+ bool OclBuiltinIsSupported(const Builtin::Info &BuiltinInfo,
-+ const LangOptions &LangOpts) const;
-+
-+ bool requiresFeatures(const Builtin::Info &BuiltinInfo) const;
-+
- /// Helper function for isPrintfLike and isScanfLike.
- bool isLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg,
- const char *Fmt) const;
-diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
-index 1038a4119d4c..ba1b1b67a131 100644
---- a/clang/include/clang/Basic/DiagnosticParseKinds.td
-+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
-@@ -1206,6 +1206,8 @@ def warn_pragma_unsupported_extension : Warning<
- "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
- def warn_pragma_extension_is_core : Warning<
- "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<DiagGroup<"pedantic-core-features">>, DefaultIgnore;
-+def warn_opencl_pragma_feature_ignore : Warning<
-+ "OpenCL feature support can't be controlled via pragma, ignoring">, InGroup<IgnoredPragmas>;
-
- // OpenCL errors.
- def err_opencl_taking_function_address_parser : Error<
-diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
-index 941f2cafc372..aa9e8b7b011b 100644
---- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
-+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -9741,6 +9741,13 @@ def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
- def err_openclcxx_placement_new : Error<
- "use of placement new requires explicit declaration">;
-
-+def err_opencl_pipes_require_feat : Error<
-+ "usage of OpenCL pipes requires feature support">;
-+def err_opencl_memory_scope_require_feat : Error<
-+ "usage of memory scope requires feature support">;
-+def err_opencl_memory_ordering_require_feat : Error<
-+ "usage of memory ordering requires feature support">;
-+
- // MIG routine annotations.
- def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
- "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
-diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
-index 70f68d664bb7..e683f5956975 100644
---- a/clang/include/clang/Basic/LangOptions.def
-+++ b/clang/include/clang/Basic/LangOptions.def
-@@ -215,6 +215,8 @@ LANGOPT(OpenCL , 1, 0, "OpenCL")
- LANGOPT(OpenCLVersion , 32, 0, "OpenCL C version")
- LANGOPT(OpenCLCPlusPlus , 1, 0, "C++ for OpenCL")
- LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "C++ for OpenCL version")
-+LANGOPT(OpenCLGenericKeyword , 1, 0, "OpenCL generic keyword")
-+LANGOPT(OpenCLPipeKeyword , 1, 0, "OpenCL pipe keyword")
- LANGOPT(NativeHalfType , 1, 0, "Native half type support")
- LANGOPT(NativeHalfArgsAndReturns, 1, 0, "Native half args and returns")
- LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns")
-diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
-index b09568e8b3e8..7b915c312746 100644
---- a/clang/include/clang/Basic/LangStandards.def
-+++ b/clang/include/clang/Basic/LangStandards.def
-@@ -167,6 +167,9 @@ LANGSTANDARD(opencl12, "cl1.2",
- LANGSTANDARD(opencl20, "cl2.0",
- OpenCL, "OpenCL 2.0",
- LineComment | C99 | Digraphs | HexFloat | OpenCL)
-+LANGSTANDARD(opencl30, "cl3.0",
-+ OpenCL, "OpenCL 3.0",
-+ LineComment | C99 | Digraphs | HexFloat | OpenCL)
- LANGSTANDARD(openclcpp, "clc++",
- OpenCL, "C++ for OpenCL",
- LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
-@@ -176,6 +179,7 @@ LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
- LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
- LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
- LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
-+LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0")
- LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
-
- // CUDA
-diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def
-index 1ae36b32fb0a..d1574164f9b2 100644
---- a/clang/include/clang/Basic/OpenCLExtensions.def
-+++ b/clang/include/clang/Basic/OpenCLExtensions.def
-@@ -100,6 +100,21 @@ OPENCLEXT_INTERNAL(cl_intel_subgroups, 120, ~0U)
- OPENCLEXT_INTERNAL(cl_intel_subgroups_short, 120, ~0U)
- OPENCLEXT_INTERNAL(cl_intel_device_side_avc_motion_estimation, 120, ~0U)
-
-+OPENCLEXT_INTERNAL(__opencl_c_pipes, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_generic_address_space, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_work_group_collective_functions, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_order_acq_rel, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_order_seq_cst, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_scope_device, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_atomic_scope_all_devices, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_subgroups, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_3d_image_writes, 100, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_device_enqueue, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_read_write_images, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_program_scope_global_variables, 200, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_fp64, 120, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_int64, 100, ~0U)
-+OPENCLEXT_INTERNAL(__opencl_c_images, 100, ~0U)
- #undef OPENCLEXT_INTERNAL
-
- #ifdef OPENCLEXT
-diff --git a/clang/include/clang/Basic/OpenCLOptions.h b/clang/include/clang/Basic/OpenCLOptions.h
-index 15661154eab5..d5800f5611c6 100644
---- a/clang/include/clang/Basic/OpenCLOptions.h
-+++ b/clang/include/clang/Basic/OpenCLOptions.h
-@@ -21,6 +21,10 @@ namespace clang {
-
- /// OpenCL supported extensions and optional core features
- class OpenCLOptions {
-+ // OpenCL Version
-+ unsigned CLVer = 120;
-+ bool IsOpenCLCPlusPlus = false;
-+
- struct Info {
- bool Supported; // Is this option supported
- bool Enabled; // Is this option enabled
-@@ -31,7 +35,38 @@ class OpenCLOptions {
- :Supported(S), Enabled(E), Avail(A), Core(C){}
- };
- llvm::StringMap<Info> OptMap;
-+
- public:
-+ void setOpenCLVersion(const LangOptions &LO) {
-+ IsOpenCLCPlusPlus = LO.OpenCLCPlusPlus;
-+ CLVer = IsOpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
-+ }
-+
-+ // Get extension which is semantically equivalent to a given feature
-+ // if exists (e.g. __opencl_c_subgroups -> cl_khr_subgroups)
-+ llvm::Optional<StringRef> getEquivalentExtension(StringRef Feature) const {
-+ return llvm::StringSwitch<llvm::Optional<StringRef>>(Feature)
-+ .Case("__opencl_c_3d_image_writes",
-+ Optional<StringRef>("cl_khr_3d_image_writes"))
-+ .Case("__opencl_c_subgroups", Optional<StringRef>("cl_khr_subgroups"))
-+ .Case("__opencl_c_fp64", Optional<StringRef>("cl_khr_fp64"))
-+ .Default(Optional<StringRef>());
-+ }
-+
-+ // Same as above but for extensions
-+ llvm::Optional<StringRef> getEquivalentFeature(StringRef Extension) const {
-+ return llvm::StringSwitch<llvm::Optional<StringRef>>(Extension)
-+ .Case("cl_khr_3d_image_writes",
-+ Optional<StringRef>("__opencl_c_3d_image_writes"))
-+ .Case("cl_khr_subgroups", Optional<StringRef>("__opencl_c_subgroups"))
-+ .Case("cl_khr_fp64", Optional<StringRef>("__opencl_c_fp64"))
-+ .Default(Optional<StringRef>());
-+ }
-+
-+ bool isFeature(llvm::StringRef Ext) const {
-+ return Ext.startswith("__opencl_c");
-+ }
-+
- bool isKnown(llvm::StringRef Ext) const {
- return OptMap.find(Ext) != OptMap.end();
- }
-@@ -42,32 +77,88 @@ public:
-
- // Is supported as either an extension or an (optional) core feature for
- // OpenCL version \p CLVer.
-- bool isSupported(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupported(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer;
- }
-
- // Is supported (optional) OpenCL core features for OpenCL version \p CLVer.
- // For supported extension, return false.
-- bool isSupportedCore(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupportedCore(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer && I.Core != ~0U && CLVer >= I.Core;
- }
-
- // Is supported OpenCL extension for OpenCL version \p CLVer.
- // For supported (optional) core feature, return false.
-- bool isSupportedExtension(llvm::StringRef Ext, const LangOptions &LO) const {
-+ bool isSupportedExtension(llvm::StringRef Ext) const {
- // In C++ mode all extensions should work at least as in v2.0.
-- auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
- auto I = OptMap.find(Ext)->getValue();
- return I.Supported && I.Avail <= CLVer && (I.Core == ~0U || CLVer < I.Core);
- }
-
-+ // Support features whose support is directly related to the
-+ // specific OpenCL version. For example, OpenCL 2.0 supports
-+ // all features that are optional in 3.0
-+ void adjustFeatures() {
-+ // Support int64 by default (assume compiling for FULL profile)
-+ OptMap["__opencl_c_int64"].Supported = true;
-+
-+ if (CLVer >= 300) {
-+ // Simultaneously support extension and corresponding feature
-+ for (llvm::StringRef F :
-+ {"__opencl_c_subgroups", "__opencl_c_3d_image_writes",
-+ "__opencl_c_fp64"}) {
-+ auto Ext = getEquivalentExtension(F);
-+ OptMap[*Ext].Supported = OptMap[F].Supported;
-+ }
-+
-+ // OpenCL C compilers that define the feature macro __opencl_c_pipes or
-+ // or __opencl_c_device_enqueue must also define the
-+ // feature macro __opencl_c_generic_address_space.
-+ if (OptMap["__opencl_c_pipes"].Supported ||
-+ OptMap["__opencl_c_device_enqueue"].Supported)
-+ OptMap["__opencl_c_generic_address_space"].Supported = true;
-+
-+ // OpenCL C compilers that define the feature macro
-+ // __opencl_c_3d_image_writes or __opencl_c_read_write_images must also
-+ // define the feature macro __opencl_c_images
-+ if (OptMap["__opencl_c_3d_image_writes"].Supported ||
-+ OptMap["__opencl_c_read_write_images"].Supported)
-+ OptMap["__opencl_c_images"].Supported = true;
-+
-+ // All other features are already supported with options
-+ // or in target settings
-+ return;
-+ }
-+
-+ auto FeaturesRange = llvm::make_filter_range(
-+ OptMap, [&](llvm::StringMapEntry<Info> &OptVal) {
-+ auto Opt = OptVal.getKey();
-+ return isFeature(Opt);
-+ });
-+
-+ for (auto &It : FeaturesRange) {
-+ auto &Info = It.getValue();
-+ // For OpenCL version less then 3.0 some
-+ // features should be supported simulateneously
-+ // with specific extension
-+ if (Optional<llvm::StringRef> Ext = getEquivalentExtension(It.getKey()))
-+ Info.Supported = Info.Enabled = OptMap[*Ext].Supported;
-+ else if (Info.Avail <= CLVer)
-+ Info.Supported = Info.Enabled = true;
-+ }
-+ }
-+
- void enable(llvm::StringRef Ext, bool V = true) {
-+ // Ignore disabling extensions if corresponding features
-+ // already supported for OpenCL version higher then 3.0
-+ if (CLVer >= 300)
-+ if (Optional<llvm::StringRef> F = getEquivalentFeature(Ext))
-+ if (V != OptMap[*F].Enabled)
-+ return;
- OptMap[Ext].Enabled = V;
- }
-
-@@ -96,7 +187,7 @@ public:
- OptMap[Ext].Supported = V;
- }
-
-- OpenCLOptions(){
-+ OpenCLOptions() {
- #define OPENCLEXT_INTERNAL(Ext, AvailVer, CoreVer) \
- OptMap[#Ext].Avail = AvailVer; \
- OptMap[#Ext].Core = CoreVer;
-@@ -104,35 +195,86 @@ public:
- }
-
- void addSupport(const OpenCLOptions &Opts) {
-+ assert(IsOpenCLCPlusPlus == Opts.IsOpenCLCPlusPlus && CLVer == Opts.CLVer);
- for (auto &I:Opts.OptMap)
-- if (I.second.Supported)
-+ if (I.second.Supported) {
- OptMap[I.getKey()].Supported = true;
-+ // All features are enabled as they are supported
-+ if (isFeature(I.getKey()))
-+ OptMap[I.getKey()].Enabled = true;
-+ }
-+ if (CLVer >= 300) {
-+ // Enabling extensions with respect to features
-+ for (llvm::StringRef Ext :
-+ {"cl_khr_3d_image_writes", "cl_khr_subgroups", "cl_khr_fp64"}) {
-+ auto Feature = getEquivalentFeature(Ext);
-+ enable(Ext, OptMap[*Feature].Enabled);
-+ }
-+ }
- }
-
- void copy(const OpenCLOptions &Opts) {
-+ CLVer = Opts.CLVer;
-+ IsOpenCLCPlusPlus = Opts.IsOpenCLCPlusPlus;
- OptMap = Opts.OptMap;
- }
-
- // Turn on or off support of all options.
- void supportAll(bool On = true) {
-- for (llvm::StringMap<Info>::iterator I = OptMap.begin(),
-- E = OptMap.end(); I != E; ++I)
-- I->second.Supported = On;
-+ for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
-+ I != E; ++I)
-+ if (!isFeature(I->getKey()))
-+ I->second.Supported = On;
- }
-
- void disableAll() {
-- for (llvm::StringMap<Info>::iterator I = OptMap.begin(),
-- E = OptMap.end(); I != E; ++I)
-- I->second.Enabled = false;
-+ for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
-+ I != E; ++I) {
-+ auto Ext = I->getKey();
-+ if (!isFeature(Ext))
-+ enable(Ext, false);
-+ }
- }
-
-- void enableSupportedCore(LangOptions LO) {
-+ void enableSupportedCore() {
- for (llvm::StringMap<Info>::iterator I = OptMap.begin(), E = OptMap.end();
- I != E; ++I)
-- if (isSupportedCore(I->getKey(), LO))
-+ if (isSupportedCore(I->getKey()))
- I->second.Enabled = true;
- }
-
-+ // This enum specifies how OpenCL versions map into values
-+ // for encoding. This is used when generating built-ins
-+ // from tablegen
-+ enum OpenCLVersionsEncodings : unsigned short {
-+ OPENCL_C_100_CODE = 0x1,
-+ OPENCL_C_110_CODE = 0x2,
-+ OPENCL_C_120_CODE = 0x4,
-+ OPENCL_C_200_CODE = 0x8,
-+ OPENCL_C_300_CODE = 0x10,
-+ OPENCL_C_ALL_CODE = 0x1f
-+ };
-+
-+ // Encode version into single integer
-+ static unsigned short EncodeVersion(unsigned OpenCLVersion) {
-+ switch (OpenCLVersion) {
-+ default:
-+ llvm_unreachable("Unknown OpenCL version");
-+ case 0:
-+ return OpenCLVersionsEncodings::OPENCL_C_ALL_CODE;
-+ case 100:
-+ return OpenCLVersionsEncodings::OPENCL_C_100_CODE;
-+ case 110:
-+ return OpenCLVersionsEncodings::OPENCL_C_110_CODE;
-+ case 120:
-+ return OpenCLVersionsEncodings::OPENCL_C_120_CODE;
-+ case 200:
-+ return OpenCLVersionsEncodings::OPENCL_C_200_CODE;
-+ case 300:
-+ return OpenCLVersionsEncodings::OPENCL_C_300_CODE;
-+ }
-+ }
-+
- friend class ASTWriter;
- friend class ASTReader;
- };
-diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
-index 966cb907b7e2..62536f2470c2 100644
---- a/clang/include/clang/Driver/Options.td
-+++ b/clang/include/clang/Driver/Options.td
-@@ -557,7 +557,7 @@ def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC
- def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
- HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">;
- def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
-- HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,clc++,CLC++">;
-+ HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++">;
- def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
- HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
- def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
-diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
-index 16a7084f6b08..5920c27229d8 100644
---- a/clang/include/clang/Sema/Sema.h
-+++ b/clang/include/clang/Sema/Sema.h
-@@ -9930,6 +9930,10 @@ public:
- /// \return true if type is disabled.
- bool checkOpenCLDisabledDecl(const NamedDecl &D, const Expr &E);
-
-+ bool checkOpenCLSubgroupExtForCallExpr(CallExpr *Call);
-+
-+ bool isSupportedOpenCLOMemoryOrdering(int64_t Ordering) const;
-+
- //===--------------------------------------------------------------------===//
- // OpenMP directives and clauses.
- //
-@@ -11527,6 +11531,11 @@ public:
- /// that the user intended an assignment used as condition.
- void DiagnoseEqualityWithExtraParens(ParenExpr *ParenE);
-
-+ template <typename DiagLocT, typename DiagInfoT>
-+ void DiagnoseOpenCLRequiresOption(llvm::StringRef OpenCLOptName,
-+ DiagLocT DiagLoc, DiagInfoT DiagInfo,
-+ unsigned Selector, SourceRange SrcRange);
-+
- /// CheckCXXBooleanCondition - Returns true if conversion to bool is invalid.
- ExprResult CheckCXXBooleanCondition(Expr *CondExpr, bool IsConstexpr = false);
-
-diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
-index bf51d35d9693..a54ea8475d7d 100644
---- a/clang/lib/AST/ASTContext.cpp
-+++ b/clang/lib/AST/ASTContext.cpp
-@@ -1433,7 +1433,8 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
- ObjCSuperType = QualType();
-
- // void * type
-- if (LangOpts.OpenCLVersion >= 200) {
-+ if (Target.getSupportedOpenCLOpts().isEnabled(
-+ "__opencl_c_generic_address_space")) {
- auto Q = VoidTy.getQualifiers();
- Q.setAddressSpace(LangAS::opencl_generic);
- VoidPtrTy = getPointerType(getCanonicalType(
-diff --git a/clang/lib/Basic/Builtins.cpp b/clang/lib/Basic/Builtins.cpp
-index 0cd89df41b67..7a3067345098 100644
---- a/clang/lib/Basic/Builtins.cpp
-+++ b/clang/lib/Basic/Builtins.cpp
-@@ -23,6 +23,8 @@ static const Builtin::Info BuiltinInfo[] = {
- { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr },
- #define LANGBUILTIN(ID, TYPE, ATTRS, LANGS) \
- { #ID, TYPE, ATTRS, nullptr, LANGS, nullptr },
-+#define OPENCLBUILTIN(ID, TYPE, ATTRS, LANGS, FEATURE) \
-+ {#ID, TYPE, ATTRS, nullptr, LANGS, FEATURE},
- #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, LANGS) \
- { #ID, TYPE, ATTRS, HEADER, LANGS, nullptr },
- #include "clang/Basic/Builtins.def"
-@@ -69,16 +71,17 @@ bool Builtin::Context::builtinIsSupported(const Builtin::Info &BuiltinInfo,
- bool ObjCUnsupported = !LangOpts.ObjC && BuiltinInfo.Langs == OBJC_LANG;
- bool OclC1Unsupported = (LangOpts.OpenCLVersion / 100) != 1 &&
- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES ) == OCLC1X_LANG;
-- bool OclC2Unsupported =
-- (LangOpts.OpenCLVersion != 200 && !LangOpts.OpenCLCPlusPlus) &&
-- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES) == OCLC20_LANG;
-+ bool OclC2PUnsupported =
-+ (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES) == OCLC2P_LANG &&
-+ ((LangOpts.OpenCLVersion < 200 && !LangOpts.OpenCLCPlusPlus) ||
-+ !OclBuiltinIsSupported(BuiltinInfo, LangOpts));
- bool OclCUnsupported = !LangOpts.OpenCL &&
- (BuiltinInfo.Langs & ALL_OCLC_LANGUAGES);
- bool OpenMPUnsupported = !LangOpts.OpenMP && BuiltinInfo.Langs == OMP_LANG;
- bool CPlusPlusUnsupported =
- !LangOpts.CPlusPlus && BuiltinInfo.Langs == CXX_LANG;
- return !BuiltinsUnsupported && !MathBuiltinsUnsupported && !OclCUnsupported &&
-- !OclC1Unsupported && !OclC2Unsupported && !OpenMPUnsupported &&
-+ !OclC1Unsupported && !OclC2PUnsupported && !OpenMPUnsupported &&
- !GnuModeUnsupported && !MSModeUnsupported && !ObjCUnsupported &&
- !CPlusPlusUnsupported;
- }
-@@ -191,3 +194,20 @@ bool Builtin::Context::canBeRedeclared(unsigned ID) const {
- (!hasReferenceArgsOrResult(ID) &&
- !hasCustomTypechecking(ID));
- }
-+
-+bool Builtin::Context::OclBuiltinIsSupported(
-+ const Builtin::Info &BuiltinInfo, const LangOptions &LangOpts) const {
-+ if (!requiresFeatures(BuiltinInfo))
-+ return true;
-+
-+ return llvm::StringSwitch<bool>(BuiltinInfo.Features)
-+ .Case("__opencl_c_device_enqueue", LangOpts.Blocks)
-+ .Case("__opencl_c_generic_address_space", LangOpts.OpenCLGenericKeyword)
-+ .Case("__opencl_c_pipes", LangOpts.OpenCLPipeKeyword)
-+ .Default(false);
-+}
-+
-+bool Builtin::Context::requiresFeatures(
-+ const Builtin::Info &BuiltinInfo) const {
-+ return BuiltinInfo.Features && llvm::StringRef(BuiltinInfo.Features) != "";
-+}
-diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
-index eccdc21d724a..6b4f524d5271 100644
---- a/clang/lib/Basic/TargetInfo.cpp
-+++ b/clang/lib/Basic/TargetInfo.cpp
-@@ -387,6 +387,17 @@ void TargetInfo::adjust(LangOptions &Opts) {
- HalfFormat = &llvm::APFloat::IEEEhalf();
- FloatFormat = &llvm::APFloat::IEEEsingle();
- LongDoubleFormat = &llvm::APFloat::IEEEquad();
-+
-+ auto &SupportedOCLOpts = getTargetOpts().SupportedOpenCLOptions;
-+
-+ SupportedOCLOpts.setOpenCLVersion(Opts);
-+ SupportedOCLOpts.adjustFeatures();
-+
-+ if (!Opts.OpenCLCPlusPlus && Opts.OpenCLVersion >= 200)
-+ Opts.Blocks = SupportedOCLOpts.isSupported("__opencl_c_device_enqueue");
-+ Opts.OpenCLGenericKeyword =
-+ SupportedOCLOpts.isSupported("__opencl_c_generic_address_space");
-+ Opts.OpenCLPipeKeyword = SupportedOCLOpts.isSupported("__opencl_c_pipes");
- }
-
- if (Opts.DoubleSize) {
-diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
-index 965f273892bd..046d7c15f835 100644
---- a/clang/lib/Basic/Targets.cpp
-+++ b/clang/lib/Basic/Targets.cpp
-@@ -40,7 +40,6 @@
- #include "clang/Basic/Diagnostic.h"
- #include "llvm/ADT/StringExtras.h"
- #include "llvm/ADT/Triple.h"
--
- using namespace clang;
-
- namespace clang {
-diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
-index 8ce488f35dd3..ca4cb0fbf018 100644
---- a/clang/lib/CodeGen/CodeGenFunction.cpp
-+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
-@@ -2306,11 +2306,11 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc,
- std::string MissingFeature;
- if (BuiltinID) {
- SmallVector<StringRef, 1> ReqFeatures;
-- const char *FeatureList =
-- CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID);
- // Return if the builtin doesn't have any required features.
-- if (!FeatureList || StringRef(FeatureList) == "")
-+ if (!CGM.getContext().BuiltinInfo.requiresFeatures(BuiltinID))
- return;
-+ const char *FeatureList =
-+ CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID);
- StringRef(FeatureList).split(ReqFeatures, ',');
- if (!hasRequiredFeatures(ReqFeatures, CGM, FD, MissingFeature))
- CGM.getDiags().Report(Loc, diag::err_builtin_needs_feature)
-diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
-index 73114c6d76cb..bc54d231b97a 100644
---- a/clang/lib/Frontend/CompilerInvocation.cpp
-+++ b/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -2344,6 +2344,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
- Opts.OpenCLVersion = 120;
- else if (LangStd == LangStandard::lang_opencl20)
- Opts.OpenCLVersion = 200;
-+ else if (LangStd == LangStandard::lang_opencl30)
-+ Opts.OpenCLVersion = 300;
- else if (LangStd == LangStandard::lang_openclcpp)
- Opts.OpenCLCPlusPlusVersion = 100;
-
-@@ -2544,14 +2546,15 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
- // -cl-std only applies for OpenCL language standards.
- // Override the -std option in this case.
- if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
-- LangStandard::Kind OpenCLLangStd
-- = llvm::StringSwitch<LangStandard::Kind>(A->getValue())
-- .Cases("cl", "CL", LangStandard::lang_opencl10)
-- .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
-- .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
-- .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
-- .Cases("clc++", "CLC++", LangStandard::lang_openclcpp)
-- .Default(LangStandard::lang_unspecified);
-+ LangStandard::Kind OpenCLLangStd =
-+ llvm::StringSwitch<LangStandard::Kind>(A->getValue())
-+ .Cases("cl", "CL", LangStandard::lang_opencl10)
-+ .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
-+ .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
-+ .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
-+ .Cases("cl3.0", "CL3.0", LangStandard::lang_opencl30)
-+ .Cases("clc++", "CLC++", LangStandard::lang_openclcpp)
-+ .Default(LangStandard::lang_unspecified);
-
- if (OpenCLLangStd == LangStandard::lang_unspecified) {
- Diags.Report(diag::err_drv_invalid_value)
-@@ -2852,8 +2855,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
-
- Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
- Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
-- Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL
-- && Opts.OpenCLVersion == 200);
-+ Opts.Blocks = Args.hasArg(OPT_fblocks);
- Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);
- Opts.Coroutines = Opts.CPlusPlus20 || Args.hasArg(OPT_fcoroutines_ts);
-
-diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
-index 6eef1e2376f6..5bb489c11909 100644
---- a/clang/lib/Frontend/InitPreprocessor.cpp
-+++ b/clang/lib/Frontend/InitPreprocessor.cpp
-@@ -445,6 +445,9 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
- case 200:
- Builder.defineMacro("__OPENCL_C_VERSION__", "200");
- break;
-+ case 300:
-+ Builder.defineMacro("__OPENCL_C_VERSION__", "300");
-+ break;
- default:
- llvm_unreachable("Unsupported OpenCL version");
- }
-@@ -453,6 +456,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
- Builder.defineMacro("CL_VERSION_1_1", "110");
- Builder.defineMacro("CL_VERSION_1_2", "120");
- Builder.defineMacro("CL_VERSION_2_0", "200");
-+ Builder.defineMacro("CL_VERSION_3_0", "300");
-
- if (TI.isLittleEndian())
- Builder.defineMacro("__ENDIAN_LITTLE__");
-@@ -1108,7 +1112,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- // OpenCL definitions.
- if (LangOpts.OpenCL) {
- #define OPENCLEXT(Ext) \
-- if (TI.getSupportedOpenCLOpts().isSupported(#Ext, LangOpts)) \
-+ if (TI.getSupportedOpenCLOpts().isSupported(#Ext)) \
- Builder.defineMacro(#Ext);
- #include "clang/Basic/OpenCLExtensions.def"
-
-diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
-index 430e07d36f62..afa900ab24d9 100644
---- a/clang/lib/Headers/opencl-c-base.h
-+++ b/clang/lib/Headers/opencl-c-base.h
-@@ -9,6 +9,59 @@
- #ifndef _OPENCL_BASE_H_
- #define _OPENCL_BASE_H_
-
-+// Add predefined macros to build headers with standalone executable
-+#ifndef CL_VERSION_3_0
-+ #define CL_VERSION_3_0 300
-+#endif
-+
-+// Define features for 2.0 for header backward compatibility
-+#ifndef __opencl_c_int64
-+ #define __opencl_c_int64 1
-+#endif
-+#if __OPENCL_C_VERSION__ != CL_VERSION_3_0
-+ #ifndef __opencl_c_images
-+ #define __opencl_c_images 1
-+ #endif
-+#endif
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+#ifndef __opencl_c_pipes
-+ #define __opencl_c_pipes 1
-+#endif
-+#ifndef __opencl_c_generic_address_space
-+ #define __opencl_c_generic_address_space 1
-+#endif
-+#ifndef __opencl_c_work_group_collective_functions
-+ #define __opencl_c_work_group_collective_functions 1
-+#endif
-+#ifndef __opencl_c_atomic_order_acq_rel
-+ #define __opencl_c_atomic_order_acq_rel 1
-+#endif
-+#ifndef __opencl_c_atomic_order_seq_cst
-+ #define __opencl_c_atomic_order_seq_cst 1
-+#endif
-+#ifndef __opencl_c_atomic_scope_device
-+ #define __opencl_c_atomic_scope_device 1
-+#endif
-+#ifndef __opencl_c_atomic_scope_all_devices
-+ #define __opencl_c_atomic_scope_all_devices 1
-+#endif
-+#ifndef __opencl_c_subgroups
-+ #define __opencl_c_subgroups 1
-+#endif
-+#ifndef __opencl_c_3d_image_writes
-+ #define __opencl_c_3d_image_writes 1
-+#endif
-+#ifndef __opencl_c_device_enqueue
-+ #define __opencl_c_device_enqueue 1
-+#endif
-+#ifndef __opencl_c_read_write_images
-+ #define __opencl_c_read_write_images 1
-+#endif
-+#ifndef __opencl_c_program_scope_global_variables
-+ #define __opencl_c_program_scope_global_variables 1
-+#endif
-+#endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+
- // built-in scalar data types:
-
- /**
-@@ -115,7 +168,12 @@ typedef half half4 __attribute__((ext_vector_type(4)));
- typedef half half8 __attribute__((ext_vector_type(8)));
- typedef half half16 __attribute__((ext_vector_type(16)));
- #endif
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+
-+#ifndef __opencl_c_fp64
-+ #define __opencl_c_fp64 1
-+#endif
-+
- #if __OPENCL_C_VERSION__ < CL_VERSION_1_2
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
- #endif
-@@ -281,9 +339,17 @@ typedef uint cl_mem_fence_flags;
- typedef enum memory_scope {
- memory_scope_work_item = __OPENCL_MEMORY_SCOPE_WORK_ITEM,
- memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP,
-+#ifdef __opencl_c_atomic_scope_device
- memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE,
-+#endif
-+#ifdef __opencl_c_atomic_scope_all_devices
-+ #if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+ memory_scope_all_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES,
-+ #endif //(__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
- memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES,
--#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups)
-+#endif // __opencl_c_atomic_scope_all_devices
-+#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || \
-+ defined(__opencl_c_subgroups)
- memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP
- #endif
- } memory_scope;
-@@ -301,13 +367,14 @@ typedef enum memory_scope {
- #define ATOMIC_FLAG_INIT 0
-
- // enum values aligned with what clang uses in EmitAtomicExpr()
--typedef enum memory_order
--{
-+typedef enum memory_order {
- memory_order_relaxed = __ATOMIC_RELAXED,
- memory_order_acquire = __ATOMIC_ACQUIRE,
- memory_order_release = __ATOMIC_RELEASE,
- memory_order_acq_rel = __ATOMIC_ACQ_REL,
-+#ifdef __opencl_c_atomic_order_seq_cst
- memory_order_seq_cst = __ATOMIC_SEQ_CST
-+#endif //__opencl_c_atomic_order_seq_cst
- } memory_order;
-
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
-index 66e18bdd47bb..67d900eb1c3d 100644
---- a/clang/lib/Headers/opencl-c.h
-+++ b/clang/lib/Headers/opencl-c.h
-@@ -35,7 +35,6 @@
- #define __purefn __attribute__((pure))
- #define __cnfn __attribute__((const))
-
--
- // OpenCL v1.1/1.2/2.0 s6.2.3 - Explicit conversions
-
- char __ovld __cnfn convert_char_rte(char);
-@@ -4632,7 +4631,7 @@ float16 __ovld __cnfn convert_float16(float16);
-
- // Conversions with double data type parameters or return value.
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- char __ovld __cnfn convert_char(double);
- char __ovld __cnfn convert_char_rte(double);
- char __ovld __cnfn convert_char_rtn(double);
-@@ -5452,7 +5451,7 @@ double16 __ovld __cnfn convert_double16_rtz(uchar16);
- double16 __ovld __cnfn convert_double16_rtz(uint16);
- double16 __ovld __cnfn convert_double16_rtz(ulong16);
- double16 __ovld __cnfn convert_double16_rtz(ushort16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- // Convert half types to non-double types.
-@@ -6270,7 +6269,7 @@ half16 __ovld __cnfn convert_half16_rtz(float16);
- half16 __ovld __cnfn convert_half16_rtz(half16);
-
- // Convert half types to double types.
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn convert_double(half);
- double __ovld __cnfn convert_double_rte(half);
- double __ovld __cnfn convert_double_rtp(half);
-@@ -6333,7 +6332,7 @@ half16 __ovld __cnfn convert_half16_rte(double16);
- half16 __ovld __cnfn convert_half16_rtp(double16);
- half16 __ovld __cnfn convert_half16_rtn(double16);
- half16 __ovld __cnfn convert_half16_rtz(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #endif // cl_khr_fp16
-
-@@ -6404,14 +6403,14 @@ half16 __ovld __cnfn convert_half16_rtz(double16);
- #define as_float8(x) __builtin_astype((x), float8)
- #define as_float16(x) __builtin_astype((x), float16)
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #define as_double(x) __builtin_astype((x), double)
- #define as_double2(x) __builtin_astype((x), double2)
- #define as_double3(x) __builtin_astype((x), double3)
- #define as_double4(x) __builtin_astype((x), double4)
- #define as_double8(x) __builtin_astype((x), double8)
- #define as_double16(x) __builtin_astype((x), double16)
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- #define as_half(x) __builtin_astype((x), half)
-@@ -6534,14 +6533,14 @@ float3 __ovld __cnfn acos(float3);
- float4 __ovld __cnfn acos(float4);
- float8 __ovld __cnfn acos(float8);
- float16 __ovld __cnfn acos(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acos(double);
- double2 __ovld __cnfn acos(double2);
- double3 __ovld __cnfn acos(double3);
- double4 __ovld __cnfn acos(double4);
- double8 __ovld __cnfn acos(double8);
- double16 __ovld __cnfn acos(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acos(half);
- half2 __ovld __cnfn acos(half2);
-@@ -6560,14 +6559,14 @@ float3 __ovld __cnfn acosh(float3);
- float4 __ovld __cnfn acosh(float4);
- float8 __ovld __cnfn acosh(float8);
- float16 __ovld __cnfn acosh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acosh(double);
- double2 __ovld __cnfn acosh(double2);
- double3 __ovld __cnfn acosh(double3);
- double4 __ovld __cnfn acosh(double4);
- double8 __ovld __cnfn acosh(double8);
- double16 __ovld __cnfn acosh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acosh(half);
- half2 __ovld __cnfn acosh(half2);
-@@ -6586,14 +6585,14 @@ float3 __ovld __cnfn acospi(float3 x);
- float4 __ovld __cnfn acospi(float4 x);
- float8 __ovld __cnfn acospi(float8 x);
- float16 __ovld __cnfn acospi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn acospi(double x);
- double2 __ovld __cnfn acospi(double2 x);
- double3 __ovld __cnfn acospi(double3 x);
- double4 __ovld __cnfn acospi(double4 x);
- double8 __ovld __cnfn acospi(double8 x);
- double16 __ovld __cnfn acospi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn acospi(half x);
- half2 __ovld __cnfn acospi(half2 x);
-@@ -6612,14 +6611,14 @@ float3 __ovld __cnfn asin(float3);
- float4 __ovld __cnfn asin(float4);
- float8 __ovld __cnfn asin(float8);
- float16 __ovld __cnfn asin(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asin(double);
- double2 __ovld __cnfn asin(double2);
- double3 __ovld __cnfn asin(double3);
- double4 __ovld __cnfn asin(double4);
- double8 __ovld __cnfn asin(double8);
- double16 __ovld __cnfn asin(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asin(half);
- half2 __ovld __cnfn asin(half2);
-@@ -6638,14 +6637,14 @@ float3 __ovld __cnfn asinh(float3);
- float4 __ovld __cnfn asinh(float4);
- float8 __ovld __cnfn asinh(float8);
- float16 __ovld __cnfn asinh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asinh(double);
- double2 __ovld __cnfn asinh(double2);
- double3 __ovld __cnfn asinh(double3);
- double4 __ovld __cnfn asinh(double4);
- double8 __ovld __cnfn asinh(double8);
- double16 __ovld __cnfn asinh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asinh(half);
- half2 __ovld __cnfn asinh(half2);
-@@ -6664,14 +6663,14 @@ float3 __ovld __cnfn asinpi(float3 x);
- float4 __ovld __cnfn asinpi(float4 x);
- float8 __ovld __cnfn asinpi(float8 x);
- float16 __ovld __cnfn asinpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn asinpi(double x);
- double2 __ovld __cnfn asinpi(double2 x);
- double3 __ovld __cnfn asinpi(double3 x);
- double4 __ovld __cnfn asinpi(double4 x);
- double8 __ovld __cnfn asinpi(double8 x);
- double16 __ovld __cnfn asinpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn asinpi(half x);
- half2 __ovld __cnfn asinpi(half2 x);
-@@ -6690,14 +6689,14 @@ float3 __ovld __cnfn atan(float3 y_over_x);
- float4 __ovld __cnfn atan(float4 y_over_x);
- float8 __ovld __cnfn atan(float8 y_over_x);
- float16 __ovld __cnfn atan(float16 y_over_x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan(double y_over_x);
- double2 __ovld __cnfn atan(double2 y_over_x);
- double3 __ovld __cnfn atan(double3 y_over_x);
- double4 __ovld __cnfn atan(double4 y_over_x);
- double8 __ovld __cnfn atan(double8 y_over_x);
- double16 __ovld __cnfn atan(double16 y_over_x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan(half y_over_x);
- half2 __ovld __cnfn atan(half2 y_over_x);
-@@ -6716,14 +6715,14 @@ float3 __ovld __cnfn atan2(float3 y, float3 x);
- float4 __ovld __cnfn atan2(float4 y, float4 x);
- float8 __ovld __cnfn atan2(float8 y, float8 x);
- float16 __ovld __cnfn atan2(float16 y, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan2(double y, double x);
- double2 __ovld __cnfn atan2(double2 y, double2 x);
- double3 __ovld __cnfn atan2(double3 y, double3 x);
- double4 __ovld __cnfn atan2(double4 y, double4 x);
- double8 __ovld __cnfn atan2(double8 y, double8 x);
- double16 __ovld __cnfn atan2(double16 y, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan2(half y, half x);
- half2 __ovld __cnfn atan2(half2 y, half2 x);
-@@ -6742,14 +6741,14 @@ float3 __ovld __cnfn atanh(float3);
- float4 __ovld __cnfn atanh(float4);
- float8 __ovld __cnfn atanh(float8);
- float16 __ovld __cnfn atanh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atanh(double);
- double2 __ovld __cnfn atanh(double2);
- double3 __ovld __cnfn atanh(double3);
- double4 __ovld __cnfn atanh(double4);
- double8 __ovld __cnfn atanh(double8);
- double16 __ovld __cnfn atanh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atanh(half);
- half2 __ovld __cnfn atanh(half2);
-@@ -6768,14 +6767,14 @@ float3 __ovld __cnfn atanpi(float3 x);
- float4 __ovld __cnfn atanpi(float4 x);
- float8 __ovld __cnfn atanpi(float8 x);
- float16 __ovld __cnfn atanpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atanpi(double x);
- double2 __ovld __cnfn atanpi(double2 x);
- double3 __ovld __cnfn atanpi(double3 x);
- double4 __ovld __cnfn atanpi(double4 x);
- double8 __ovld __cnfn atanpi(double8 x);
- double16 __ovld __cnfn atanpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atanpi(half x);
- half2 __ovld __cnfn atanpi(half2 x);
-@@ -6794,14 +6793,14 @@ float3 __ovld __cnfn atan2pi(float3 y, float3 x);
- float4 __ovld __cnfn atan2pi(float4 y, float4 x);
- float8 __ovld __cnfn atan2pi(float8 y, float8 x);
- float16 __ovld __cnfn atan2pi(float16 y, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn atan2pi(double y, double x);
- double2 __ovld __cnfn atan2pi(double2 y, double2 x);
- double3 __ovld __cnfn atan2pi(double3 y, double3 x);
- double4 __ovld __cnfn atan2pi(double4 y, double4 x);
- double8 __ovld __cnfn atan2pi(double8 y, double8 x);
- double16 __ovld __cnfn atan2pi(double16 y, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn atan2pi(half y, half x);
- half2 __ovld __cnfn atan2pi(half2 y, half2 x);
-@@ -6820,14 +6819,14 @@ float3 __ovld __cnfn cbrt(float3);
- float4 __ovld __cnfn cbrt(float4);
- float8 __ovld __cnfn cbrt(float8);
- float16 __ovld __cnfn cbrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cbrt(double);
- double2 __ovld __cnfn cbrt(double2);
- double3 __ovld __cnfn cbrt(double3);
- double4 __ovld __cnfn cbrt(double4);
- double8 __ovld __cnfn cbrt(double8);
- double16 __ovld __cnfn cbrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cbrt(half);
- half2 __ovld __cnfn cbrt(half2);
-@@ -6847,14 +6846,14 @@ float3 __ovld __cnfn ceil(float3);
- float4 __ovld __cnfn ceil(float4);
- float8 __ovld __cnfn ceil(float8);
- float16 __ovld __cnfn ceil(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn ceil(double);
- double2 __ovld __cnfn ceil(double2);
- double3 __ovld __cnfn ceil(double3);
- double4 __ovld __cnfn ceil(double4);
- double8 __ovld __cnfn ceil(double8);
- double16 __ovld __cnfn ceil(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn ceil(half);
- half2 __ovld __cnfn ceil(half2);
-@@ -6873,14 +6872,14 @@ float3 __ovld __cnfn copysign(float3 x, float3 y);
- float4 __ovld __cnfn copysign(float4 x, float4 y);
- float8 __ovld __cnfn copysign(float8 x, float8 y);
- float16 __ovld __cnfn copysign(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn copysign(double x, double y);
- double2 __ovld __cnfn copysign(double2 x, double2 y);
- double3 __ovld __cnfn copysign(double3 x, double3 y);
- double4 __ovld __cnfn copysign(double4 x, double4 y);
- double8 __ovld __cnfn copysign(double8 x, double8 y);
- double16 __ovld __cnfn copysign(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn copysign(half x, half y);
- half2 __ovld __cnfn copysign(half2 x, half2 y);
-@@ -6899,14 +6898,14 @@ float3 __ovld __cnfn cos(float3);
- float4 __ovld __cnfn cos(float4);
- float8 __ovld __cnfn cos(float8);
- float16 __ovld __cnfn cos(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cos(double);
- double2 __ovld __cnfn cos(double2);
- double3 __ovld __cnfn cos(double3);
- double4 __ovld __cnfn cos(double4);
- double8 __ovld __cnfn cos(double8);
- double16 __ovld __cnfn cos(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cos(half);
- half2 __ovld __cnfn cos(half2);
-@@ -6925,14 +6924,14 @@ float3 __ovld __cnfn cosh(float3);
- float4 __ovld __cnfn cosh(float4);
- float8 __ovld __cnfn cosh(float8);
- float16 __ovld __cnfn cosh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cosh(double);
- double2 __ovld __cnfn cosh(double2);
- double3 __ovld __cnfn cosh(double3);
- double4 __ovld __cnfn cosh(double4);
- double8 __ovld __cnfn cosh(double8);
- double16 __ovld __cnfn cosh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cosh(half);
- half2 __ovld __cnfn cosh(half2);
-@@ -6951,14 +6950,14 @@ float3 __ovld __cnfn cospi(float3 x);
- float4 __ovld __cnfn cospi(float4 x);
- float8 __ovld __cnfn cospi(float8 x);
- float16 __ovld __cnfn cospi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn cospi(double x);
- double2 __ovld __cnfn cospi(double2 x);
- double3 __ovld __cnfn cospi(double3 x);
- double4 __ovld __cnfn cospi(double4 x);
- double8 __ovld __cnfn cospi(double8 x);
- double16 __ovld __cnfn cospi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn cospi(half x);
- half2 __ovld __cnfn cospi(half2 x);
-@@ -6977,14 +6976,14 @@ float3 __ovld __cnfn erfc(float3);
- float4 __ovld __cnfn erfc(float4);
- float8 __ovld __cnfn erfc(float8);
- float16 __ovld __cnfn erfc(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn erfc(double);
- double2 __ovld __cnfn erfc(double2);
- double3 __ovld __cnfn erfc(double3);
- double4 __ovld __cnfn erfc(double4);
- double8 __ovld __cnfn erfc(double8);
- double16 __ovld __cnfn erfc(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn erfc(half);
- half2 __ovld __cnfn erfc(half2);
-@@ -7004,14 +7003,14 @@ float3 __ovld __cnfn erf(float3);
- float4 __ovld __cnfn erf(float4);
- float8 __ovld __cnfn erf(float8);
- float16 __ovld __cnfn erf(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn erf(double);
- double2 __ovld __cnfn erf(double2);
- double3 __ovld __cnfn erf(double3);
- double4 __ovld __cnfn erf(double4);
- double8 __ovld __cnfn erf(double8);
- double16 __ovld __cnfn erf(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn erf(half);
- half2 __ovld __cnfn erf(half2);
-@@ -7030,14 +7029,14 @@ float3 __ovld __cnfn exp(float3 x);
- float4 __ovld __cnfn exp(float4 x);
- float8 __ovld __cnfn exp(float8 x);
- float16 __ovld __cnfn exp(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp(double x);
- double2 __ovld __cnfn exp(double2 x);
- double3 __ovld __cnfn exp(double3 x);
- double4 __ovld __cnfn exp(double4 x);
- double8 __ovld __cnfn exp(double8 x);
- double16 __ovld __cnfn exp(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp(half x);
- half2 __ovld __cnfn exp(half2 x);
-@@ -7056,14 +7055,14 @@ float3 __ovld __cnfn exp2(float3);
- float4 __ovld __cnfn exp2(float4);
- float8 __ovld __cnfn exp2(float8);
- float16 __ovld __cnfn exp2(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp2(double);
- double2 __ovld __cnfn exp2(double2);
- double3 __ovld __cnfn exp2(double3);
- double4 __ovld __cnfn exp2(double4);
- double8 __ovld __cnfn exp2(double8);
- double16 __ovld __cnfn exp2(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp2(half);
- half2 __ovld __cnfn exp2(half2);
-@@ -7082,14 +7081,14 @@ float3 __ovld __cnfn exp10(float3);
- float4 __ovld __cnfn exp10(float4);
- float8 __ovld __cnfn exp10(float8);
- float16 __ovld __cnfn exp10(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn exp10(double);
- double2 __ovld __cnfn exp10(double2);
- double3 __ovld __cnfn exp10(double3);
- double4 __ovld __cnfn exp10(double4);
- double8 __ovld __cnfn exp10(double8);
- double16 __ovld __cnfn exp10(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn exp10(half);
- half2 __ovld __cnfn exp10(half2);
-@@ -7108,14 +7107,14 @@ float3 __ovld __cnfn expm1(float3 x);
- float4 __ovld __cnfn expm1(float4 x);
- float8 __ovld __cnfn expm1(float8 x);
- float16 __ovld __cnfn expm1(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn expm1(double x);
- double2 __ovld __cnfn expm1(double2 x);
- double3 __ovld __cnfn expm1(double3 x);
- double4 __ovld __cnfn expm1(double4 x);
- double8 __ovld __cnfn expm1(double8 x);
- double16 __ovld __cnfn expm1(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn expm1(half x);
- half2 __ovld __cnfn expm1(half2 x);
-@@ -7134,14 +7133,14 @@ float3 __ovld __cnfn fabs(float3);
- float4 __ovld __cnfn fabs(float4);
- float8 __ovld __cnfn fabs(float8);
- float16 __ovld __cnfn fabs(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fabs(double);
- double2 __ovld __cnfn fabs(double2);
- double3 __ovld __cnfn fabs(double3);
- double4 __ovld __cnfn fabs(double4);
- double8 __ovld __cnfn fabs(double8);
- double16 __ovld __cnfn fabs(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fabs(half);
- half2 __ovld __cnfn fabs(half2);
-@@ -7160,14 +7159,14 @@ float3 __ovld __cnfn fdim(float3 x, float3 y);
- float4 __ovld __cnfn fdim(float4 x, float4 y);
- float8 __ovld __cnfn fdim(float8 x, float8 y);
- float16 __ovld __cnfn fdim(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fdim(double x, double y);
- double2 __ovld __cnfn fdim(double2 x, double2 y);
- double3 __ovld __cnfn fdim(double3 x, double3 y);
- double4 __ovld __cnfn fdim(double4 x, double4 y);
- double8 __ovld __cnfn fdim(double8 x, double8 y);
- double16 __ovld __cnfn fdim(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fdim(half x, half y);
- half2 __ovld __cnfn fdim(half2 x, half2 y);
-@@ -7187,14 +7186,14 @@ float3 __ovld __cnfn floor(float3);
- float4 __ovld __cnfn floor(float4);
- float8 __ovld __cnfn floor(float8);
- float16 __ovld __cnfn floor(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn floor(double);
- double2 __ovld __cnfn floor(double2);
- double3 __ovld __cnfn floor(double3);
- double4 __ovld __cnfn floor(double4);
- double8 __ovld __cnfn floor(double8);
- double16 __ovld __cnfn floor(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn floor(half);
- half2 __ovld __cnfn floor(half2);
-@@ -7217,14 +7216,14 @@ float3 __ovld __cnfn fma(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn fma(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn fma(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn fma(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fma(double a, double b, double c);
- double2 __ovld __cnfn fma(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn fma(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn fma(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn fma(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn fma(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fma(half a, half b, half c);
- half2 __ovld __cnfn fma(half2 a, half2 b, half2 c);
-@@ -7251,7 +7250,7 @@ float3 __ovld __cnfn fmax(float3 x, float y);
- float4 __ovld __cnfn fmax(float4 x, float y);
- float8 __ovld __cnfn fmax(float8 x, float y);
- float16 __ovld __cnfn fmax(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmax(double x, double y);
- double2 __ovld __cnfn fmax(double2 x, double2 y);
- double3 __ovld __cnfn fmax(double3 x, double3 y);
-@@ -7263,7 +7262,7 @@ double3 __ovld __cnfn fmax(double3 x, double y);
- double4 __ovld __cnfn fmax(double4 x, double y);
- double8 __ovld __cnfn fmax(double8 x, double y);
- double16 __ovld __cnfn fmax(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmax(half x, half y);
- half2 __ovld __cnfn fmax(half2 x, half2 y);
-@@ -7295,7 +7294,7 @@ float3 __ovld __cnfn fmin(float3 x, float y);
- float4 __ovld __cnfn fmin(float4 x, float y);
- float8 __ovld __cnfn fmin(float8 x, float y);
- float16 __ovld __cnfn fmin(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmin(double x, double y);
- double2 __ovld __cnfn fmin(double2 x, double2 y);
- double3 __ovld __cnfn fmin(double3 x, double3 y);
-@@ -7307,7 +7306,7 @@ double3 __ovld __cnfn fmin(double3 x, double y);
- double4 __ovld __cnfn fmin(double4 x, double y);
- double8 __ovld __cnfn fmin(double8 x, double y);
- double16 __ovld __cnfn fmin(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmin(half x, half y);
- half2 __ovld __cnfn fmin(half2 x, half2 y);
-@@ -7331,14 +7330,14 @@ float3 __ovld __cnfn fmod(float3 x, float3 y);
- float4 __ovld __cnfn fmod(float4 x, float4 y);
- float8 __ovld __cnfn fmod(float8 x, float8 y);
- float16 __ovld __cnfn fmod(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn fmod(double x, double y);
- double2 __ovld __cnfn fmod(double2 x, double2 y);
- double3 __ovld __cnfn fmod(double3 x, double3 y);
- double4 __ovld __cnfn fmod(double4 x, double4 y);
- double8 __ovld __cnfn fmod(double8 x, double8 y);
- double16 __ovld __cnfn fmod(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn fmod(half x, half y);
- half2 __ovld __cnfn fmod(half2 x, half2 y);
-@@ -7352,21 +7351,21 @@ half16 __ovld __cnfn fmod(half16 x, half16 y);
- * Returns fmin(x - floor (x), 0x1.fffffep-1f ).
- * floor(x) is returned in iptr.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld fract(float x, float *iptr);
- float2 __ovld fract(float2 x, float2 *iptr);
- float3 __ovld fract(float3 x, float3 *iptr);
- float4 __ovld fract(float4 x, float4 *iptr);
- float8 __ovld fract(float8 x, float8 *iptr);
- float16 __ovld fract(float16 x, float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld fract(double x, double *iptr);
- double2 __ovld fract(double2 x, double2 *iptr);
- double3 __ovld fract(double3 x, double3 *iptr);
- double4 __ovld fract(double4 x, double4 *iptr);
- double8 __ovld fract(double8 x, double8 *iptr);
- double16 __ovld fract(double16 x, double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld fract(half x, half *iptr);
- half2 __ovld fract(half2 x, half2 *iptr);
-@@ -7375,7 +7374,9 @@ half4 __ovld fract(half4 x, half4 *iptr);
- half8 __ovld fract(half8 x, half8 *iptr);
- half16 __ovld fract(half16 x, half16 *iptr);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld fract(float x, __global float *iptr);
- float2 __ovld fract(float2 x, __global float2 *iptr);
- float3 __ovld fract(float3 x, __global float3 *iptr);
-@@ -7394,7 +7395,7 @@ float3 __ovld fract(float3 x, __private float3 *iptr);
- float4 __ovld fract(float4 x, __private float4 *iptr);
- float8 __ovld fract(float8 x, __private float8 *iptr);
- float16 __ovld fract(float16 x, __private float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld fract(double x, __global double *iptr);
- double2 __ovld fract(double2 x, __global double2 *iptr);
- double3 __ovld fract(double3 x, __global double3 *iptr);
-@@ -7413,7 +7414,7 @@ double3 __ovld fract(double3 x, __private double3 *iptr);
- double4 __ovld fract(double4 x, __private double4 *iptr);
- double8 __ovld fract(double8 x, __private double8 *iptr);
- double16 __ovld fract(double16 x, __private double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld fract(half x, __global half *iptr);
- half2 __ovld fract(half2 x, __global half2 *iptr);
-@@ -7434,29 +7435,29 @@ half4 __ovld fract(half4 x, __private half4 *iptr);
- half8 __ovld fract(half8 x, __private half8 *iptr);
- half16 __ovld fract(half16 x, __private half16 *iptr);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Extract mantissa and exponent from x. For each
- * component the mantissa returned is a float with
- * magnitude in the interval [1/2, 1) or 0. Each
- * component of x equals mantissa returned * 2^exp.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld frexp(float x, int *exp);
- float2 __ovld frexp(float2 x, int2 *exp);
- float3 __ovld frexp(float3 x, int3 *exp);
- float4 __ovld frexp(float4 x, int4 *exp);
- float8 __ovld frexp(float8 x, int8 *exp);
- float16 __ovld frexp(float16 x, int16 *exp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld frexp(double x, int *exp);
- double2 __ovld frexp(double2 x, int2 *exp);
- double3 __ovld frexp(double3 x, int3 *exp);
- double4 __ovld frexp(double4 x, int4 *exp);
- double8 __ovld frexp(double8 x, int8 *exp);
- double16 __ovld frexp(double16 x, int16 *exp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld frexp(half x, int *exp);
- half2 __ovld frexp(half2 x, int2 *exp);
-@@ -7465,7 +7466,9 @@ half4 __ovld frexp(half4 x, int4 *exp);
- half8 __ovld frexp(half8 x, int8 *exp);
- half16 __ovld frexp(half16 x, int16 *exp);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld frexp(float x, __global int *exp);
- float2 __ovld frexp(float2 x, __global int2 *exp);
- float3 __ovld frexp(float3 x, __global int3 *exp);
-@@ -7484,7 +7487,7 @@ float3 __ovld frexp(float3 x, __private int3 *exp);
- float4 __ovld frexp(float4 x, __private int4 *exp);
- float8 __ovld frexp(float8 x, __private int8 *exp);
- float16 __ovld frexp(float16 x, __private int16 *exp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld frexp(double x, __global int *exp);
- double2 __ovld frexp(double2 x, __global int2 *exp);
- double3 __ovld frexp(double3 x, __global int3 *exp);
-@@ -7503,7 +7506,7 @@ double3 __ovld frexp(double3 x, __private int3 *exp);
- double4 __ovld frexp(double4 x, __private int4 *exp);
- double8 __ovld frexp(double8 x, __private int8 *exp);
- double16 __ovld frexp(double16 x, __private int16 *exp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld frexp(half x, __global int *exp);
- half2 __ovld frexp(half2 x, __global int2 *exp);
-@@ -7524,7 +7527,8 @@ half4 __ovld frexp(half4 x, __private int4 *exp);
- half8 __ovld frexp(half8 x, __private int8 *exp);
- half16 __ovld frexp(half16 x, __private int16 *exp);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
-
- /**
- * Compute the value of the square root of x^2 + y^2
-@@ -7536,14 +7540,14 @@ float3 __ovld __cnfn hypot(float3 x, float3 y);
- float4 __ovld __cnfn hypot(float4 x, float4 y);
- float8 __ovld __cnfn hypot(float8 x, float8 y);
- float16 __ovld __cnfn hypot(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn hypot(double x, double y);
- double2 __ovld __cnfn hypot(double2 x, double2 y);
- double3 __ovld __cnfn hypot(double3 x, double3 y);
- double4 __ovld __cnfn hypot(double4 x, double4 y);
- double8 __ovld __cnfn hypot(double8 x, double8 y);
- double16 __ovld __cnfn hypot(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn hypot(half x, half y);
- half2 __ovld __cnfn hypot(half2 x, half2 y);
-@@ -7562,14 +7566,14 @@ int3 __ovld __cnfn ilogb(float3 x);
- int4 __ovld __cnfn ilogb(float4 x);
- int8 __ovld __cnfn ilogb(float8 x);
- int16 __ovld __cnfn ilogb(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn ilogb(double x);
- int2 __ovld __cnfn ilogb(double2 x);
- int3 __ovld __cnfn ilogb(double3 x);
- int4 __ovld __cnfn ilogb(double4 x);
- int8 __ovld __cnfn ilogb(double8 x);
- int16 __ovld __cnfn ilogb(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn ilogb(half x);
- int2 __ovld __cnfn ilogb(half2 x);
-@@ -7593,7 +7597,7 @@ float3 __ovld __cnfn ldexp(float3 x, int n);
- float4 __ovld __cnfn ldexp(float4 x, int n);
- float8 __ovld __cnfn ldexp(float8 x, int n);
- float16 __ovld __cnfn ldexp(float16 x, int n);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn ldexp(double x, int n);
- double2 __ovld __cnfn ldexp(double2 x, int2 n);
- double3 __ovld __cnfn ldexp(double3 x, int3 n);
-@@ -7605,7 +7609,7 @@ double3 __ovld __cnfn ldexp(double3 x, int n);
- double4 __ovld __cnfn ldexp(double4 x, int n);
- double8 __ovld __cnfn ldexp(double8 x, int n);
- double16 __ovld __cnfn ldexp(double16 x, int n);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn ldexp(half x, int n);
- half2 __ovld __cnfn ldexp(half2 x, int2 n);
-@@ -7632,14 +7636,14 @@ float3 __ovld __cnfn lgamma(float3 x);
- float4 __ovld __cnfn lgamma(float4 x);
- float8 __ovld __cnfn lgamma(float8 x);
- float16 __ovld __cnfn lgamma(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn lgamma(double x);
- double2 __ovld __cnfn lgamma(double2 x);
- double3 __ovld __cnfn lgamma(double3 x);
- double4 __ovld __cnfn lgamma(double4 x);
- double8 __ovld __cnfn lgamma(double8 x);
- double16 __ovld __cnfn lgamma(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn lgamma(half x);
- half2 __ovld __cnfn lgamma(half2 x);
-@@ -7649,21 +7653,21 @@ half8 __ovld __cnfn lgamma(half8 x);
- half16 __ovld __cnfn lgamma(half16 x);
- #endif //cl_khr_fp16
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld lgamma_r(float x, int *signp);
- float2 __ovld lgamma_r(float2 x, int2 *signp);
- float3 __ovld lgamma_r(float3 x, int3 *signp);
- float4 __ovld lgamma_r(float4 x, int4 *signp);
- float8 __ovld lgamma_r(float8 x, int8 *signp);
- float16 __ovld lgamma_r(float16 x, int16 *signp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld lgamma_r(double x, int *signp);
- double2 __ovld lgamma_r(double2 x, int2 *signp);
- double3 __ovld lgamma_r(double3 x, int3 *signp);
- double4 __ovld lgamma_r(double4 x, int4 *signp);
- double8 __ovld lgamma_r(double8 x, int8 *signp);
- double16 __ovld lgamma_r(double16 x, int16 *signp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld lgamma_r(half x, int *signp);
- half2 __ovld lgamma_r(half2 x, int2 *signp);
-@@ -7672,7 +7676,9 @@ half4 __ovld lgamma_r(half4 x, int4 *signp);
- half8 __ovld lgamma_r(half8 x, int8 *signp);
- half16 __ovld lgamma_r(half16 x, int16 *signp);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld lgamma_r(float x, __global int *signp);
- float2 __ovld lgamma_r(float2 x, __global int2 *signp);
- float3 __ovld lgamma_r(float3 x, __global int3 *signp);
-@@ -7691,7 +7697,7 @@ float3 __ovld lgamma_r(float3 x, __private int3 *signp);
- float4 __ovld lgamma_r(float4 x, __private int4 *signp);
- float8 __ovld lgamma_r(float8 x, __private int8 *signp);
- float16 __ovld lgamma_r(float16 x, __private int16 *signp);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld lgamma_r(double x, __global int *signp);
- double2 __ovld lgamma_r(double2 x, __global int2 *signp);
- double3 __ovld lgamma_r(double3 x, __global int3 *signp);
-@@ -7710,7 +7716,7 @@ double3 __ovld lgamma_r(double3 x, __private int3 *signp);
- double4 __ovld lgamma_r(double4 x, __private int4 *signp);
- double8 __ovld lgamma_r(double8 x, __private int8 *signp);
- double16 __ovld lgamma_r(double16 x, __private int16 *signp);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld lgamma_r(half x, __global int *signp);
- half2 __ovld lgamma_r(half2 x, __global int2 *signp);
-@@ -7731,8 +7737,8 @@ half4 __ovld lgamma_r(half4 x, __private int4 *signp);
- half8 __ovld lgamma_r(half8 x, __private int8 *signp);
- half16 __ovld lgamma_r(half16 x, __private int16 *signp);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Compute natural logarithm.
- */
-@@ -7742,14 +7748,14 @@ float3 __ovld __cnfn log(float3);
- float4 __ovld __cnfn log(float4);
- float8 __ovld __cnfn log(float8);
- float16 __ovld __cnfn log(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log(double);
- double2 __ovld __cnfn log(double2);
- double3 __ovld __cnfn log(double3);
- double4 __ovld __cnfn log(double4);
- double8 __ovld __cnfn log(double8);
- double16 __ovld __cnfn log(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log(half);
- half2 __ovld __cnfn log(half2);
-@@ -7760,7 +7766,7 @@ half16 __ovld __cnfn log(half16);
- #endif //cl_khr_fp16
-
- /**
-- * Compute a base 2 logarithm.
-+ * Compute a base 2 logarithm
- */
- float __ovld __cnfn log2(float);
- float2 __ovld __cnfn log2(float2);
-@@ -7768,14 +7774,14 @@ float3 __ovld __cnfn log2(float3);
- float4 __ovld __cnfn log2(float4);
- float8 __ovld __cnfn log2(float8);
- float16 __ovld __cnfn log2(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log2(double);
- double2 __ovld __cnfn log2(double2);
- double3 __ovld __cnfn log2(double3);
- double4 __ovld __cnfn log2(double4);
- double8 __ovld __cnfn log2(double8);
- double16 __ovld __cnfn log2(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log2(half);
- half2 __ovld __cnfn log2(half2);
-@@ -7794,14 +7800,14 @@ float3 __ovld __cnfn log10(float3);
- float4 __ovld __cnfn log10(float4);
- float8 __ovld __cnfn log10(float8);
- float16 __ovld __cnfn log10(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log10(double);
- double2 __ovld __cnfn log10(double2);
- double3 __ovld __cnfn log10(double3);
- double4 __ovld __cnfn log10(double4);
- double8 __ovld __cnfn log10(double8);
- double16 __ovld __cnfn log10(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log10(half);
- half2 __ovld __cnfn log10(half2);
-@@ -7820,14 +7826,14 @@ float3 __ovld __cnfn log1p(float3 x);
- float4 __ovld __cnfn log1p(float4 x);
- float8 __ovld __cnfn log1p(float8 x);
- float16 __ovld __cnfn log1p(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn log1p(double x);
- double2 __ovld __cnfn log1p(double2 x);
- double3 __ovld __cnfn log1p(double3 x);
- double4 __ovld __cnfn log1p(double4 x);
- double8 __ovld __cnfn log1p(double8 x);
- double16 __ovld __cnfn log1p(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn log1p(half x);
- half2 __ovld __cnfn log1p(half2 x);
-@@ -7847,14 +7853,14 @@ float3 __ovld __cnfn logb(float3 x);
- float4 __ovld __cnfn logb(float4 x);
- float8 __ovld __cnfn logb(float8 x);
- float16 __ovld __cnfn logb(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn logb(double x);
- double2 __ovld __cnfn logb(double2 x);
- double3 __ovld __cnfn logb(double3 x);
- double4 __ovld __cnfn logb(double4 x);
- double8 __ovld __cnfn logb(double8 x);
- double16 __ovld __cnfn logb(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn logb(half x);
- half2 __ovld __cnfn logb(half2 x);
-@@ -7877,14 +7883,14 @@ float3 __ovld __cnfn mad(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn mad(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn mad(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn mad(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn mad(double a, double b, double c);
- double2 __ovld __cnfn mad(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn mad(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn mad(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn mad(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn mad(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn mad(half a, half b, half c);
- half2 __ovld __cnfn mad(half2 a, half2 b, half2 c);
-@@ -7904,14 +7910,14 @@ float3 __ovld __cnfn maxmag(float3 x, float3 y);
- float4 __ovld __cnfn maxmag(float4 x, float4 y);
- float8 __ovld __cnfn maxmag(float8 x, float8 y);
- float16 __ovld __cnfn maxmag(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn maxmag(double x, double y);
- double2 __ovld __cnfn maxmag(double2 x, double2 y);
- double3 __ovld __cnfn maxmag(double3 x, double3 y);
- double4 __ovld __cnfn maxmag(double4 x, double4 y);
- double8 __ovld __cnfn maxmag(double8 x, double8 y);
- double16 __ovld __cnfn maxmag(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn maxmag(half x, half y);
- half2 __ovld __cnfn maxmag(half2 x, half2 y);
-@@ -7931,14 +7937,14 @@ float3 __ovld __cnfn minmag(float3 x, float3 y);
- float4 __ovld __cnfn minmag(float4 x, float4 y);
- float8 __ovld __cnfn minmag(float8 x, float8 y);
- float16 __ovld __cnfn minmag(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn minmag(double x, double y);
- double2 __ovld __cnfn minmag(double2 x, double2 y);
- double3 __ovld __cnfn minmag(double3 x, double3 y);
- double4 __ovld __cnfn minmag(double4 x, double4 y);
- double8 __ovld __cnfn minmag(double8 x, double8 y);
- double16 __ovld __cnfn minmag(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn minmag(half x, half y);
- half2 __ovld __cnfn minmag(half2 x, half2 y);
-@@ -7955,21 +7961,21 @@ half16 __ovld __cnfn minmag(half16 x, half16 y);
- * the argument. It stores the integral part in the object
- * pointed to by iptr.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld modf(float x, float *iptr);
- float2 __ovld modf(float2 x, float2 *iptr);
- float3 __ovld modf(float3 x, float3 *iptr);
- float4 __ovld modf(float4 x, float4 *iptr);
- float8 __ovld modf(float8 x, float8 *iptr);
- float16 __ovld modf(float16 x, float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld modf(double x, double *iptr);
- double2 __ovld modf(double2 x, double2 *iptr);
- double3 __ovld modf(double3 x, double3 *iptr);
- double4 __ovld modf(double4 x, double4 *iptr);
- double8 __ovld modf(double8 x, double8 *iptr);
- double16 __ovld modf(double16 x, double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld modf(half x, half *iptr);
- half2 __ovld modf(half2 x, half2 *iptr);
-@@ -7978,7 +7984,9 @@ half4 __ovld modf(half4 x, half4 *iptr);
- half8 __ovld modf(half8 x, half8 *iptr);
- half16 __ovld modf(half16 x, half16 *iptr);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld modf(float x, __global float *iptr);
- float2 __ovld modf(float2 x, __global float2 *iptr);
- float3 __ovld modf(float3 x, __global float3 *iptr);
-@@ -7997,7 +8005,7 @@ float3 __ovld modf(float3 x, __private float3 *iptr);
- float4 __ovld modf(float4 x, __private float4 *iptr);
- float8 __ovld modf(float8 x, __private float8 *iptr);
- float16 __ovld modf(float16 x, __private float16 *iptr);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld modf(double x, __global double *iptr);
- double2 __ovld modf(double2 x, __global double2 *iptr);
- double3 __ovld modf(double3 x, __global double3 *iptr);
-@@ -8016,7 +8024,7 @@ double3 __ovld modf(double3 x, __private double3 *iptr);
- double4 __ovld modf(double4 x, __private double4 *iptr);
- double8 __ovld modf(double8 x, __private double8 *iptr);
- double16 __ovld modf(double16 x, __private double16 *iptr);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld modf(half x, __global half *iptr);
- half2 __ovld modf(half2 x, __global half2 *iptr);
-@@ -8037,7 +8045,8 @@ half4 __ovld modf(half4 x, __private half4 *iptr);
- half8 __ovld modf(half8 x, __private half8 *iptr);
- half16 __ovld modf(half16 x, __private half16 *iptr);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
-
- /**
- * Returns a quiet NaN. The nancode may be placed
-@@ -8049,14 +8058,14 @@ float3 __ovld __cnfn nan(uint3 nancode);
- float4 __ovld __cnfn nan(uint4 nancode);
- float8 __ovld __cnfn nan(uint8 nancode);
- float16 __ovld __cnfn nan(uint16 nancode);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn nan(ulong nancode);
- double2 __ovld __cnfn nan(ulong2 nancode);
- double3 __ovld __cnfn nan(ulong3 nancode);
- double4 __ovld __cnfn nan(ulong4 nancode);
- double8 __ovld __cnfn nan(ulong8 nancode);
- double16 __ovld __cnfn nan(ulong16 nancode);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn nan(ushort nancode);
- half2 __ovld __cnfn nan(ushort2 nancode);
-@@ -8079,14 +8088,14 @@ float3 __ovld __cnfn nextafter(float3 x, float3 y);
- float4 __ovld __cnfn nextafter(float4 x, float4 y);
- float8 __ovld __cnfn nextafter(float8 x, float8 y);
- float16 __ovld __cnfn nextafter(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn nextafter(double x, double y);
- double2 __ovld __cnfn nextafter(double2 x, double2 y);
- double3 __ovld __cnfn nextafter(double3 x, double3 y);
- double4 __ovld __cnfn nextafter(double4 x, double4 y);
- double8 __ovld __cnfn nextafter(double8 x, double8 y);
- double16 __ovld __cnfn nextafter(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn nextafter(half x, half y);
- half2 __ovld __cnfn nextafter(half2 x, half2 y);
-@@ -8105,14 +8114,14 @@ float3 __ovld __cnfn pow(float3 x, float3 y);
- float4 __ovld __cnfn pow(float4 x, float4 y);
- float8 __ovld __cnfn pow(float8 x, float8 y);
- float16 __ovld __cnfn pow(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn pow(double x, double y);
- double2 __ovld __cnfn pow(double2 x, double2 y);
- double3 __ovld __cnfn pow(double3 x, double3 y);
- double4 __ovld __cnfn pow(double4 x, double4 y);
- double8 __ovld __cnfn pow(double8 x, double8 y);
- double16 __ovld __cnfn pow(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn pow(half x, half y);
- half2 __ovld __cnfn pow(half2 x, half2 y);
-@@ -8131,14 +8140,14 @@ float3 __ovld __cnfn pown(float3 x, int3 y);
- float4 __ovld __cnfn pown(float4 x, int4 y);
- float8 __ovld __cnfn pown(float8 x, int8 y);
- float16 __ovld __cnfn pown(float16 x, int16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn pown(double x, int y);
- double2 __ovld __cnfn pown(double2 x, int2 y);
- double3 __ovld __cnfn pown(double3 x, int3 y);
- double4 __ovld __cnfn pown(double4 x, int4 y);
- double8 __ovld __cnfn pown(double8 x, int8 y);
- double16 __ovld __cnfn pown(double16 x, int16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn pown(half x, int y);
- half2 __ovld __cnfn pown(half2 x, int2 y);
-@@ -8157,14 +8166,14 @@ float3 __ovld __cnfn powr(float3 x, float3 y);
- float4 __ovld __cnfn powr(float4 x, float4 y);
- float8 __ovld __cnfn powr(float8 x, float8 y);
- float16 __ovld __cnfn powr(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn powr(double x, double y);
- double2 __ovld __cnfn powr(double2 x, double2 y);
- double3 __ovld __cnfn powr(double3 x, double3 y);
- double4 __ovld __cnfn powr(double4 x, double4 y);
- double8 __ovld __cnfn powr(double8 x, double8 y);
- double16 __ovld __cnfn powr(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn powr(half x, half y);
- half2 __ovld __cnfn powr(half2 x, half2 y);
-@@ -8186,14 +8195,14 @@ float3 __ovld __cnfn remainder(float3 x, float3 y);
- float4 __ovld __cnfn remainder(float4 x, float4 y);
- float8 __ovld __cnfn remainder(float8 x, float8 y);
- float16 __ovld __cnfn remainder(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn remainder(double x, double y);
- double2 __ovld __cnfn remainder(double2 x, double2 y);
- double3 __ovld __cnfn remainder(double3 x, double3 y);
- double4 __ovld __cnfn remainder(double4 x, double4 y);
- double8 __ovld __cnfn remainder(double8 x, double8 y);
- double16 __ovld __cnfn remainder(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn remainder(half x, half y);
- half2 __ovld __cnfn remainder(half2 x, half2 y);
-@@ -8215,21 +8224,21 @@ half16 __ovld __cnfn remainder(half16 x, half16 y);
- * sign as x/y. It stores this signed value in the object
- * pointed to by quo.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld remquo(float x, float y, int *quo);
- float2 __ovld remquo(float2 x, float2 y, int2 *quo);
- float3 __ovld remquo(float3 x, float3 y, int3 *quo);
- float4 __ovld remquo(float4 x, float4 y, int4 *quo);
- float8 __ovld remquo(float8 x, float8 y, int8 *quo);
- float16 __ovld remquo(float16 x, float16 y, int16 *quo);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld remquo(double x, double y, int *quo);
- double2 __ovld remquo(double2 x, double2 y, int2 *quo);
- double3 __ovld remquo(double3 x, double3 y, int3 *quo);
- double4 __ovld remquo(double4 x, double4 y, int4 *quo);
- double8 __ovld remquo(double8 x, double8 y, int8 *quo);
- double16 __ovld remquo(double16 x, double16 y, int16 *quo);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld remquo(half x, half y, int *quo);
- half2 __ovld remquo(half2 x, half2 y, int2 *quo);
-@@ -8237,9 +8246,10 @@ half3 __ovld remquo(half3 x, half3 y, int3 *quo);
- half4 __ovld remquo(half4 x, half4 y, int4 *quo);
- half8 __ovld remquo(half8 x, half8 y, int8 *quo);
- half16 __ovld remquo(half16 x, half16 y, int16 *quo);
--
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld remquo(float x, float y, __global int *quo);
- float2 __ovld remquo(float2 x, float2 y, __global int2 *quo);
- float3 __ovld remquo(float3 x, float3 y, __global int3 *quo);
-@@ -8258,7 +8268,7 @@ float3 __ovld remquo(float3 x, float3 y, __private int3 *quo);
- float4 __ovld remquo(float4 x, float4 y, __private int4 *quo);
- float8 __ovld remquo(float8 x, float8 y, __private int8 *quo);
- float16 __ovld remquo(float16 x, float16 y, __private int16 *quo);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld remquo(double x, double y, __global int *quo);
- double2 __ovld remquo(double2 x, double2 y, __global int2 *quo);
- double3 __ovld remquo(double3 x, double3 y, __global int3 *quo);
-@@ -8277,7 +8287,7 @@ double3 __ovld remquo(double3 x, double3 y, __private int3 *quo);
- double4 __ovld remquo(double4 x, double4 y, __private int4 *quo);
- double8 __ovld remquo(double8 x, double8 y, __private int8 *quo);
- double16 __ovld remquo(double16 x, double16 y, __private int16 *quo);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld remquo(half x, half y, __global int *quo);
- half2 __ovld remquo(half2 x, half2 y, __global int2 *quo);
-@@ -8298,7 +8308,8 @@ half4 __ovld remquo(half4 x, half4 y, __private int4 *quo);
- half8 __ovld remquo(half8 x, half8 y, __private int8 *quo);
- half16 __ovld remquo(half16 x, half16 y, __private int16 *quo);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Round to integral value (using round to nearest
- * even rounding mode) in floating-point format.
-@@ -8311,14 +8322,14 @@ float3 __ovld __cnfn rint(float3);
- float4 __ovld __cnfn rint(float4);
- float8 __ovld __cnfn rint(float8);
- float16 __ovld __cnfn rint(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rint(double);
- double2 __ovld __cnfn rint(double2);
- double3 __ovld __cnfn rint(double3);
- double4 __ovld __cnfn rint(double4);
- double8 __ovld __cnfn rint(double8);
- double16 __ovld __cnfn rint(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rint(half);
- half2 __ovld __cnfn rint(half2);
-@@ -8337,14 +8348,14 @@ float3 __ovld __cnfn rootn(float3 x, int3 y);
- float4 __ovld __cnfn rootn(float4 x, int4 y);
- float8 __ovld __cnfn rootn(float8 x, int8 y);
- float16 __ovld __cnfn rootn(float16 x, int16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rootn(double x, int y);
- double2 __ovld __cnfn rootn(double2 x, int2 y);
- double3 __ovld __cnfn rootn(double3 x, int3 y);
- double4 __ovld __cnfn rootn(double4 x, int4 y);
- double8 __ovld __cnfn rootn(double8 x, int8 y);
- double16 __ovld __cnfn rootn(double16 x, int16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rootn(half x, int y);
- half2 __ovld __cnfn rootn(half2 x, int2 y);
-@@ -8365,14 +8376,14 @@ float3 __ovld __cnfn round(float3 x);
- float4 __ovld __cnfn round(float4 x);
- float8 __ovld __cnfn round(float8 x);
- float16 __ovld __cnfn round(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn round(double x);
- double2 __ovld __cnfn round(double2 x);
- double3 __ovld __cnfn round(double3 x);
- double4 __ovld __cnfn round(double4 x);
- double8 __ovld __cnfn round(double8 x);
- double16 __ovld __cnfn round(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn round(half x);
- half2 __ovld __cnfn round(half2 x);
-@@ -8391,14 +8402,14 @@ float3 __ovld __cnfn rsqrt(float3);
- float4 __ovld __cnfn rsqrt(float4);
- float8 __ovld __cnfn rsqrt(float8);
- float16 __ovld __cnfn rsqrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn rsqrt(double);
- double2 __ovld __cnfn rsqrt(double2);
- double3 __ovld __cnfn rsqrt(double3);
- double4 __ovld __cnfn rsqrt(double4);
- double8 __ovld __cnfn rsqrt(double8);
- double16 __ovld __cnfn rsqrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn rsqrt(half);
- half2 __ovld __cnfn rsqrt(half2);
-@@ -8417,14 +8428,14 @@ float3 __ovld __cnfn sin(float3);
- float4 __ovld __cnfn sin(float4);
- float8 __ovld __cnfn sin(float8);
- float16 __ovld __cnfn sin(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sin(double);
- double2 __ovld __cnfn sin(double2);
- double3 __ovld __cnfn sin(double3);
- double4 __ovld __cnfn sin(double4);
- double8 __ovld __cnfn sin(double8);
- double16 __ovld __cnfn sin(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sin(half);
- half2 __ovld __cnfn sin(half2);
-@@ -8439,21 +8450,21 @@ half16 __ovld __cnfn sin(half16);
- * is the return value and computed cosine is returned
- * in cosval.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld sincos(float x, float *cosval);
- float2 __ovld sincos(float2 x, float2 *cosval);
- float3 __ovld sincos(float3 x, float3 *cosval);
- float4 __ovld sincos(float4 x, float4 *cosval);
- float8 __ovld sincos(float8 x, float8 *cosval);
- float16 __ovld sincos(float16 x, float16 *cosval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld sincos(double x, double *cosval);
- double2 __ovld sincos(double2 x, double2 *cosval);
- double3 __ovld sincos(double3 x, double3 *cosval);
- double4 __ovld sincos(double4 x, double4 *cosval);
- double8 __ovld sincos(double8 x, double8 *cosval);
- double16 __ovld sincos(double16 x, double16 *cosval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld sincos(half x, half *cosval);
- half2 __ovld sincos(half2 x, half2 *cosval);
-@@ -8462,7 +8473,9 @@ half4 __ovld sincos(half4 x, half4 *cosval);
- half8 __ovld sincos(half8 x, half8 *cosval);
- half16 __ovld sincos(half16 x, half16 *cosval);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
-+
-+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- float __ovld sincos(float x, __global float *cosval);
- float2 __ovld sincos(float2 x, __global float2 *cosval);
- float3 __ovld sincos(float3 x, __global float3 *cosval);
-@@ -8481,7 +8494,7 @@ float3 __ovld sincos(float3 x, __private float3 *cosval);
- float4 __ovld sincos(float4 x, __private float4 *cosval);
- float8 __ovld sincos(float8 x, __private float8 *cosval);
- float16 __ovld sincos(float16 x, __private float16 *cosval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld sincos(double x, __global double *cosval);
- double2 __ovld sincos(double2 x, __global double2 *cosval);
- double3 __ovld sincos(double3 x, __global double3 *cosval);
-@@ -8500,7 +8513,7 @@ double3 __ovld sincos(double3 x, __private double3 *cosval);
- double4 __ovld sincos(double4 x, __private double4 *cosval);
- double8 __ovld sincos(double8 x, __private double8 *cosval);
- double16 __ovld sincos(double16 x, __private double16 *cosval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld sincos(half x, __global half *cosval);
- half2 __ovld sincos(half2 x, __global half2 *cosval);
-@@ -8521,8 +8534,8 @@ half4 __ovld sincos(half4 x, __private half4 *cosval);
- half8 __ovld sincos(half8 x, __private half8 *cosval);
- half16 __ovld sincos(half16 x, __private half16 *cosval);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //! defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ !=
-+ //! CL_VERSION_2_0)
- /**
- * Compute hyperbolic sine.
- */
-@@ -8532,14 +8545,14 @@ float3 __ovld __cnfn sinh(float3);
- float4 __ovld __cnfn sinh(float4);
- float8 __ovld __cnfn sinh(float8);
- float16 __ovld __cnfn sinh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sinh(double);
- double2 __ovld __cnfn sinh(double2);
- double3 __ovld __cnfn sinh(double3);
- double4 __ovld __cnfn sinh(double4);
- double8 __ovld __cnfn sinh(double8);
- double16 __ovld __cnfn sinh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sinh(half);
- half2 __ovld __cnfn sinh(half2);
-@@ -8558,14 +8571,14 @@ float3 __ovld __cnfn sinpi(float3 x);
- float4 __ovld __cnfn sinpi(float4 x);
- float8 __ovld __cnfn sinpi(float8 x);
- float16 __ovld __cnfn sinpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sinpi(double x);
- double2 __ovld __cnfn sinpi(double2 x);
- double3 __ovld __cnfn sinpi(double3 x);
- double4 __ovld __cnfn sinpi(double4 x);
- double8 __ovld __cnfn sinpi(double8 x);
- double16 __ovld __cnfn sinpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sinpi(half x);
- half2 __ovld __cnfn sinpi(half2 x);
-@@ -8584,14 +8597,14 @@ float3 __ovld __cnfn sqrt(float3);
- float4 __ovld __cnfn sqrt(float4);
- float8 __ovld __cnfn sqrt(float8);
- float16 __ovld __cnfn sqrt(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sqrt(double);
- double2 __ovld __cnfn sqrt(double2);
- double3 __ovld __cnfn sqrt(double3);
- double4 __ovld __cnfn sqrt(double4);
- double8 __ovld __cnfn sqrt(double8);
- double16 __ovld __cnfn sqrt(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sqrt(half);
- half2 __ovld __cnfn sqrt(half2);
-@@ -8610,14 +8623,14 @@ float3 __ovld __cnfn tan(float3);
- float4 __ovld __cnfn tan(float4);
- float8 __ovld __cnfn tan(float8);
- float16 __ovld __cnfn tan(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tan(double);
- double2 __ovld __cnfn tan(double2);
- double3 __ovld __cnfn tan(double3);
- double4 __ovld __cnfn tan(double4);
- double8 __ovld __cnfn tan(double8);
- double16 __ovld __cnfn tan(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tan(half);
- half2 __ovld __cnfn tan(half2);
-@@ -8636,14 +8649,14 @@ float3 __ovld __cnfn tanh(float3);
- float4 __ovld __cnfn tanh(float4);
- float8 __ovld __cnfn tanh(float8);
- float16 __ovld __cnfn tanh(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tanh(double);
- double2 __ovld __cnfn tanh(double2);
- double3 __ovld __cnfn tanh(double3);
- double4 __ovld __cnfn tanh(double4);
- double8 __ovld __cnfn tanh(double8);
- double16 __ovld __cnfn tanh(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tanh(half);
- half2 __ovld __cnfn tanh(half2);
-@@ -8662,14 +8675,14 @@ float3 __ovld __cnfn tanpi(float3 x);
- float4 __ovld __cnfn tanpi(float4 x);
- float8 __ovld __cnfn tanpi(float8 x);
- float16 __ovld __cnfn tanpi(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tanpi(double x);
- double2 __ovld __cnfn tanpi(double2 x);
- double3 __ovld __cnfn tanpi(double3 x);
- double4 __ovld __cnfn tanpi(double4 x);
- double8 __ovld __cnfn tanpi(double8 x);
- double16 __ovld __cnfn tanpi(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tanpi(half x);
- half2 __ovld __cnfn tanpi(half2 x);
-@@ -8688,14 +8701,14 @@ float3 __ovld __cnfn tgamma(float3);
- float4 __ovld __cnfn tgamma(float4);
- float8 __ovld __cnfn tgamma(float8);
- float16 __ovld __cnfn tgamma(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn tgamma(double);
- double2 __ovld __cnfn tgamma(double2);
- double3 __ovld __cnfn tgamma(double3);
- double4 __ovld __cnfn tgamma(double4);
- double8 __ovld __cnfn tgamma(double8);
- double16 __ovld __cnfn tgamma(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn tgamma(half);
- half2 __ovld __cnfn tgamma(half2);
-@@ -8715,14 +8728,14 @@ float3 __ovld __cnfn trunc(float3);
- float4 __ovld __cnfn trunc(float4);
- float8 __ovld __cnfn trunc(float8);
- float16 __ovld __cnfn trunc(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn trunc(double);
- double2 __ovld __cnfn trunc(double2);
- double3 __ovld __cnfn trunc(double3);
- double4 __ovld __cnfn trunc(double4);
- double8 __ovld __cnfn trunc(double8);
- double16 __ovld __cnfn trunc(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn trunc(half);
- half2 __ovld __cnfn trunc(half2);
-@@ -10108,7 +10121,7 @@ float3 __ovld __cnfn clamp(float3 x, float minval, float maxval);
- float4 __ovld __cnfn clamp(float4 x, float minval, float maxval);
- float8 __ovld __cnfn clamp(float8 x, float minval, float maxval);
- float16 __ovld __cnfn clamp(float16 x, float minval, float maxval);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn clamp(double x, double minval, double maxval);
- double2 __ovld __cnfn clamp(double2 x, double2 minval, double2 maxval);
- double3 __ovld __cnfn clamp(double3 x, double3 minval, double3 maxval);
-@@ -10120,7 +10133,7 @@ double3 __ovld __cnfn clamp(double3 x, double minval, double maxval);
- double4 __ovld __cnfn clamp(double4 x, double minval, double maxval);
- double8 __ovld __cnfn clamp(double8 x, double minval, double maxval);
- double16 __ovld __cnfn clamp(double16 x, double minval, double maxval);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn clamp(half x, half minval, half maxval);
- half2 __ovld __cnfn clamp(half2 x, half2 minval, half2 maxval);
-@@ -10145,14 +10158,14 @@ float3 __ovld __cnfn degrees(float3 radians);
- float4 __ovld __cnfn degrees(float4 radians);
- float8 __ovld __cnfn degrees(float8 radians);
- float16 __ovld __cnfn degrees(float16 radians);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn degrees(double radians);
- double2 __ovld __cnfn degrees(double2 radians);
- double3 __ovld __cnfn degrees(double3 radians);
- double4 __ovld __cnfn degrees(double4 radians);
- double8 __ovld __cnfn degrees(double8 radians);
- double16 __ovld __cnfn degrees(double16 radians);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn degrees(half radians);
- half2 __ovld __cnfn degrees(half2 radians);
-@@ -10177,7 +10190,7 @@ float3 __ovld __cnfn max(float3 x, float y);
- float4 __ovld __cnfn max(float4 x, float y);
- float8 __ovld __cnfn max(float8 x, float y);
- float16 __ovld __cnfn max(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn max(double x, double y);
- double2 __ovld __cnfn max(double2 x, double2 y);
- double3 __ovld __cnfn max(double3 x, double3 y);
-@@ -10189,7 +10202,7 @@ double3 __ovld __cnfn max(double3 x, double y);
- double4 __ovld __cnfn max(double4 x, double y);
- double8 __ovld __cnfn max(double8 x, double y);
- double16 __ovld __cnfn max(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn max(half x, half y);
- half2 __ovld __cnfn max(half2 x, half2 y);
-@@ -10219,7 +10232,7 @@ float3 __ovld __cnfn min(float3 x, float y);
- float4 __ovld __cnfn min(float4 x, float y);
- float8 __ovld __cnfn min(float8 x, float y);
- float16 __ovld __cnfn min(float16 x, float y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn min(double x, double y);
- double2 __ovld __cnfn min(double2 x, double2 y);
- double3 __ovld __cnfn min(double3 x, double3 y);
-@@ -10231,7 +10244,7 @@ double3 __ovld __cnfn min(double3 x, double y);
- double4 __ovld __cnfn min(double4 x, double y);
- double8 __ovld __cnfn min(double8 x, double y);
- double16 __ovld __cnfn min(double16 x, double y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn min(half x, half y);
- half2 __ovld __cnfn min(half2 x, half2 y);
-@@ -10264,7 +10277,7 @@ float3 __ovld __cnfn mix(float3 x, float3 y, float a);
- float4 __ovld __cnfn mix(float4 x, float4 y, float a);
- float8 __ovld __cnfn mix(float8 x, float8 y, float a);
- float16 __ovld __cnfn mix(float16 x, float16 y, float a);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn mix(double x, double y, double a);
- double2 __ovld __cnfn mix(double2 x, double2 y, double2 a);
- double3 __ovld __cnfn mix(double3 x, double3 y, double3 a);
-@@ -10276,7 +10289,7 @@ double3 __ovld __cnfn mix(double3 x, double3 y, double a);
- double4 __ovld __cnfn mix(double4 x, double4 y, double a);
- double8 __ovld __cnfn mix(double8 x, double8 y, double a);
- double16 __ovld __cnfn mix(double16 x, double16 y, double a);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn mix(half x, half y, half a);
- half2 __ovld __cnfn mix(half2 x, half2 y, half2 a);
-@@ -10301,14 +10314,14 @@ float3 __ovld __cnfn radians(float3 degrees);
- float4 __ovld __cnfn radians(float4 degrees);
- float8 __ovld __cnfn radians(float8 degrees);
- float16 __ovld __cnfn radians(float16 degrees);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn radians(double degrees);
- double2 __ovld __cnfn radians(double2 degrees);
- double3 __ovld __cnfn radians(double3 degrees);
- double4 __ovld __cnfn radians(double4 degrees);
- double8 __ovld __cnfn radians(double8 degrees);
- double16 __ovld __cnfn radians(double16 degrees);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn radians(half degrees);
- half2 __ovld __cnfn radians(half2 degrees);
-@@ -10332,7 +10345,7 @@ float3 __ovld __cnfn step(float edge, float3 x);
- float4 __ovld __cnfn step(float edge, float4 x);
- float8 __ovld __cnfn step(float edge, float8 x);
- float16 __ovld __cnfn step(float edge, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn step(double edge, double x);
- double2 __ovld __cnfn step(double2 edge, double2 x);
- double3 __ovld __cnfn step(double3 edge, double3 x);
-@@ -10344,7 +10357,7 @@ double3 __ovld __cnfn step(double edge, double3 x);
- double4 __ovld __cnfn step(double edge, double4 x);
- double8 __ovld __cnfn step(double edge, double8 x);
- double16 __ovld __cnfn step(double edge, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn step(half edge, half x);
- half2 __ovld __cnfn step(half2 edge, half2 x);
-@@ -10383,7 +10396,7 @@ float3 __ovld __cnfn smoothstep(float edge0, float edge1, float3 x);
- float4 __ovld __cnfn smoothstep(float edge0, float edge1, float4 x);
- float8 __ovld __cnfn smoothstep(float edge0, float edge1, float8 x);
- float16 __ovld __cnfn smoothstep(float edge0, float edge1, float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn smoothstep(double edge0, double edge1, double x);
- double2 __ovld __cnfn smoothstep(double2 edge0, double2 edge1, double2 x);
- double3 __ovld __cnfn smoothstep(double3 edge0, double3 edge1, double3 x);
-@@ -10395,7 +10408,7 @@ double3 __ovld __cnfn smoothstep(double edge0, double edge1, double3 x);
- double4 __ovld __cnfn smoothstep(double edge0, double edge1, double4 x);
- double8 __ovld __cnfn smoothstep(double edge0, double edge1, double8 x);
- double16 __ovld __cnfn smoothstep(double edge0, double edge1, double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn smoothstep(half edge0, half edge1, half x);
- half2 __ovld __cnfn smoothstep(half2 edge0, half2 edge1, half2 x);
-@@ -10420,14 +10433,14 @@ float3 __ovld __cnfn sign(float3 x);
- float4 __ovld __cnfn sign(float4 x);
- float8 __ovld __cnfn sign(float8 x);
- float16 __ovld __cnfn sign(float16 x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn sign(double x);
- double2 __ovld __cnfn sign(double2 x);
- double3 __ovld __cnfn sign(double3 x);
- double4 __ovld __cnfn sign(double4 x);
- double8 __ovld __cnfn sign(double8 x);
- double16 __ovld __cnfn sign(double16 x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn sign(half x);
- half2 __ovld __cnfn sign(half2 x);
-@@ -10445,10 +10458,10 @@ half16 __ovld __cnfn sign(half16 x);
- */
- float4 __ovld __cnfn cross(float4 p0, float4 p1);
- float3 __ovld __cnfn cross(float3 p0, float3 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double4 __ovld __cnfn cross(double4 p0, double4 p1);
- double3 __ovld __cnfn cross(double3 p0, double3 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half4 __ovld __cnfn cross(half4 p0, half4 p1);
- half3 __ovld __cnfn cross(half3 p0, half3 p1);
-@@ -10461,12 +10474,12 @@ float __ovld __cnfn dot(float p0, float p1);
- float __ovld __cnfn dot(float2 p0, float2 p1);
- float __ovld __cnfn dot(float3 p0, float3 p1);
- float __ovld __cnfn dot(float4 p0, float4 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn dot(double p0, double p1);
- double __ovld __cnfn dot(double2 p0, double2 p1);
- double __ovld __cnfn dot(double3 p0, double3 p1);
- double __ovld __cnfn dot(double4 p0, double4 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn dot(half p0, half p1);
- half __ovld __cnfn dot(half2 p0, half2 p1);
-@@ -10482,12 +10495,12 @@ float __ovld __cnfn distance(float p0, float p1);
- float __ovld __cnfn distance(float2 p0, float2 p1);
- float __ovld __cnfn distance(float3 p0, float3 p1);
- float __ovld __cnfn distance(float4 p0, float4 p1);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn distance(double p0, double p1);
- double __ovld __cnfn distance(double2 p0, double2 p1);
- double __ovld __cnfn distance(double3 p0, double3 p1);
- double __ovld __cnfn distance(double4 p0, double4 p1);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn distance(half p0, half p1);
- half __ovld __cnfn distance(half2 p0, half2 p1);
-@@ -10503,12 +10516,12 @@ float __ovld __cnfn length(float p);
- float __ovld __cnfn length(float2 p);
- float __ovld __cnfn length(float3 p);
- float __ovld __cnfn length(float4 p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn length(double p);
- double __ovld __cnfn length(double2 p);
- double __ovld __cnfn length(double3 p);
- double __ovld __cnfn length(double4 p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn length(half p);
- half __ovld __cnfn length(half2 p);
-@@ -10524,12 +10537,12 @@ float __ovld __cnfn normalize(float p);
- float2 __ovld __cnfn normalize(float2 p);
- float3 __ovld __cnfn normalize(float3 p);
- float4 __ovld __cnfn normalize(float4 p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn normalize(double p);
- double2 __ovld __cnfn normalize(double2 p);
- double3 __ovld __cnfn normalize(double3 p);
- double4 __ovld __cnfn normalize(double4 p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn normalize(half p);
- half2 __ovld __cnfn normalize(half2 p);
-@@ -10610,14 +10623,14 @@ int3 __ovld __cnfn isequal(float3 x, float3 y);
- int4 __ovld __cnfn isequal(float4 x, float4 y);
- int8 __ovld __cnfn isequal(float8 x, float8 y);
- int16 __ovld __cnfn isequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isequal(double x, double y);
- long2 __ovld __cnfn isequal(double2 x, double2 y);
- long3 __ovld __cnfn isequal(double3 x, double3 y);
- long4 __ovld __cnfn isequal(double4 x, double4 y);
- long8 __ovld __cnfn isequal(double8 x, double8 y);
- long16 __ovld __cnfn isequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isequal(half x, half y);
- short2 __ovld __cnfn isequal(half2 x, half2 y);
-@@ -10636,14 +10649,14 @@ int3 __ovld __cnfn isnotequal(float3 x, float3 y);
- int4 __ovld __cnfn isnotequal(float4 x, float4 y);
- int8 __ovld __cnfn isnotequal(float8 x, float8 y);
- int16 __ovld __cnfn isnotequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnotequal(double x, double y);
- long2 __ovld __cnfn isnotequal(double2 x, double2 y);
- long3 __ovld __cnfn isnotequal(double3 x, double3 y);
- long4 __ovld __cnfn isnotequal(double4 x, double4 y);
- long8 __ovld __cnfn isnotequal(double8 x, double8 y);
- long16 __ovld __cnfn isnotequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnotequal(half x, half y);
- short2 __ovld __cnfn isnotequal(half2 x, half2 y);
-@@ -10662,14 +10675,14 @@ int3 __ovld __cnfn isgreater(float3 x, float3 y);
- int4 __ovld __cnfn isgreater(float4 x, float4 y);
- int8 __ovld __cnfn isgreater(float8 x, float8 y);
- int16 __ovld __cnfn isgreater(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isgreater(double x, double y);
- long2 __ovld __cnfn isgreater(double2 x, double2 y);
- long3 __ovld __cnfn isgreater(double3 x, double3 y);
- long4 __ovld __cnfn isgreater(double4 x, double4 y);
- long8 __ovld __cnfn isgreater(double8 x, double8 y);
- long16 __ovld __cnfn isgreater(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isgreater(half x, half y);
- short2 __ovld __cnfn isgreater(half2 x, half2 y);
-@@ -10688,14 +10701,14 @@ int3 __ovld __cnfn isgreaterequal(float3 x, float3 y);
- int4 __ovld __cnfn isgreaterequal(float4 x, float4 y);
- int8 __ovld __cnfn isgreaterequal(float8 x, float8 y);
- int16 __ovld __cnfn isgreaterequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isgreaterequal(double x, double y);
- long2 __ovld __cnfn isgreaterequal(double2 x, double2 y);
- long3 __ovld __cnfn isgreaterequal(double3 x, double3 y);
- long4 __ovld __cnfn isgreaterequal(double4 x, double4 y);
- long8 __ovld __cnfn isgreaterequal(double8 x, double8 y);
- long16 __ovld __cnfn isgreaterequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isgreaterequal(half x, half y);
- short2 __ovld __cnfn isgreaterequal(half2 x, half2 y);
-@@ -10714,14 +10727,14 @@ int3 __ovld __cnfn isless(float3 x, float3 y);
- int4 __ovld __cnfn isless(float4 x, float4 y);
- int8 __ovld __cnfn isless(float8 x, float8 y);
- int16 __ovld __cnfn isless(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isless(double x, double y);
- long2 __ovld __cnfn isless(double2 x, double2 y);
- long3 __ovld __cnfn isless(double3 x, double3 y);
- long4 __ovld __cnfn isless(double4 x, double4 y);
- long8 __ovld __cnfn isless(double8 x, double8 y);
- long16 __ovld __cnfn isless(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isless(half x, half y);
- short2 __ovld __cnfn isless(half2 x, half2 y);
-@@ -10740,14 +10753,14 @@ int3 __ovld __cnfn islessequal(float3 x, float3 y);
- int4 __ovld __cnfn islessequal(float4 x, float4 y);
- int8 __ovld __cnfn islessequal(float8 x, float8 y);
- int16 __ovld __cnfn islessequal(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn islessequal(double x, double y);
- long2 __ovld __cnfn islessequal(double2 x, double2 y);
- long3 __ovld __cnfn islessequal(double3 x, double3 y);
- long4 __ovld __cnfn islessequal(double4 x, double4 y);
- long8 __ovld __cnfn islessequal(double8 x, double8 y);
- long16 __ovld __cnfn islessequal(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn islessequal(half x, half y);
- short2 __ovld __cnfn islessequal(half2 x, half2 y);
-@@ -10767,14 +10780,14 @@ int3 __ovld __cnfn islessgreater(float3 x, float3 y);
- int4 __ovld __cnfn islessgreater(float4 x, float4 y);
- int8 __ovld __cnfn islessgreater(float8 x, float8 y);
- int16 __ovld __cnfn islessgreater(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn islessgreater(double x, double y);
- long2 __ovld __cnfn islessgreater(double2 x, double2 y);
- long3 __ovld __cnfn islessgreater(double3 x, double3 y);
- long4 __ovld __cnfn islessgreater(double4 x, double4 y);
- long8 __ovld __cnfn islessgreater(double8 x, double8 y);
- long16 __ovld __cnfn islessgreater(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn islessgreater(half x, half y);
- short2 __ovld __cnfn islessgreater(half2 x, half2 y);
-@@ -10793,14 +10806,14 @@ int3 __ovld __cnfn isfinite(float3);
- int4 __ovld __cnfn isfinite(float4);
- int8 __ovld __cnfn isfinite(float8);
- int16 __ovld __cnfn isfinite(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isfinite(double);
- long2 __ovld __cnfn isfinite(double2);
- long3 __ovld __cnfn isfinite(double3);
- long4 __ovld __cnfn isfinite(double4);
- long8 __ovld __cnfn isfinite(double8);
- long16 __ovld __cnfn isfinite(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isfinite(half);
- short2 __ovld __cnfn isfinite(half2);
-@@ -10819,14 +10832,14 @@ int3 __ovld __cnfn isinf(float3);
- int4 __ovld __cnfn isinf(float4);
- int8 __ovld __cnfn isinf(float8);
- int16 __ovld __cnfn isinf(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isinf(double);
- long2 __ovld __cnfn isinf(double2);
- long3 __ovld __cnfn isinf(double3);
- long4 __ovld __cnfn isinf(double4);
- long8 __ovld __cnfn isinf(double8);
- long16 __ovld __cnfn isinf(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isinf(half);
- short2 __ovld __cnfn isinf(half2);
-@@ -10845,14 +10858,14 @@ int3 __ovld __cnfn isnan(float3);
- int4 __ovld __cnfn isnan(float4);
- int8 __ovld __cnfn isnan(float8);
- int16 __ovld __cnfn isnan(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnan(double);
- long2 __ovld __cnfn isnan(double2);
- long3 __ovld __cnfn isnan(double3);
- long4 __ovld __cnfn isnan(double4);
- long8 __ovld __cnfn isnan(double8);
- long16 __ovld __cnfn isnan(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnan(half);
- short2 __ovld __cnfn isnan(half2);
-@@ -10871,14 +10884,14 @@ int3 __ovld __cnfn isnormal(float3);
- int4 __ovld __cnfn isnormal(float4);
- int8 __ovld __cnfn isnormal(float8);
- int16 __ovld __cnfn isnormal(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isnormal(double);
- long2 __ovld __cnfn isnormal(double2);
- long3 __ovld __cnfn isnormal(double3);
- long4 __ovld __cnfn isnormal(double4);
- long8 __ovld __cnfn isnormal(double8);
- long16 __ovld __cnfn isnormal(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isnormal(half);
- short2 __ovld __cnfn isnormal(half2);
-@@ -10899,14 +10912,14 @@ int3 __ovld __cnfn isordered(float3 x, float3 y);
- int4 __ovld __cnfn isordered(float4 x, float4 y);
- int8 __ovld __cnfn isordered(float8 x, float8 y);
- int16 __ovld __cnfn isordered(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isordered(double x, double y);
- long2 __ovld __cnfn isordered(double2 x, double2 y);
- long3 __ovld __cnfn isordered(double3 x, double3 y);
- long4 __ovld __cnfn isordered(double4 x, double4 y);
- long8 __ovld __cnfn isordered(double8 x, double8 y);
- long16 __ovld __cnfn isordered(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isordered(half x, half y);
- short2 __ovld __cnfn isordered(half2 x, half2 y);
-@@ -10927,14 +10940,14 @@ int3 __ovld __cnfn isunordered(float3 x, float3 y);
- int4 __ovld __cnfn isunordered(float4 x, float4 y);
- int8 __ovld __cnfn isunordered(float8 x, float8 y);
- int16 __ovld __cnfn isunordered(float16 x, float16 y);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn isunordered(double x, double y);
- long2 __ovld __cnfn isunordered(double2 x, double2 y);
- long3 __ovld __cnfn isunordered(double3 x, double3 y);
- long4 __ovld __cnfn isunordered(double4 x, double4 y);
- long8 __ovld __cnfn isunordered(double8 x, double8 y);
- long16 __ovld __cnfn isunordered(double16 x, double16 y);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn isunordered(half x, half y);
- short2 __ovld __cnfn isunordered(half2 x, half2 y);
-@@ -10957,14 +10970,14 @@ int3 __ovld __cnfn signbit(float3);
- int4 __ovld __cnfn signbit(float4);
- int8 __ovld __cnfn signbit(float8);
- int16 __ovld __cnfn signbit(float16);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- int __ovld __cnfn signbit(double);
- long2 __ovld __cnfn signbit(double2);
- long3 __ovld __cnfn signbit(double3);
- long4 __ovld __cnfn signbit(double4);
- long8 __ovld __cnfn signbit(double8);
- long16 __ovld __cnfn signbit(double16);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- int __ovld __cnfn signbit(half);
- short2 __ovld __cnfn signbit(half2);
-@@ -11091,14 +11104,14 @@ float3 __ovld __cnfn bitselect(float3 a, float3 b, float3 c);
- float4 __ovld __cnfn bitselect(float4 a, float4 b, float4 c);
- float8 __ovld __cnfn bitselect(float8 a, float8 b, float8 c);
- float16 __ovld __cnfn bitselect(float16 a, float16 b, float16 c);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn bitselect(double a, double b, double c);
- double2 __ovld __cnfn bitselect(double2 a, double2 b, double2 c);
- double3 __ovld __cnfn bitselect(double3 a, double3 b, double3 c);
- double4 __ovld __cnfn bitselect(double4 a, double4 b, double4 c);
- double8 __ovld __cnfn bitselect(double8 a, double8 b, double8 c);
- double16 __ovld __cnfn bitselect(double16 a, double16 b, double16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn bitselect(half a, half b, half c);
- half2 __ovld __cnfn bitselect(half2 a, half2 b, half2 c);
-@@ -11231,7 +11244,7 @@ ulong8 __ovld __cnfn select(ulong8 a, ulong8 b, ulong8 c);
- long16 __ovld __cnfn select(long16 a, long16 b, ulong16 c);
- ulong16 __ovld __cnfn select(ulong16 a, ulong16 b, ulong16 c);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __cnfn select(double a, double b, long c);
- double2 __ovld __cnfn select(double2 a, double2 b, long2 c);
- double3 __ovld __cnfn select(double3 a, double3 b, long3 c);
-@@ -11244,7 +11257,7 @@ double3 __ovld __cnfn select(double3 a, double3 b, ulong3 c);
- double4 __ovld __cnfn select(double4 a, double4 b, ulong4 c);
- double8 __ovld __cnfn select(double8 a, double8 b, ulong8 c);
- double16 __ovld __cnfn select(double16 a, double16 b, ulong16 c);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- half __ovld __cnfn select(half a, half b, short c);
- half2 __ovld __cnfn select(half2 a, half2 b, short2 c);
-@@ -11323,13 +11336,13 @@ uint16 __ovld vload16(size_t offset, const __constant uint *p);
- long16 __ovld vload16(size_t offset, const __constant long *p);
- ulong16 __ovld vload16(size_t offset, const __constant ulong *p);
- float16 __ovld vload16(size_t offset, const __constant float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const __constant double *p);
- double3 __ovld vload3(size_t offset, const __constant double *p);
- double4 __ovld vload4(size_t offset, const __constant double *p);
- double8 __ovld vload8(size_t offset, const __constant double *p);
- double16 __ovld vload16(size_t offset, const __constant double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const __constant half *p);
-@@ -11340,7 +11353,7 @@ half8 __ovld vload8(size_t offset, const __constant half *p);
- half16 __ovld vload16(size_t offset, const __constant half *p);
- #endif //cl_khr_fp16
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- char2 __ovld vload2(size_t offset, const char *p);
- uchar2 __ovld vload2(size_t offset, const uchar *p);
- short2 __ovld vload2(size_t offset, const short *p);
-@@ -11387,13 +11400,13 @@ long16 __ovld vload16(size_t offset, const long *p);
- ulong16 __ovld vload16(size_t offset, const ulong *p);
- float16 __ovld vload16(size_t offset, const float *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const double *p);
- double3 __ovld vload3(size_t offset, const double *p);
- double4 __ovld vload4(size_t offset, const double *p);
- double8 __ovld vload8(size_t offset, const double *p);
- double16 __ovld vload16(size_t offset, const double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const half *p);
-@@ -11403,7 +11416,7 @@ half4 __ovld vload4(size_t offset, const half *p);
- half8 __ovld vload8(size_t offset, const half *p);
- half16 __ovld vload16(size_t offset, const half *p);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
- char2 __ovld vload2(size_t offset, const __global char *p);
- uchar2 __ovld vload2(size_t offset, const __global uchar *p);
- short2 __ovld vload2(size_t offset, const __global short *p);
-@@ -11540,7 +11553,7 @@ long16 __ovld vload16(size_t offset, const __private long *p);
- ulong16 __ovld vload16(size_t offset, const __private ulong *p);
- float16 __ovld vload16(size_t offset, const __private float *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld vload2(size_t offset, const __global double *p);
- double3 __ovld vload3(size_t offset, const __global double *p);
- double4 __ovld vload4(size_t offset, const __global double *p);
-@@ -11556,7 +11569,7 @@ double3 __ovld vload3(size_t offset, const __private double *p);
- double4 __ovld vload4(size_t offset, const __private double *p);
- double8 __ovld vload8(size_t offset, const __private double *p);
- double16 __ovld vload16(size_t offset, const __private double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld vload(size_t offset, const __global half *p);
-@@ -11578,9 +11591,8 @@ half4 __ovld vload4(size_t offset, const __private half *p);
- half8 __ovld vload8(size_t offset, const __private half *p);
- half16 __ovld vload16(size_t offset, const __private half *p);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore2(char2 data, size_t offset, char *p);
- void __ovld vstore2(uchar2 data, size_t offset, uchar *p);
- void __ovld vstore2(short2 data, size_t offset, short *p);
-@@ -11626,13 +11638,13 @@ void __ovld vstore16(uint16 data, size_t offset, uint *p);
- void __ovld vstore16(long16 data, size_t offset, long *p);
- void __ovld vstore16(ulong16 data, size_t offset, ulong *p);
- void __ovld vstore16(float16 data, size_t offset, float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore2(double2 data, size_t offset, double *p);
- void __ovld vstore3(double3 data, size_t offset, double *p);
- void __ovld vstore4(double4 data, size_t offset, double *p);
- void __ovld vstore8(double8 data, size_t offset, double *p);
- void __ovld vstore16(double16 data, size_t offset, double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld vstore(half data, size_t offset, half *p);
- void __ovld vstore2(half2 data, size_t offset, half *p);
-@@ -11641,7 +11653,7 @@ void __ovld vstore4(half4 data, size_t offset, half *p);
- void __ovld vstore8(half8 data, size_t offset, half *p);
- void __ovld vstore16(half16 data, size_t offset, half *p);
- #endif //cl_khr_fp16
--#else
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore2(char2 data, size_t offset, __global char *p);
- void __ovld vstore2(uchar2 data, size_t offset, __global uchar *p);
- void __ovld vstore2(short2 data, size_t offset, __global short *p);
-@@ -11777,7 +11789,7 @@ void __ovld vstore16(uint16 data, size_t offset, __private uint *p);
- void __ovld vstore16(long16 data, size_t offset, __private long *p);
- void __ovld vstore16(ulong16 data, size_t offset, __private ulong *p);
- void __ovld vstore16(float16 data, size_t offset, __private float *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore2(double2 data, size_t offset, __global double *p);
- void __ovld vstore3(double3 data, size_t offset, __global double *p);
- void __ovld vstore4(double4 data, size_t offset, __global double *p);
-@@ -11793,7 +11805,7 @@ void __ovld vstore3(double3 data, size_t offset, __private double *p);
- void __ovld vstore4(double4 data, size_t offset, __private double *p);
- void __ovld vstore8(double8 data, size_t offset, __private double *p);
- void __ovld vstore16(double16 data, size_t offset, __private double *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld vstore(half data, size_t offset, __global half *p);
- void __ovld vstore2(half2 data, size_t offset, __global half *p);
-@@ -11814,7 +11826,6 @@ void __ovld vstore4(half4 data, size_t offset, __private half *p);
- void __ovld vstore8(half8 data, size_t offset, __private half *p);
- void __ovld vstore16(half16 data, size_t offset, __private half *p);
- #endif //cl_khr_fp16
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * Read sizeof (half) bytes of data from address
-@@ -11825,13 +11836,12 @@ void __ovld vstore16(half16 data, size_t offset, __private half *p);
- * must be 16-bit aligned.
- */
- float __ovld vload_half(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld vload_half(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float __ovld vload_half(size_t offset, const __global half *p);
- float __ovld vload_half(size_t offset, const __local half *p);
- float __ovld vload_half(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * Read sizeof (halfn) bytes of data from address
-@@ -11846,13 +11856,13 @@ float3 __ovld vload_half3(size_t offset, const __constant half *p);
- float4 __ovld vload_half4(size_t offset, const __constant half *p);
- float8 __ovld vload_half8(size_t offset, const __constant half *p);
- float16 __ovld vload_half16(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float2 __ovld vload_half2(size_t offset, const half *p);
- float3 __ovld vload_half3(size_t offset, const half *p);
- float4 __ovld vload_half4(size_t offset, const half *p);
- float8 __ovld vload_half8(size_t offset, const half *p);
- float16 __ovld vload_half16(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float2 __ovld vload_half2(size_t offset, const __global half *p);
- float3 __ovld vload_half3(size_t offset, const __global half *p);
- float4 __ovld vload_half4(size_t offset, const __global half *p);
-@@ -11868,7 +11878,6 @@ float3 __ovld vload_half3(size_t offset, const __private half *p);
- float4 __ovld vload_half4(size_t offset, const __private half *p);
- float8 __ovld vload_half8(size_t offset, const __private half *p);
- float16 __ovld vload_half16(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * The float value given by data is first
-@@ -11881,20 +11890,20 @@ float16 __ovld vload_half16(size_t offset, const __private half *p);
- * The default current rounding mode is round to
- * nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore_half(float data, size_t offset, half *p);
- void __ovld vstore_half_rte(float data, size_t offset, half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, half *p);
- void __ovld vstore_half_rtp(float data, size_t offset, half *p);
- void __ovld vstore_half_rtn(float data, size_t offset, half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half(double data, size_t offset, half *p);
- void __ovld vstore_half_rte(double data, size_t offset, half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, half *p);
- void __ovld vstore_half_rtp(double data, size_t offset, half *p);
- void __ovld vstore_half_rtn(double data, size_t offset, half *p);
--#endif //cl_khr_fp64
--#else
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore_half(float data, size_t offset, __global half *p);
- void __ovld vstore_half_rte(float data, size_t offset, __global half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, __global half *p);
-@@ -11910,7 +11919,7 @@ void __ovld vstore_half_rte(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtz(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtp(float data, size_t offset, __private half *p);
- void __ovld vstore_half_rtn(float data, size_t offset, __private half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half(double data, size_t offset, __global half *p);
- void __ovld vstore_half_rte(double data, size_t offset, __global half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, __global half *p);
-@@ -11926,8 +11935,7 @@ void __ovld vstore_half_rte(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtz(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtp(double data, size_t offset, __private half *p);
- void __ovld vstore_half_rtn(double data, size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- /**
- * The floatn value given by data is converted to
-@@ -11940,7 +11948,7 @@ void __ovld vstore_half_rtn(double data, size_t offset, __private half *p);
- * The default current rounding mode is round to
- * nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstore_half2(float2 data, size_t offset, half *p);
- void __ovld vstore_half3(float3 data, size_t offset, half *p);
- void __ovld vstore_half4(float4 data, size_t offset, half *p);
-@@ -11966,7 +11974,7 @@ void __ovld vstore_half3_rtn(float3 data, size_t offset, half *p);
- void __ovld vstore_half4_rtn(float4 data, size_t offset, half *p);
- void __ovld vstore_half8_rtn(float8 data, size_t offset, half *p);
- void __ovld vstore_half16_rtn(float16 data, size_t offset, half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half2(double2 data, size_t offset, half *p);
- void __ovld vstore_half3(double3 data, size_t offset, half *p);
- void __ovld vstore_half4(double4 data, size_t offset, half *p);
-@@ -11992,8 +12000,8 @@ void __ovld vstore_half3_rtn(double3 data, size_t offset, half *p);
- void __ovld vstore_half4_rtn(double4 data, size_t offset, half *p);
- void __ovld vstore_half8_rtn(double8 data, size_t offset, half *p);
- void __ovld vstore_half16_rtn(double16 data, size_t offset, half *p);
--#endif //cl_khr_fp64
--#else
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
- void __ovld vstore_half2(float2 data, size_t offset, __global half *p);
- void __ovld vstore_half3(float3 data, size_t offset, __global half *p);
- void __ovld vstore_half4(float4 data, size_t offset, __global half *p);
-@@ -12069,7 +12077,7 @@ void __ovld vstore_half3_rtn(float3 data, size_t offset, __private half *p);
- void __ovld vstore_half4_rtn(float4 data, size_t offset, __private half *p);
- void __ovld vstore_half8_rtn(float8 data, size_t offset, __private half *p);
- void __ovld vstore_half16_rtn(float16 data, size_t offset, __private half *p);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstore_half2(double2 data, size_t offset, __global half *p);
- void __ovld vstore_half3(double3 data, size_t offset, __global half *p);
- void __ovld vstore_half4(double4 data, size_t offset, __global half *p);
-@@ -12145,8 +12153,7 @@ void __ovld vstore_half3_rtn(double3 data, size_t offset, __private half *p);
- void __ovld vstore_half4_rtn(double4 data, size_t offset, __private half *p);
- void __ovld vstore_half8_rtn(double8 data, size_t offset, __private half *p);
- void __ovld vstore_half16_rtn(double16 data, size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- /**
- * For n = 1, 2, 4, 8 and 16 read sizeof (halfn)
-@@ -12167,14 +12174,14 @@ float3 __ovld vloada_half3(size_t offset, const __constant half *p);
- float4 __ovld vloada_half4(size_t offset, const __constant half *p);
- float8 __ovld vloada_half8(size_t offset, const __constant half *p);
- float16 __ovld vloada_half16(size_t offset, const __constant half *p);
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- float __ovld vloada_half(size_t offset, const half *p);
- float2 __ovld vloada_half2(size_t offset, const half *p);
- float3 __ovld vloada_half3(size_t offset, const half *p);
- float4 __ovld vloada_half4(size_t offset, const half *p);
- float8 __ovld vloada_half8(size_t offset, const half *p);
- float16 __ovld vloada_half16(size_t offset, const half *p);
--#else
-+#endif //__opencl_c_generic_address_space
- float __ovld vloada_half(size_t offset, const __global half *p);
- float2 __ovld vloada_half2(size_t offset, const __global half *p);
- float3 __ovld vloada_half3(size_t offset, const __global half *p);
-@@ -12193,7 +12200,6 @@ float3 __ovld vloada_half3(size_t offset, const __private half *p);
- float4 __ovld vloada_half4(size_t offset, const __private half *p);
- float8 __ovld vloada_half8(size_t offset, const __private half *p);
- float16 __ovld vloada_half16(size_t offset, const __private half *p);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
- * The floatn value given by data is converted to
-@@ -12211,7 +12217,7 @@ float16 __ovld vloada_half16(size_t offset, const __private half *p);
- * mode. The default current rounding mode is
- * round to nearest even.
- */
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- void __ovld vstorea_half(float data, size_t offset, half *p);
- void __ovld vstorea_half2(float2 data, size_t offset, half *p);
- void __ovld vstorea_half3(float3 data, size_t offset, half *p);
-@@ -12247,7 +12253,7 @@ void __ovld vstorea_half4_rtn(float4 data, size_t offset, half *p);
- void __ovld vstorea_half8_rtn(float8 data, size_t offset, half *p);
- void __ovld vstorea_half16_rtn(float16 data, size_t offset, half *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstorea_half(double data, size_t offset, half *p);
- void __ovld vstorea_half2(double2 data, size_t offset, half *p);
- void __ovld vstorea_half3(double3 data, size_t offset, half *p);
-@@ -12282,9 +12288,9 @@ void __ovld vstorea_half3_rtn(double3 data, size_t offset, half *p);
- void __ovld vstorea_half4_rtn(double4 data, size_t offset, half *p);
- void __ovld vstorea_half8_rtn(double8 data, size_t offset, half *p);
- void __ovld vstorea_half16_rtn(double16 data, size_t offset, half *p);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_generic_address_space
-
--#else
- void __ovld vstorea_half(float data, size_t offset, __global half *p);
- void __ovld vstorea_half2(float2 data, size_t offset, __global half *p);
- void __ovld vstorea_half3(float3 data, size_t offset, __global half *p);
-@@ -12390,7 +12396,7 @@ void __ovld vstorea_half4_rtn(float4 data, size_t offset, __private half *p);
- void __ovld vstorea_half8_rtn(float8 data, size_t offset, __private half *p);
- void __ovld vstorea_half16_rtn(float16 data, size_t offset, __private half *p);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld vstorea_half(double data, size_t offset, __global half *p);
- void __ovld vstorea_half2(double2 data, size_t offset, __global half *p);
- void __ovld vstorea_half3(double3 data, size_t offset, __global half *p);
-@@ -12495,8 +12501,7 @@ void __ovld vstorea_half3_rtn(double3 data,size_t offset, __private half *p);
- void __ovld vstorea_half4_rtn(double4 data,size_t offset, __private half *p);
- void __ovld vstorea_half8_rtn(double8 data,size_t offset, __private half *p);
- void __ovld vstorea_half16_rtn(double16 data,size_t offset, __private half *p);
--#endif //cl_khr_fp64
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- // OpenCL v1.1 s6.11.8, v1.2 s6.12.8, v2.0 s6.13.8 - Synchronization Functions
-
-@@ -12580,7 +12585,7 @@ void __ovld write_mem_fence(cl_mem_fence_flags flags);
-
- // OpenCL v2.0 s6.13.9 - Address Space Qualifier Functions
-
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_generic_address_space
- cl_mem_fence_flags __ovld get_fence(const void *ptr);
- cl_mem_fence_flags __ovld get_fence(void *ptr);
-
-@@ -12591,7 +12596,7 @@ cl_mem_fence_flags __ovld get_fence(void *ptr);
- * where gentype is builtin type or user defined type.
- */
-
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#endif //__opencl_c_generic_address_space
-
- // OpenCL v1.1 s6.11.10, v1.2 s6.12.10, v2.0 s6.13.10 - Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch
-
-@@ -12730,7 +12735,7 @@ event_t __ovld async_work_group_copy(__global uint16 *dst, const __local uint16
- event_t __ovld async_work_group_copy(__global long16 *dst, const __local long16 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global ulong16 *dst, const __local ulong16 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global float16 *dst, const __local float16 *src, size_t num_elements, event_t event);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- event_t __ovld async_work_group_copy(__local double *dst, const __global double *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local double2 *dst, const __global double2 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local double3 *dst, const __global double3 *src, size_t num_elements, event_t event);
-@@ -12743,7 +12748,7 @@ event_t __ovld async_work_group_copy(__global double3 *dst, const __local double
- event_t __ovld async_work_group_copy(__global double4 *dst, const __local double4 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global double8 *dst, const __local double8 *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__global double16 *dst, const __local double16 *src, size_t num_elements, event_t event);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- event_t __ovld async_work_group_copy(__local half *dst, const __global half *src, size_t num_elements, event_t event);
- event_t __ovld async_work_group_copy(__local half2 *dst, const __global half2 *src, size_t num_elements, event_t event);
-@@ -12893,7 +12898,7 @@ event_t __ovld async_work_group_strided_copy(__global uint16 *dst, const __local
- event_t __ovld async_work_group_strided_copy(__global long16 *dst, const __local long16 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global ulong16 *dst, const __local ulong16 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global float16 *dst, const __local float16 *src, size_t num_elements, size_t dst_stride, event_t event);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- event_t __ovld async_work_group_strided_copy(__local double *dst, const __global double *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local double2 *dst, const __global double2 *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local double3 *dst, const __global double3 *src, size_t num_elements, size_t src_stride, event_t event);
-@@ -12906,7 +12911,7 @@ event_t __ovld async_work_group_strided_copy(__global double3 *dst, const __loca
- event_t __ovld async_work_group_strided_copy(__global double4 *dst, const __local double4 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global double8 *dst, const __local double8 *src, size_t num_elements, size_t dst_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__global double16 *dst, const __local double16 *src, size_t num_elements, size_t dst_stride, event_t event);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- event_t __ovld async_work_group_strided_copy(__local half *dst, const __global half *src, size_t num_elements, size_t src_stride, event_t event);
- event_t __ovld async_work_group_strided_copy(__local half2 *dst, const __global half2 *src, size_t num_elements, size_t src_stride, event_t event);
-@@ -12996,14 +13001,14 @@ void __ovld prefetch(const __global uint16 *p, size_t num_elements);
- void __ovld prefetch(const __global long16 *p, size_t num_elements);
- void __ovld prefetch(const __global ulong16 *p, size_t num_elements);
- void __ovld prefetch(const __global float16 *p, size_t num_elements);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld prefetch(const __global double *p, size_t num_elements);
- void __ovld prefetch(const __global double2 *p, size_t num_elements);
- void __ovld prefetch(const __global double3 *p, size_t num_elements);
- void __ovld prefetch(const __global double4 *p, size_t num_elements);
- void __ovld prefetch(const __global double8 *p, size_t num_elements);
- void __ovld prefetch(const __global double16 *p, size_t num_elements);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #ifdef cl_khr_fp16
- void __ovld prefetch(const __global half *p, size_t num_elements);
- void __ovld prefetch(const __global half2 *p, size_t num_elements);
-@@ -13026,9 +13031,11 @@ void __ovld prefetch(const __global half16 *p, size_t num_elements);
- * pointed by p. The function returns old.
- */
- int __ovld atomic_add(volatile __global int *p, int val);
--unsigned int __ovld atomic_add(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_add(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_add(volatile __local int *p, int val);
--unsigned int __ovld atomic_add(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_add(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_add(volatile int *p, int val);
- unsigned int __ovld atomic_add(volatile unsigned int *p, unsigned int val);
-@@ -13056,9 +13063,11 @@ unsigned long __ovld atom_add(volatile __local unsigned long *p, unsigned long v
- * returns old.
- */
- int __ovld atomic_sub(volatile __global int *p, int val);
--unsigned int __ovld atomic_sub(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_sub(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_sub(volatile __local int *p, int val);
--unsigned int __ovld atomic_sub(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_sub(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_sub(volatile int *p, int val);
- unsigned int __ovld atomic_sub(volatile unsigned int *p, unsigned int val);
-@@ -13086,9 +13095,11 @@ unsigned long __ovld atom_sub(volatile __local unsigned long *p, unsigned long v
- * value.
- */
- int __ovld atomic_xchg(volatile __global int *p, int val);
--unsigned int __ovld atomic_xchg(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xchg(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_xchg(volatile __local int *p, int val);
--unsigned int __ovld atomic_xchg(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xchg(volatile __local unsigned int *p,
-+ unsigned int val);
- float __ovld atomic_xchg(volatile __global float *p, float val);
- float __ovld atomic_xchg(volatile __local float *p, float val);
- #ifdef __OPENCL_CPP_VERSION__
-@@ -13183,12 +13194,15 @@ unsigned long __ovld atom_dec(volatile __local unsigned long *p);
- * returns old.
- */
- int __ovld atomic_cmpxchg(volatile __global int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile __global unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile __global unsigned int *p,
-+ unsigned int cmp, unsigned int val);
- int __ovld atomic_cmpxchg(volatile __local int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile __local unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile __local unsigned int *p,
-+ unsigned int cmp, unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_cmpxchg(volatile int *p, int cmp, int val);
--unsigned int __ovld atomic_cmpxchg(volatile unsigned int *p, unsigned int cmp, unsigned int val);
-+unsigned int __ovld atomic_cmpxchg(volatile unsigned int *p, unsigned int cmp,
-+ unsigned int val);
- #endif
-
- #if defined(cl_khr_global_int32_base_atomics)
-@@ -13215,9 +13229,11 @@ unsigned long __ovld atom_cmpxchg(volatile __local unsigned long *p, unsigned lo
- * returns old.
- */
- int __ovld atomic_min(volatile __global int *p, int val);
--unsigned int __ovld atomic_min(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_min(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_min(volatile __local int *p, int val);
--unsigned int __ovld atomic_min(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_min(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_min(volatile int *p, int val);
- unsigned int __ovld atomic_min(volatile unsigned int *p, unsigned int val);
-@@ -13247,9 +13263,11 @@ unsigned long __ovld atom_min(volatile __local unsigned long *p, unsigned long v
- * returns old.
- */
- int __ovld atomic_max(volatile __global int *p, int val);
--unsigned int __ovld atomic_max(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_max(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_max(volatile __local int *p, int val);
--unsigned int __ovld atomic_max(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_max(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_max(volatile int *p, int val);
- unsigned int __ovld atomic_max(volatile unsigned int *p, unsigned int val);
-@@ -13278,9 +13296,11 @@ unsigned long __ovld atom_max(volatile __local unsigned long *p, unsigned long v
- * pointed by p. The function returns old.
- */
- int __ovld atomic_and(volatile __global int *p, int val);
--unsigned int __ovld atomic_and(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_and(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_and(volatile __local int *p, int val);
--unsigned int __ovld atomic_and(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_and(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_and(volatile int *p, int val);
- unsigned int __ovld atomic_and(volatile unsigned int *p, unsigned int val);
-@@ -13309,9 +13329,11 @@ unsigned long __ovld atom_and(volatile __local unsigned long *p, unsigned long v
- * pointed by p. The function returns old.
- */
- int __ovld atomic_or(volatile __global int *p, int val);
--unsigned int __ovld atomic_or(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_or(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_or(volatile __local int *p, int val);
--unsigned int __ovld atomic_or(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_or(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_or(volatile int *p, int val);
- unsigned int __ovld atomic_or(volatile unsigned int *p, unsigned int val);
-@@ -13340,9 +13362,11 @@ unsigned long __ovld atom_or(volatile __local unsigned long *p, unsigned long va
- * pointed by p. The function returns old.
- */
- int __ovld atomic_xor(volatile __global int *p, int val);
--unsigned int __ovld atomic_xor(volatile __global unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xor(volatile __global unsigned int *p,
-+ unsigned int val);
- int __ovld atomic_xor(volatile __local int *p, int val);
--unsigned int __ovld atomic_xor(volatile __local unsigned int *p, unsigned int val);
-+unsigned int __ovld atomic_xor(volatile __local unsigned int *p,
-+ unsigned int val);
- #ifdef __OPENCL_CPP_VERSION__
- int __ovld atomic_xor(volatile int *p, int val);
- unsigned int __ovld atomic_xor(volatile unsigned int *p, unsigned int val);
-@@ -13380,108 +13404,78 @@ unsigned long __ovld atom_xor(volatile __local unsigned long *p, unsigned long v
- #endif
-
- // atomic_init()
-+#ifdef __opencl_c_generic_address_space
- void __ovld atomic_init(volatile atomic_int *object, int value);
- void __ovld atomic_init(volatile atomic_uint *object, uint value);
- void __ovld atomic_init(volatile atomic_float *object, float value);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
- void __ovld atomic_init(volatile atomic_long *object, long value);
- void __ovld atomic_init(volatile atomic_ulong *object, ulong value);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld atomic_init(volatile atomic_double *object, double value);
--#endif //cl_khr_fp64
--#endif
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+void __ovld atomic_init(volatile atomic_int __global *object, int value);
-+void __ovld atomic_init(volatile atomic_int __local *object, int value);
-+void __ovld atomic_init(volatile atomic_uint __global *object, uint value);
-+void __ovld atomic_init(volatile atomic_uint __local *object, uint value);
-+void __ovld atomic_init(volatile atomic_float __global *object, float value);
-+void __ovld atomic_init(volatile atomic_float __local *object, float value);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+void __ovld atomic_init(volatile atomic_long __global *object, long value);
-+void __ovld atomic_init(volatile atomic_long __local *object, long value);
-+void __ovld atomic_init(volatile atomic_ulong __global *object, ulong value);
-+void __ovld atomic_init(volatile atomic_ulong __local *object, ulong value);
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+void __ovld atomic_init(volatile atomic_double __global *object, double value);
-+void __ovld atomic_init(volatile atomic_double __local *object, double value);
-+#endif // cl_khr_fp64
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_work_item_fence()
--void __ovld atomic_work_item_fence(cl_mem_fence_flags flags, memory_order order, memory_scope scope);
-+void __ovld atomic_work_item_fence(cl_mem_fence_flags flags, memory_order order,
-+ memory_scope scope);
-
- // atomic_fetch()
--
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+#ifdef __opencl_c_generic_address_space
- int __ovld atomic_fetch_add(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_add(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_sub(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_sub(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_or(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_or(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_xor(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_xor(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_and(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_and(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_min(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_min(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
- int __ovld atomic_fetch_max(volatile atomic_int *object, int operand);
--int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order);
--int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope);
- uint __ovld atomic_fetch_max(volatile atomic_uint *object, uint operand);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order);
--uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope);
-
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
- long __ovld atomic_fetch_add(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_add(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_sub(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_sub(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_or(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_or(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_xor(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_xor(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_and(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_and(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_min(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_min(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- long __ovld atomic_fetch_max(volatile atomic_long *object, long operand);
--long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order);
--long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope);
- ulong __ovld atomic_fetch_max(volatile atomic_ulong *object, ulong operand);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order);
--ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope);
- #endif //defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-
- // OpenCL v2.0 s6.13.11.7.5:
-@@ -13489,196 +13483,2239 @@ ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong oper
- // or/xor/and/min/max: atomic type argument can be intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object, ptrdiff_t operand);
--uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object, ptrdiff_t operand);
--uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope);
--
--uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object, intptr_t operand);
--uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order);
--uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope);
--uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object, intptr_t opermax);
--uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder);
--uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope);
--uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object, intptr_t opermax);
--uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder);
--uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope);
--
--intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object, uintptr_t operand);
--intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order);
--intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope);
--intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object, uintptr_t opermax);
--intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder);
--intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
--intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object, uintptr_t opermax);
--intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder);
--intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand);
-+
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object,
-+ intptr_t opermax);
-+
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object,
-+ uintptr_t opermax);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if(__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+int __ovld atomic_fetch_add(volatile atomic_int __global *object, int operand);
-+uint __ovld atomic_fetch_add(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_sub(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_sub(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __local *object,
-+ uint operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __global *object,
-+ uint operand);
-+int __ovld atomic_fetch_or(volatile atomic_int __global *object, int operand);
-+uint __ovld atomic_fetch_sub(volatile atomic_uint __local *object,
-+ uint operand);
-+uint __ovld atomic_fetch_or(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_or(volatile atomic_uint __local *object, uint operand);
-+int __ovld atomic_fetch_xor(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_xor(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_xor(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_xor(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_and(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_and(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_and(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_and(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_min(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_min(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_min(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_min(volatile atomic_uint __local *object,
-+ uint operand);
-+int __ovld atomic_fetch_max(volatile atomic_int __global *object, int operand);
-+int __ovld atomic_fetch_max(volatile atomic_int __local *object, int operand);
-+uint __ovld atomic_fetch_max(volatile atomic_uint __global *object,
-+ uint operand);
-+uint __ovld atomic_fetch_max(volatile atomic_uint __local *object,
-+ uint operand);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+long __ovld atomic_fetch_add(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_add(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_add(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_add(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_sub(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_sub(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_sub(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_sub(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_or(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_or(volatile atomic_long __local *object, long operand);
-+ulong __ovld atomic_fetch_or(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_or(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_xor(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_xor(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_xor(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_xor(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_and(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_and(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_and(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_and(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_min(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_min(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_min(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_min(volatile atomic_ulong __local *object,
-+ ulong operand);
-+long __ovld atomic_fetch_max(volatile atomic_long __global *object,
-+ long operand);
-+long __ovld atomic_fetch_max(volatile atomic_long __local *object,
-+ long operand);
-+ulong __ovld atomic_fetch_max(volatile atomic_ulong __global *object,
-+ ulong operand);
-+ulong __ovld atomic_fetch_max(volatile atomic_ulong __local *object,
-+ ulong operand);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand);
-+uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand);
-+
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax);
-+uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax);
-+
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax);
-+intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand,
-+ memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand,
-+ memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand,
-+ memory_order order, memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand,
-+ memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand,
-+ memory_order order);
-+uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder);
-+uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder);
-+intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand,
-+ memory_order order);
-+intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand,
-+ memory_order order);
-+intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder);
-+intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder);
-+#endif // __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object,
-+ ptrdiff_t operand,
-+ memory_order order,
-+ memory_scope scope);
-+
-+uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t operand, memory_order order,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object,
-+ intptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+
-+intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t operand, memory_order order,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object,
-+ uintptr_t opermax,
-+ memory_order minder,
-+ memory_scope scope);
- #endif
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_add_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_add_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_sub_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_or_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_or_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_xor_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_and_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_and_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_min_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_min_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __global *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_fetch_max_explicit(volatile atomic_int __local *object,
-+ int operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __global *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_fetch_max_explicit(volatile atomic_uint __local *object,
-+ uint operand, memory_order order,
-+ memory_scope scope);
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_add_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_sub_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_or_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_xor_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_and_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_min_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __global *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_fetch_max_explicit(volatile atomic_long __local *object,
-+ long operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __global *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong __local *object,
-+ ulong operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+
-+// OpenCL v2.0 s6.13.11.7.5:
-+// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument
-+// can be ptrdiff_t. or/xor/and/min/max: atomic type argument can be
-+// intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t.
-+
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#ifdef __opencl_c_atomic_scope_device
-+uintptr_t __ovld
-+atomic_fetch_add_explicit(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_add_explicit(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_sub_explicit(volatile atomic_uintptr_t __global *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_sub_explicit(volatile atomic_uintptr_t __local *object,
-+ ptrdiff_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t operand, memory_order order);
-+uintptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_uintptr_t __global *object,
-+ intptr_t opermax, memory_order minder);
-+uintptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_uintptr_t __local *object,
-+ intptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_or_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_xor_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_and_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t operand, memory_order order);
-+intptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_min_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_intptr_t __global *object,
-+ uintptr_t opermax, memory_order minder);
-+intptr_t __ovld
-+atomic_fetch_max_explicit(volatile atomic_intptr_t __local *object,
-+ uintptr_t opermax, memory_order minder);
-+#endif // __opencl_c_atomic_scope_device
-+uintptr_t __ovld atomic_fetch_add_explicit(
-+ volatile atomic_uintptr_t __global *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_add_explicit(
-+ volatile atomic_uintptr_t __local *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(
-+ volatile atomic_uintptr_t __global *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_sub_explicit(
-+ volatile atomic_uintptr_t __local *object, ptrdiff_t operand,
-+ memory_order order, memory_scope scope);
-+
-+uintptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t operand,
-+ memory_order order, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_uintptr_t __global *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+uintptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_uintptr_t __local *object, intptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+
-+intptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_or_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_xor_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_and_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t operand,
-+ memory_order order, memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_min_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_intptr_t __global *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+intptr_t __ovld atomic_fetch_max_explicit(
-+ volatile atomic_intptr_t __local *object, uintptr_t opermax,
-+ memory_order minder, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_store()
-
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
- void __ovld atomic_store(volatile atomic_int *object, int desired);
--void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_uint *object, uint desired);
--void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_float *object, float desired);
--void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- void __ovld atomic_store(volatile atomic_double *object, double desired);
--void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif
- void __ovld atomic_store(volatile atomic_long *object, long desired);
--void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope);
- void __ovld atomic_store(volatile atomic_ulong *object, ulong desired);
--void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order);
--void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+void __ovld atomic_store(volatile atomic_int __global *object, int desired);
-+void __ovld atomic_store(volatile atomic_int __local *object, int desired);
-+void __ovld atomic_store(volatile atomic_uint __global *object, uint desired);
-+void __ovld atomic_store(volatile atomic_uint __local *object, uint desired);
-+void __ovld atomic_store(volatile atomic_float __global *object, float desired);
-+void __ovld atomic_store(volatile atomic_float __local *object, float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+void __ovld atomic_store(volatile atomic_double __global *object,
-+ double desired);
-+void __ovld atomic_store(volatile atomic_double __local *object,
-+ double desired);
- #endif
-+void __ovld atomic_store(volatile atomic_long __global *object, long desired);
-+void __ovld atomic_store(volatile atomic_long __local *object, long desired);
-+void __ovld atomic_store(volatile atomic_ulong __global *object, ulong desired);
-+void __ovld atomic_store(volatile atomic_ulong __local *object, ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int *object, int desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float *object, float desired,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int *object, int desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float *object, float desired,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double *object,
-+ double desired, memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long *object, long desired,
-+ memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired,
-+ memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long *object, long desired,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // cl_khr_fp64
-+#ifdef __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+void __ovld atomic_store_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_store_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_load()
--
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
- int __ovld atomic_load(volatile atomic_int *object);
--int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order);
--int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order, memory_scope scope);
- uint __ovld atomic_load(volatile atomic_uint *object);
--uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order);
--uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order, memory_scope scope);
- float __ovld atomic_load(volatile atomic_float *object);
--float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order);
--float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld atomic_load(volatile atomic_double *object);
--double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order);
--double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif // cl_khr_fp64
- long __ovld atomic_load(volatile atomic_long *object);
--long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order);
--long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order, memory_scope scope);
- ulong __ovld atomic_load(volatile atomic_ulong *object);
--ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order);
--ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order, memory_scope scope);
--#endif
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif //__opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+int __ovld atomic_load(volatile atomic_int __global *object);
-+int __ovld atomic_load(volatile atomic_int __local *object);
-+uint __ovld atomic_load(volatile atomic_uint __global *object);
-+uint __ovld atomic_load(volatile atomic_uint __local *object);
-+float __ovld atomic_load(volatile atomic_float __global *object);
-+float __ovld atomic_load(volatile atomic_float __local *object);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+double __ovld atomic_load(volatile atomic_double __global *object);
-+double __ovld atomic_load(volatile atomic_double __local *object);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+long __ovld atomic_load(volatile atomic_long __global *object);
-+long __ovld atomic_load(volatile atomic_long __local *object);
-+ulong __ovld atomic_load(volatile atomic_ulong __global *object);
-+ulong __ovld atomic_load(volatile atomic_ulong __local *object);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float *object,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong *object,
-+ memory_order order);
-+#endif //__opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int __global *object,
-+ memory_order order);
-+int __ovld atomic_load_explicit(volatile atomic_int __local *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __global *object,
-+ memory_order order);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __local *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float __global *object,
-+ memory_order order);
-+float __ovld atomic_load_explicit(volatile atomic_float __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_load_explicit(volatile atomic_int __global *object,
-+ memory_order order, memory_scope scope);
-+int __ovld atomic_load_explicit(volatile atomic_int __local *object,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __global *object,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_load_explicit(volatile atomic_uint __local *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float __global *object,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_load_explicit(volatile atomic_float __local *object,
-+ memory_order order, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double __global *object,
-+ memory_order order);
-+double __ovld atomic_load_explicit(volatile atomic_double __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_load_explicit(volatile atomic_double __global *object,
-+ memory_order order, memory_scope scope);
-+double __ovld atomic_load_explicit(volatile atomic_double __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long __global *object,
-+ memory_order order);
-+long __ovld atomic_load_explicit(volatile atomic_long __local *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __global *object,
-+ memory_order order);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_load_explicit(volatile atomic_long __global *object,
-+ memory_order order, memory_scope scope);
-+long __ovld atomic_load_explicit(volatile atomic_long __local *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __global *object,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_load_explicit(volatile atomic_ulong __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_exchange()
--
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
- int __ovld atomic_exchange(volatile atomic_int *object, int desired);
--int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order);
--int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope);
- uint __ovld atomic_exchange(volatile atomic_uint *object, uint desired);
--uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order);
--uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope);
- float __ovld atomic_exchange(volatile atomic_float *object, float desired);
--float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order);
--float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld atomic_exchange(volatile atomic_double *object, double desired);
--double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order);
--double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope);
--#endif //cl_khr_fp64
-+#endif
- long __ovld atomic_exchange(volatile atomic_long *object, long desired);
--long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order);
--long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope);
- ulong __ovld atomic_exchange(volatile atomic_ulong *object, ulong desired);
--ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order);
--ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+int __ovld atomic_exchange(volatile atomic_int __global *object, int desired);
-+int __ovld atomic_exchange(volatile atomic_int __local *object, int desired);
-+uint __ovld atomic_exchange(volatile atomic_uint __global *object,
-+ uint desired);
-+uint __ovld atomic_exchange(volatile atomic_uint __local *object, uint desired);
-+float __ovld atomic_exchange(volatile atomic_float __global *object,
-+ float desired);
-+float __ovld atomic_exchange(volatile atomic_float __local *object,
-+ float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+double __ovld atomic_exchange(volatile atomic_double __global *object,
-+ double desired);
-+double __ovld atomic_exchange(volatile atomic_double __local *object,
-+ double desired);
- #endif
-+long __ovld atomic_exchange(volatile atomic_long __global *object,
-+ long desired);
-+long __ovld atomic_exchange(volatile atomic_long __local *object, long desired);
-+ulong __ovld atomic_exchange(volatile atomic_ulong __global *object,
-+ ulong desired);
-+ulong __ovld atomic_exchange(volatile atomic_ulong __local *object,
-+ ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired,
-+ memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired,
-+ memory_order order, memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired,
-+ memory_order order, memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double *object,
-+ double desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired,
-+ memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired,
-+ memory_order order, memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order);
-+int __ovld atomic_exchange_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+int __ovld atomic_exchange_explicit(volatile atomic_int __global *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+int __ovld atomic_exchange_explicit(volatile atomic_int __local *object,
-+ int desired, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __global *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+uint __ovld atomic_exchange_explicit(volatile atomic_uint __local *object,
-+ uint desired, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __global *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_exchange_explicit(volatile atomic_float __local *object,
-+ float desired, memory_order order,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order);
-+double __ovld atomic_exchange_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+double __ovld atomic_exchange_explicit(volatile atomic_double __global *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_exchange_explicit(volatile atomic_double __local *object,
-+ double desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order);
-+long __ovld atomic_exchange_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+long __ovld atomic_exchange_explicit(volatile atomic_long __global *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+long __ovld atomic_exchange_explicit(volatile atomic_long __local *object,
-+ long desired, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __global *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+ulong __ovld atomic_exchange_explicit(volatile atomic_ulong __local *object,
-+ ulong desired, memory_order order,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_compare_exchange_strong() and atomic_compare_exchange_weak()
--
--bool __ovld atomic_compare_exchange_strong(volatile atomic_int *object, int *expected, int desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object, uint *expected, uint desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object, int *expected, int desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected,
-- int desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object, uint *expected, uint desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected,
-- uint desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object, float *expected, float desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object, float *expected, float desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected,
-- float desired, memory_order success, memory_order failure, memory_scope scope);
-+#ifdef __opencl_c_generic_address_space
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int *object,
-+ int *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object,
-+ uint *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object,
-+ int *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object,
-+ uint *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object,
-+ float *expected, float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object,
-+ float *expected, float desired);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object,
-+ double *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object,
-+ double *expected, double desired);
-+#endif
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object,
-+ long *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object,
-+ long *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object,
-+ ulong *expected, ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object,
-+ ulong *expected, ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __global *object,
-+ int __private *expected,
-+ int desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_int __local *object,
-+ int __private *expected,
-+ int desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __global *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __local *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_uint __global *object,
-+ uint __private *expected, uint desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_uint __local *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __global *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __local *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __global *object,
-+ int __private *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_int __local *object,
-+ int __private *expected, int desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __global *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __local *expected, uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __global *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_uint __local *object,
-+ uint __private *expected,
-+ uint desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __global *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __global *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __local *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __local *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __global *object,
-+ float __private *expected, float desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_float __local *object,
-+ float __private *expected, float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __global *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __global *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __local *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __local *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __global *object,
-+ float __private *expected,
-+ float desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_float __local *object,
-+ float __private *expected,
-+ float desired);
- #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
--#ifdef cl_khr_fp64
--bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object, double *expected, double desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object, double *expected, double desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected,
-- double desired, memory_order success, memory_order failure, memory_scope scope);
--#endif //cl_khr_fp64
--bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object, long *expected, long desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object, long *expected, long desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected,
-- long desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object, ulong *expected, ulong desired);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure, memory_scope scope);
--bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object, ulong *expected, ulong desired);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure);
--bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected,
-- ulong desired, memory_order success, memory_order failure, memory_scope scope);
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __global *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __global *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __local *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __local *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __global *object,
-+ double __private *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_double __local *object,
-+ double __private *expected, double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __global *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __global *expected,
-+ double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __local *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __local *expected,
-+ double desired);
-+bool __ovld
-+atomic_compare_exchange_weak(volatile atomic_double __global *object,
-+ double __private *expected, double desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_double __local *object,
-+ double __private *expected,
-+ double desired);
- #endif
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __global *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __local *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_long __global *object,
-+ long __private *expected, long desired);
-+bool __ovld atomic_compare_exchange_strong(volatile atomic_long __local *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __global *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __local *expected, long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __global *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_long __local *object,
-+ long __private *expected,
-+ long desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __global *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __global *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __local *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __local *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __global *object,
-+ ulong __private *expected, ulong desired);
-+bool __ovld
-+atomic_compare_exchange_strong(volatile atomic_ulong __local *object,
-+ ulong __private *expected, ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __global *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __global *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __local *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __local *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __global *object,
-+ ulong __private *expected,
-+ ulong desired);
-+bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong __local *object,
-+ ulong __private *expected,
-+ ulong desired);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint *object, uint *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object,
-+ uint *expected, uint desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object,
-+ float *expected,
-+ float desired,
-+ memory_order success,
-+ memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint *object, uint *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object,
-+ int *expected, int desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object,
-+ uint *expected, uint desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float *object, float *expected, float desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double *object, double *expected, double desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long *object, long *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object,
-+ long *expected, long desired,
-+ memory_order success,
-+ memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object,
-+ ulong *expected,
-+ ulong desired,
-+ memory_order success,
-+ memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long *object, long *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object,
-+ long *expected, long desired,
-+ memory_order success,
-+ memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong *object, ulong *expected, ulong desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __global *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __local *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __global *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_int __local *object, int __private *expected, int desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __global *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __global *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __local *expected, uint desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __global *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_uint __local *object, uint __private *expected,
-+ uint desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __global *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __local *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __global *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_float __local *object, float __private *expected,
-+ float desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __global *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __local *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __global *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_double __local *object, double __private *expected,
-+ double desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __global *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __global *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __local *expected, long desired,
-+ memory_order success, memory_order failure, memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __global *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_long __local *object, long __private *expected,
-+ long desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_strong_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __global *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __local *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __global *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+bool __ovld atomic_compare_exchange_weak_explicit(
-+ volatile atomic_ulong __local *object, ulong __private *expected,
-+ ulong desired, memory_order success, memory_order failure,
-+ memory_scope scope);
-+#endif // defined(cl_khr_int64_base_atomics) &&
-+ // defined(cl_khr_int64_extended_atomics)
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- // atomic_flag_test_and_set() and atomic_flag_clear()
--
-+#if defined(__opencl_c_atomic_scope_device) && \
-+ defined(__opencl_c_atomic_order_seq_cst)
-+#ifdef __opencl_c_generic_address_space
- bool __ovld atomic_flag_test_and_set(volatile atomic_flag *object);
--bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order);
--bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope);
- void __ovld atomic_flag_clear(volatile atomic_flag *object);
--void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order);
--void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope);
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+bool __ovld atomic_flag_test_and_set(volatile atomic_flag __global *object);
-+bool __ovld atomic_flag_test_and_set(volatile atomic_flag __local *object);
-+void __ovld atomic_flag_clear(volatile atomic_flag __global *object);
-+void __ovld atomic_flag_clear(volatile atomic_flag __local *object);
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#endif // defined(__opencl_c_atomic_scope_device) &&
-+ // defined(__opencl_c_atomic_order_seq_cst)
-+
-+#ifdef __opencl_c_generic_address_space
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
-+ memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
-+ memory_order order,
-+ memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object,
-+ memory_order order, memory_scope scope);
-+#endif // __opencl_c_generic_address_space
-+
-+#if (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-+#ifdef __opencl_c_atomic_scope_device
-+bool __ovld atomic_flag_test_and_set_explicit(
-+ volatile atomic_flag __global *object, memory_order order);
-+bool __ovld atomic_flag_test_and_set_explicit(
-+ volatile atomic_flag __local *object, memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __global *object,
-+ memory_order order);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __local *object,
-+ memory_order order);
-+#endif // __opencl_c_atomic_scope_device
-+bool __ovld
-+atomic_flag_test_and_set_explicit(volatile atomic_flag __global *object,
-+ memory_order order, memory_scope scope);
-+bool __ovld
-+atomic_flag_test_and_set_explicit(volatile atomic_flag __local *object,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __global *object,
-+ memory_order order, memory_scope scope);
-+void __ovld atomic_flag_clear_explicit(volatile atomic_flag __local *object,
-+ memory_order order, memory_scope scope);
-+#endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
-@@ -13906,7 +15943,7 @@ float16 __ovld __cnfn shuffle(float4 x, uint16 mask);
- float16 __ovld __cnfn shuffle(float8 x, uint16 mask);
- float16 __ovld __cnfn shuffle(float16 x, uint16 mask);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld __cnfn shuffle(double2 x, ulong2 mask);
- double2 __ovld __cnfn shuffle(double4 x, ulong2 mask);
- double2 __ovld __cnfn shuffle(double8 x, ulong2 mask);
-@@ -13926,7 +15963,7 @@ double16 __ovld __cnfn shuffle(double2 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double4 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double8 x, ulong16 mask);
- double16 __ovld __cnfn shuffle(double16 x, ulong16 mask);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half2 __ovld __cnfn shuffle(half2 x, ushort2 mask);
-@@ -14130,7 +16167,7 @@ float16 __ovld __cnfn shuffle2(float4 x, float4 y, uint16 mask);
- float16 __ovld __cnfn shuffle2(float8 x, float8 y, uint16 mask);
- float16 __ovld __cnfn shuffle2(float16 x, float16 y, uint16 mask);
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double2 __ovld __cnfn shuffle2(double2 x, double2 y, ulong2 mask);
- double2 __ovld __cnfn shuffle2(double4 x, double4 y, ulong2 mask);
- double2 __ovld __cnfn shuffle2(double8 x, double8 y, ulong2 mask);
-@@ -14150,7 +16187,7 @@ double16 __ovld __cnfn shuffle2(double2 x, double2 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double4 x, double4 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double8 x, double8 y, ulong16 mask);
- double16 __ovld __cnfn shuffle2(double16 x, double16 y, ulong16 mask);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half2 __ovld __cnfn shuffle2(half2 x, half2 y, ushort2 mask);
-@@ -14186,6 +16223,7 @@ int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)))
- #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
- #endif //cl_khr_gl_msaa_sharing
-
-+#ifdef __opencl_c_images
- /**
- * Use the coordinate (coord.xy) to do an element lookup in
- * the 2D image object specified by image.
-@@ -14464,6 +16502,7 @@ half4 __purefn __ovld read_imageh(read_only image1d_buffer_t image, int coord);
-
- // Image read functions for read_write images
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- float4 __purefn __ovld read_imagef(read_write image1d_t image, int coord);
- int4 __purefn __ovld read_imagei(read_write image1d_t image, int coord);
- uint4 __purefn __ovld read_imageui(read_write image1d_t image, int coord);
-@@ -14507,6 +16546,7 @@ float __purefn __ovld read_imagef(read_write image2d_array_msaa_depth_t image, i
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- #ifdef cl_khr_mipmap_image
- float4 __purefn __ovld read_imagef(read_write image1d_t image, sampler_t sampler, float coord, float lod);
- int4 __purefn __ovld read_imagei(read_write image1d_t image, sampler_t sampler, float coord, float lod);
-@@ -14557,6 +16597,7 @@ int4 __purefn __ovld read_imagei(read_write image3d_t image, sampler_t sampler,
- uint4 __purefn __ovld read_imageui(read_write image3d_t image, sampler_t sampler, float4 coord, float4 gradientX, float4 gradientY);
-
- #endif //cl_khr_mipmap_image
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // Image read functions returning half4 type
-@@ -14568,6 +16609,7 @@ half4 __purefn __ovld read_imageh(read_write image1d_array_t image, int2 coord);
- half4 __purefn __ovld read_imageh(read_write image2d_array_t image, int4 coord);
- half4 __purefn __ovld read_imageh(read_write image1d_buffer_t image, int coord);
- #endif //cl_khr_fp16
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14657,7 +16699,7 @@ void __ovld write_imagef(write_only image1d_array_t image_array, int2 coord, flo
- void __ovld write_imagei(write_only image1d_array_t image_array, int2 coord, int4 color);
- void __ovld write_imageui(write_only image1d_array_t image_array, int2 coord, uint4 color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(write_only image3d_t image, int4 coord, float4 color);
- void __ovld write_imagei(write_only image3d_t image, int4 coord, int4 color);
- void __ovld write_imageui(write_only image3d_t image, int4 coord, uint4 color);
-@@ -14690,7 +16732,7 @@ void __ovld write_imageui(write_only image2d_array_t image_array, int4 coord, in
- void __ovld write_imagef(write_only image2d_depth_t image, int2 coord, int lod, float depth);
- void __ovld write_imagef(write_only image2d_array_depth_t image, int4 coord, int lod, float depth);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(write_only image3d_t image, int4 coord, int lod, float4 color);
- void __ovld write_imagei(write_only image3d_t image, int4 coord, int lod, int4 color);
- void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4 color);
-@@ -14703,7 +16745,7 @@ void __ovld write_imageui(write_only image3d_t image, int4 coord, int lod, uint4
- #ifdef cl_khr_fp16
- void __ovld write_imageh(write_only image1d_t image, int coord, half4 color);
- void __ovld write_imageh(write_only image2d_t image, int2 coord, half4 color);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imageh(write_only image3d_t image, int4 coord, half4 color);
- #endif
- void __ovld write_imageh(write_only image1d_array_t image, int2 coord, half4 color);
-@@ -14713,6 +16755,7 @@ void __ovld write_imageh(write_only image1d_buffer_t image, int coord, half4 col
-
- // Image write functions for read_write images
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- void __ovld write_imagef(read_write image2d_t image, int2 coord, float4 color);
- void __ovld write_imagei(read_write image2d_t image, int2 coord, int4 color);
- void __ovld write_imageui(read_write image2d_t image, int2 coord, uint4 color);
-@@ -14733,7 +16776,7 @@ void __ovld write_imagef(read_write image1d_array_t image_array, int2 coord, flo
- void __ovld write_imagei(read_write image1d_array_t image_array, int2 coord, int4 color);
- void __ovld write_imageui(read_write image1d_array_t image_array, int2 coord, uint4 color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(read_write image3d_t image, int4 coord, float4 color);
- void __ovld write_imagei(read_write image3d_t image, int4 coord, int4 color);
- void __ovld write_imageui(read_write image3d_t image, int4 coord, uint4 color);
-@@ -14765,7 +16808,7 @@ void __ovld write_imageui(read_write image2d_array_t image_array, int4 coord, in
- void __ovld write_imagef(read_write image2d_depth_t image, int2 coord, int lod, float color);
- void __ovld write_imagef(read_write image2d_array_depth_t image, int4 coord, int lod, float color);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imagef(read_write image3d_t image, int4 coord, int lod, float4 color);
- void __ovld write_imagei(read_write image3d_t image, int4 coord, int lod, int4 color);
- void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4 color);
-@@ -14778,13 +16821,14 @@ void __ovld write_imageui(read_write image3d_t image, int4 coord, int lod, uint4
- #ifdef cl_khr_fp16
- void __ovld write_imageh(read_write image1d_t image, int coord, half4 color);
- void __ovld write_imageh(read_write image2d_t image, int2 coord, half4 color);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- void __ovld write_imageh(read_write image3d_t image, int4 coord, half4 color);
- #endif
- void __ovld write_imageh(read_write image1d_array_t image, int2 coord, half4 color);
- void __ovld write_imageh(read_write image2d_array_t image, int4 coord, half4 color);
- void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 color);
- #endif //cl_khr_fp16
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // Note: In OpenCL v1.0/1.1/1.2, image argument of image query builtin functions does not have
-@@ -14798,7 +16842,7 @@ void __ovld write_imageh(read_write image1d_buffer_t image, int coord, half4 col
- int __ovld __cnfn get_image_width(read_only image1d_t image);
- int __ovld __cnfn get_image_width(read_only image1d_buffer_t image);
- int __ovld __cnfn get_image_width(read_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_width(read_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_width(read_only image1d_array_t image);
-@@ -14817,7 +16861,7 @@ int __ovld __cnfn get_image_width(read_only image2d_array_msaa_depth_t image);
- int __ovld __cnfn get_image_width(write_only image1d_t image);
- int __ovld __cnfn get_image_width(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_width(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_width(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_width(write_only image1d_array_t image);
-@@ -14834,6 +16878,7 @@ int __ovld __cnfn get_image_width(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_width(read_write image1d_t image);
- int __ovld __cnfn get_image_width(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_width(read_write image2d_t image);
-@@ -14850,6 +16895,7 @@ int __ovld __cnfn get_image_width(read_write image2d_msaa_depth_t image);
- int __ovld __cnfn get_image_width(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_width(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14870,7 +16916,7 @@ int __ovld __cnfn get_image_height(read_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- int __ovld __cnfn get_image_height(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_height(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_height(write_only image2d_array_t image);
-@@ -14886,6 +16932,7 @@ int __ovld __cnfn get_image_height(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_height(read_write image2d_t image);
- int __ovld __cnfn get_image_height(read_write image3d_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_t image);
-@@ -14899,6 +16946,7 @@ int __ovld __cnfn get_image_height(read_write image2d_msaa_depth_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_height(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -14906,12 +16954,14 @@ int __ovld __cnfn get_image_height(read_write image2d_array_msaa_depth_t image);
- */
- int __ovld __cnfn get_image_depth(read_only image3d_t image);
-
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_depth(write_only image3d_t image);
- #endif
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_depth(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL Extension v2.0 s9.18 - Mipmaps
-@@ -14927,13 +16977,15 @@ int __ovld get_image_num_mip_levels(read_only image3d_t image);
-
- int __ovld get_image_num_mip_levels(write_only image1d_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld get_image_num_mip_levels(write_only image3d_t image);
- #endif
-
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_mip_levels(read_write image1d_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_t image);
- int __ovld get_image_num_mip_levels(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
-
- int __ovld get_image_num_mip_levels(read_only image1d_array_t image);
- int __ovld get_image_num_mip_levels(read_only image2d_array_t image);
-@@ -14945,10 +16997,12 @@ int __ovld get_image_num_mip_levels(write_only image2d_array_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_array_depth_t image);
- int __ovld get_image_num_mip_levels(write_only image2d_depth_t image);
-
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_mip_levels(read_write image1d_array_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_array_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_array_depth_t image);
- int __ovld get_image_num_mip_levels(read_write image2d_depth_t image);
-+#endif //__opencl_c_read_write_images
-
- #endif //cl_khr_mipmap_image
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-@@ -14992,7 +17046,7 @@ int __ovld __cnfn get_image_channel_data_type(read_only image2d_array_msaa_depth
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_t image);
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_data_type(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_channel_data_type(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_channel_data_type(write_only image1d_array_t image);
-@@ -15009,6 +17063,7 @@ int __ovld __cnfn get_image_channel_data_type(write_only image2d_array_msaa_dept
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_channel_data_type(read_write image1d_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_t image);
-@@ -15025,6 +17080,7 @@ int __ovld __cnfn get_image_channel_data_type(read_write image2d_msaa_depth_t im
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_channel_data_type(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15064,7 +17120,7 @@ int __ovld __cnfn get_image_channel_order(read_only image2d_array_msaa_depth_t i
- int __ovld __cnfn get_image_channel_order(write_only image1d_t image);
- int __ovld __cnfn get_image_channel_order(write_only image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_order(write_only image2d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int __ovld __cnfn get_image_channel_order(write_only image3d_t image);
- #endif
- int __ovld __cnfn get_image_channel_order(write_only image1d_array_t image);
-@@ -15081,6 +17137,7 @@ int __ovld __cnfn get_image_channel_order(write_only image2d_array_msaa_depth_t
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld __cnfn get_image_channel_order(read_write image1d_t image);
- int __ovld __cnfn get_image_channel_order(read_write image1d_buffer_t image);
- int __ovld __cnfn get_image_channel_order(read_write image2d_t image);
-@@ -15097,6 +17154,7 @@ int __ovld __cnfn get_image_channel_order(read_write image2d_msaa_depth_t image)
- int __ovld __cnfn get_image_channel_order(read_write image2d_array_msaa_t image);
- int __ovld __cnfn get_image_channel_order(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15131,6 +17189,7 @@ int2 __ovld __cnfn get_image_dim(write_only image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int2 __ovld __cnfn get_image_dim(read_write image2d_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_t image);
- #ifdef cl_khr_depth_images
-@@ -15143,6 +17202,7 @@ int2 __ovld __cnfn get_image_dim(read_write image2d_msaa_depth_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_t image);
- int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_depth_t image);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15152,11 +17212,13 @@ int2 __ovld __cnfn get_image_dim(read_write image2d_array_msaa_depth_t image);
- * component and the w component is 0.
- */
- int4 __ovld __cnfn get_image_dim(read_only image3d_t image);
--#ifdef cl_khr_3d_image_writes
-+#if defined(cl_khr_3d_image_writes) || defined(__opencl_c_3d_image_writes)
- int4 __ovld __cnfn get_image_dim(write_only image3d_t image);
- #endif
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int4 __ovld __cnfn get_image_dim(read_write image3d_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15184,6 +17246,7 @@ size_t __ovld __cnfn get_image_array_size(write_only image2d_array_msaa_depth_t
- #endif //cl_khr_gl_msaa_sharing
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- size_t __ovld __cnfn get_image_array_size(read_write image1d_array_t image_array);
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_t image_array);
- #ifdef cl_khr_depth_images
-@@ -15193,6 +17256,7 @@ size_t __ovld __cnfn get_image_array_size(read_write image2d_array_depth_t image
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_msaa_t image_array);
- size_t __ovld __cnfn get_image_array_size(read_write image2d_array_msaa_depth_t image_array);
- #endif //cl_khr_gl_msaa_sharing
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- /**
-@@ -15210,16 +17274,21 @@ int __ovld get_image_num_samples(write_only image2d_array_msaa_t image);
- int __ovld get_image_num_samples(write_only image2d_array_msaa_depth_t image);
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_read_write_images
- int __ovld get_image_num_samples(read_write image2d_msaa_t image);
- int __ovld get_image_num_samples(read_write image2d_msaa_depth_t image);
- int __ovld get_image_num_samples(read_write image2d_array_msaa_t image);
- int __ovld get_image_num_samples(read_write image2d_array_msaa_depth_t image);
-+#endif //__opencl_c_read_write_images
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
- #endif
-
-+#endif //__opencl_c_images
-+
- // OpenCL v2.0 s6.13.15 - Work-group Functions
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_work_group_collective_functions
- int __ovld __conv work_group_all(int predicate);
- int __ovld __conv work_group_any(int predicate);
-
-@@ -15243,11 +17312,11 @@ ulong __ovld __conv work_group_broadcast(ulong a, size_t x, size_t y, size_t z);
- float __ovld __conv work_group_broadcast(float a, size_t local_id);
- float __ovld __conv work_group_broadcast(float a, size_t x, size_t y);
- float __ovld __conv work_group_broadcast(float a, size_t x, size_t y, size_t z);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv work_group_broadcast(double a, size_t local_id);
- double __ovld __conv work_group_broadcast(double a, size_t x, size_t y);
- double __ovld __conv work_group_broadcast(double a, size_t x, size_t y, size_t z);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #ifdef cl_khr_fp16
- half __ovld __conv work_group_reduce_add(half x);
-@@ -15305,7 +17374,7 @@ float __ovld __conv work_group_scan_exclusive_max(float x);
- float __ovld __conv work_group_scan_inclusive_add(float x);
- float __ovld __conv work_group_scan_inclusive_min(float x);
- float __ovld __conv work_group_scan_inclusive_max(float x);
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv work_group_reduce_add(double x);
- double __ovld __conv work_group_reduce_min(double x);
- double __ovld __conv work_group_reduce_max(double x);
-@@ -15315,19 +17384,18 @@ double __ovld __conv work_group_scan_exclusive_max(double x);
- double __ovld __conv work_group_scan_inclusive_add(double x);
- double __ovld __conv work_group_scan_inclusive_min(double x);
- double __ovld __conv work_group_scan_inclusive_max(double x);
--#endif //cl_khr_fp64
--
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-+#endif //__opencl_c_work_group_collective_functions
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL v2.0 s6.13.16 - Pipe Functions
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_pipes
- bool __ovld is_valid_reserve_id(reserve_id_t reserve_id);
--#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#endif //__opencl_c_pipes
-
- // OpenCL v2.0 s6.13.17 - Enqueue Kernels
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
--
-+#ifdef __opencl_c_device_enqueue
- ndrange_t __ovld ndrange_1D(size_t);
- ndrange_t __ovld ndrange_1D(size_t, size_t);
- ndrange_t __ovld ndrange_1D(size_t, size_t, size_t);
-@@ -15355,11 +17423,13 @@ bool __ovld is_valid_event (clk_event_t event);
- void __ovld capture_event_profiling_info(clk_event_t, clk_profiling_info, __global void* value);
-
- queue_t __ovld get_default_queue(void);
-+#endif //__opencl_c_device_enqueue
- #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- // OpenCL Extension v2.0 s9.17 - Sub-groups
-
--#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups)
-+#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || \
-+ defined(__opencl_c_subgroups)
- // Shared Sub Group Functions
- uint __ovld get_sub_group_size(void);
- uint __ovld get_max_sub_group_size(void);
-@@ -15445,7 +17515,7 @@ half __ovld __conv sub_group_scan_inclusive_min(half x);
- half __ovld __conv sub_group_scan_inclusive_max(half x);
- #endif //cl_khr_fp16
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv sub_group_broadcast(double x, uint sub_group_local_id);
- double __ovld __conv sub_group_reduce_add(double x);
- double __ovld __conv sub_group_reduce_min(double x);
-@@ -15456,7 +17526,7 @@ double __ovld __conv sub_group_scan_exclusive_max(double x);
- double __ovld __conv sub_group_scan_inclusive_add(double x);
- double __ovld __conv sub_group_scan_inclusive_min(double x);
- double __ovld __conv sub_group_scan_inclusive_max(double x);
--#endif //cl_khr_fp64
-+#endif // defined(cl_khr_fp64) || defined(__opencl_c_fp64)
-
- #endif //cl_khr_subgroups cl_intel_subgroups
-
-@@ -16226,16 +18296,22 @@ uint16 __ovld __conv intel_sub_group_shuffle_xor( uint16 x, uint c );
- long __ovld __conv intel_sub_group_shuffle_xor( long x, uint c );
- ulong __ovld __conv intel_sub_group_shuffle_xor( ulong x, uint c );
-
-+#ifdef __opencl_c_images
- uint __ovld __conv intel_sub_group_block_read( read_only image2d_t image, int2 coord );
- uint2 __ovld __conv intel_sub_group_block_read2( read_only image2d_t image, int2 coord );
- uint4 __ovld __conv intel_sub_group_block_read4( read_only image2d_t image, int2 coord );
- uint8 __ovld __conv intel_sub_group_block_read8( read_only image2d_t image, int2 coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- uint __ovld __conv intel_sub_group_block_read(read_write image2d_t image, int2 coord);
- uint2 __ovld __conv intel_sub_group_block_read2(read_write image2d_t image, int2 coord);
- uint4 __ovld __conv intel_sub_group_block_read4(read_write image2d_t image, int2 coord);
- uint8 __ovld __conv intel_sub_group_block_read8(read_write image2d_t image, int2 coord);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- uint __ovld __conv intel_sub_group_block_read( const __global uint* p );
-@@ -16243,16 +18319,22 @@ uint2 __ovld __conv intel_sub_group_block_read2( const __global uint* p );
- uint4 __ovld __conv intel_sub_group_block_read4( const __global uint* p );
- uint8 __ovld __conv intel_sub_group_block_read8( const __global uint* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write(write_only image2d_t image, int2 coord, uint data);
- void __ovld __conv intel_sub_group_block_write2(write_only image2d_t image, int2 coord, uint2 data);
- void __ovld __conv intel_sub_group_block_write4(write_only image2d_t image, int2 coord, uint4 data);
- void __ovld __conv intel_sub_group_block_write8(write_only image2d_t image, int2 coord, uint8 data);
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write(read_write image2d_t image, int2 coord, uint data);
- void __ovld __conv intel_sub_group_block_write2(read_write image2d_t image, int2 coord, uint2 data);
- void __ovld __conv intel_sub_group_block_write4(read_write image2d_t image, int2 coord, uint4 data);
- void __ovld __conv intel_sub_group_block_write8(read_write image2d_t image, int2 coord, uint8 data);
-+#endif // __opencl_c_read_write_images
-+#endif // __opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write( __global uint* p, uint data );
-@@ -16267,7 +18349,7 @@ half __ovld __conv intel_sub_group_shuffle_up( half prev, half cur, uint c );
- half __ovld __conv intel_sub_group_shuffle_xor( half x, uint c );
- #endif
-
--#if defined(cl_khr_fp64)
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- double __ovld __conv intel_sub_group_shuffle( double x, uint c );
- double __ovld __conv intel_sub_group_shuffle_down( double prev, double cur, uint c );
- double __ovld __conv intel_sub_group_shuffle_up( double prev, double cur, uint c );
-@@ -16366,16 +18448,22 @@ ushort __ovld __conv intel_sub_group_scan_inclusive_min( ushort x );
- short __ovld __conv intel_sub_group_scan_inclusive_max( short x );
- ushort __ovld __conv intel_sub_group_scan_inclusive_max( ushort x );
-
-+#ifdef __opencl_c_images
- uint __ovld __conv intel_sub_group_block_read_ui( read_only image2d_t image, int2 byte_coord );
- uint2 __ovld __conv intel_sub_group_block_read_ui2( read_only image2d_t image, int2 byte_coord );
- uint4 __ovld __conv intel_sub_group_block_read_ui4( read_only image2d_t image, int2 byte_coord );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( read_only image2d_t image, int2 byte_coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- uint __ovld __conv intel_sub_group_block_read_ui( read_write image2d_t image, int2 byte_coord );
- uint2 __ovld __conv intel_sub_group_block_read_ui2( read_write image2d_t image, int2 byte_coord );
- uint4 __ovld __conv intel_sub_group_block_read_ui4( read_write image2d_t image, int2 byte_coord );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( read_write image2d_t image, int2 byte_coord );
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- uint __ovld __conv intel_sub_group_block_read_ui( const __global uint* p );
-@@ -16383,16 +18471,22 @@ uint2 __ovld __conv intel_sub_group_block_read_ui2( const __global uint* p
- uint4 __ovld __conv intel_sub_group_block_read_ui4( const __global uint* p );
- uint8 __ovld __conv intel_sub_group_block_read_ui8( const __global uint* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write_ui( read_only image2d_t image, int2 byte_coord, uint data );
- void __ovld __conv intel_sub_group_block_write_ui2( read_only image2d_t image, int2 byte_coord, uint2 data );
- void __ovld __conv intel_sub_group_block_write_ui4( read_only image2d_t image, int2 byte_coord, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( read_only image2d_t image, int2 byte_coord, uint8 data );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write_ui( read_write image2d_t image, int2 byte_coord, uint data );
- void __ovld __conv intel_sub_group_block_write_ui2( read_write image2d_t image, int2 byte_coord, uint2 data );
- void __ovld __conv intel_sub_group_block_write_ui4( read_write image2d_t image, int2 byte_coord, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( read_write image2d_t image, int2 byte_coord, uint8 data );
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write_ui( __global uint* p, uint data );
-@@ -16400,16 +18494,22 @@ void __ovld __conv intel_sub_group_block_write_ui2( __global uint* p, uint
- void __ovld __conv intel_sub_group_block_write_ui4( __global uint* p, uint4 data );
- void __ovld __conv intel_sub_group_block_write_ui8( __global uint* p, uint8 data );
-
-+#ifdef __opencl_c_images
- ushort __ovld __conv intel_sub_group_block_read_us( read_only image2d_t image, int2 coord );
- ushort2 __ovld __conv intel_sub_group_block_read_us2( read_only image2d_t image, int2 coord );
- ushort4 __ovld __conv intel_sub_group_block_read_us4( read_only image2d_t image, int2 coord );
- ushort8 __ovld __conv intel_sub_group_block_read_us8( read_only image2d_t image, int2 coord );
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- ushort __ovld __conv intel_sub_group_block_read_us(read_write image2d_t image, int2 coord);
- ushort2 __ovld __conv intel_sub_group_block_read_us2(read_write image2d_t image, int2 coord);
- ushort4 __ovld __conv intel_sub_group_block_read_us4(read_write image2d_t image, int2 coord);
- ushort8 __ovld __conv intel_sub_group_block_read_us8(read_write image2d_t image, int2 coord);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- ushort __ovld __conv intel_sub_group_block_read_us( const __global ushort* p );
-@@ -16417,16 +18517,22 @@ ushort2 __ovld __conv intel_sub_group_block_read_us2( const __global ushort*
- ushort4 __ovld __conv intel_sub_group_block_read_us4( const __global ushort* p );
- ushort8 __ovld __conv intel_sub_group_block_read_us8( const __global ushort* p );
-
-+#ifdef __opencl_c_images
- void __ovld __conv intel_sub_group_block_write_us(write_only image2d_t image, int2 coord, ushort data);
- void __ovld __conv intel_sub_group_block_write_us2(write_only image2d_t image, int2 coord, ushort2 data);
- void __ovld __conv intel_sub_group_block_write_us4(write_only image2d_t image, int2 coord, ushort4 data);
- void __ovld __conv intel_sub_group_block_write_us8(write_only image2d_t image, int2 coord, ushort8 data);
-+#endif //__opencl_c_images
-
- #if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#ifdef __opencl_c_images
-+#ifdef __opencl_c_read_write_images
- void __ovld __conv intel_sub_group_block_write_us(read_write image2d_t image, int2 coord, ushort data);
- void __ovld __conv intel_sub_group_block_write_us2(read_write image2d_t image, int2 coord, ushort2 data);
- void __ovld __conv intel_sub_group_block_write_us4(read_write image2d_t image, int2 coord, ushort4 data);
- void __ovld __conv intel_sub_group_block_write_us8(read_write image2d_t image, int2 coord, ushort8 data);
-+#endif //__opencl_c_read_write_images
-+#endif //__opencl_c_images
- #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-
- void __ovld __conv intel_sub_group_block_write_us( __global ushort* p, ushort data );
-@@ -16545,6 +18651,7 @@ short2 __ovld intel_sub_group_avc_ime_adjust_ref_offset(
- short2 ref_offset, ushort2 src_coord, ushort2 ref_window_size,
- ushort2 image_size);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_ime_result_t __ovld
- intel_sub_group_avc_ime_evaluate_with_single_reference(
- read_only image2d_t src_image, read_only image2d_t ref_image,
-@@ -16585,6 +18692,7 @@ intel_sub_group_avc_ime_evaluate_with_dual_reference_streaminout(
- read_only image2d_t bwd_ref_image, sampler_t vme_media_sampler,
- intel_sub_group_avc_ime_payload_t payload,
- intel_sub_group_avc_ime_dual_reference_streamin_t streamin_components);
-+#endif //__opencl_c_images
-
- intel_sub_group_avc_ime_single_reference_streamin_t __ovld
- intel_sub_group_avc_ime_get_single_reference_streamin(
-@@ -16649,6 +18757,7 @@ intel_sub_group_avc_ref_payload_t __ovld
- intel_sub_group_avc_ref_set_bilinear_filter_enable(
- intel_sub_group_avc_ref_payload_t payload);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_ref_result_t __ovld
- intel_sub_group_avc_ref_evaluate_with_single_reference(
- read_only image2d_t src_image, read_only image2d_t ref_image,
-@@ -16667,6 +18776,7 @@ intel_sub_group_avc_ref_evaluate_with_multi_reference(
- read_only image2d_t src_image, uint packed_reference_ids,
- uchar packed_reference_field_polarities, sampler_t vme_media_sampler,
- intel_sub_group_avc_ref_payload_t payload);
-+#endif //__opencl_c_images
-
- // SIC built-in functions
- intel_sub_group_avc_sic_payload_t __ovld
-@@ -16717,6 +18827,7 @@ intel_sub_group_avc_sic_set_block_based_raw_skip_sad(
- uchar block_based_skip_type,
- intel_sub_group_avc_sic_payload_t payload);
-
-+#ifdef __opencl_c_images
- intel_sub_group_avc_sic_result_t __ovld
- intel_sub_group_avc_sic_evaluate_ipe(
- read_only image2d_t src_image, sampler_t vme_media_sampler,
-@@ -16739,6 +18850,7 @@ intel_sub_group_avc_sic_evaluate_with_multi_reference(
- read_only image2d_t src_image, uint packed_reference_ids,
- uchar packed_reference_field_polarities, sampler_t vme_media_sampler,
- intel_sub_group_avc_sic_payload_t payload);
-+#endif //__opencl_c_images
-
- uchar __ovld intel_sub_group_avc_sic_get_ipe_luma_shape(
- intel_sub_group_avc_sic_result_t result);
-diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
-index c87d240a8206..8c8f03bba0f3 100644
---- a/clang/lib/Parse/ParseDecl.cpp
-+++ b/clang/lib/Parse/ParseDecl.cpp
-@@ -3799,8 +3799,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
- isInvalid = DS.SetTypeAltiVecBool(true, Loc, PrevSpec, DiagID, Policy);
- break;
- case tok::kw_pipe:
-- if (!getLangOpts().OpenCL || (getLangOpts().OpenCLVersion < 200 &&
-- !getLangOpts().OpenCLCPlusPlus)) {
-+ if (!getLangOpts().OpenCLPipeKeyword) {
- // OpenCL 2.0 defined this keyword. OpenCL 1.2 and earlier should
- // support the "pipe" word as identifier.
- Tok.getIdentifierInfo()->revertTokenIDToIdentifier();
-@@ -3922,8 +3921,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
- case tok::kw___generic:
- // generic address space is introduced only in OpenCL v2.0
- // see OpenCL C Spec v2.0 s6.5.5
-- if (Actions.getLangOpts().OpenCLVersion < 200 &&
-- !Actions.getLangOpts().OpenCLCPlusPlus) {
-+ if (!Actions.getLangOpts().OpenCLGenericKeyword) {
- DiagID = diag::err_opencl_unknown_type_specifier;
- PrevSpec = Tok.getIdentifierInfo()->getNameStart();
- isInvalid = true;
-@@ -4973,8 +4971,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
- default: return false;
-
- case tok::kw_pipe:
-- return (getLangOpts().OpenCL && getLangOpts().OpenCLVersion >= 200) ||
-- getLangOpts().OpenCLCPlusPlus;
-+ return getLangOpts().OpenCLPipeKeyword;
-
- case tok::identifier: // foo::bar
- // Unfortunate hack to support "Class.factoryMethod" notation.
-@@ -5499,8 +5496,7 @@ static bool isPtrOperatorToken(tok::TokenKind Kind, const LangOptions &Lang,
- if (Kind == tok::star || Kind == tok::caret)
- return true;
-
-- if (Kind == tok::kw_pipe &&
-- ((Lang.OpenCL && Lang.OpenCLVersion >= 200) || Lang.OpenCLCPlusPlus))
-+ if (Kind == tok::kw_pipe && Lang.OpenCLPipeKeyword)
- return true;
-
- if (!Lang.CPlusPlus)
-diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
-index 6402b31d00b2..65f283ad556b 100644
---- a/clang/lib/Parse/ParsePragma.cpp
-+++ b/clang/lib/Parse/ParsePragma.cpp
-@@ -749,12 +749,14 @@ void Parser::HandlePragmaOpenCLExtension() {
- if (Name == "all") {
- if (State == Disable) {
- Opt.disableAll();
-- Opt.enableSupportedCore(getLangOpts());
-+ Opt.enableSupportedCore();
- } else {
- PP.Diag(NameLoc, diag::warn_pragma_expected_predicate) << 1;
- }
-+ } else if (Opt.isFeature(Name)) {
-+ PP.Diag(NameLoc, diag::warn_opencl_pragma_feature_ignore) << Ident;
- } else if (State == Begin) {
-- if (!Opt.isKnown(Name) || !Opt.isSupported(Name, getLangOpts())) {
-+ if (!Opt.isKnown(Name) || !Opt.isSupported(Name)) {
- Opt.support(Name);
- }
- Actions.setCurrentOpenCLExtension(Name);
-@@ -764,9 +766,9 @@ void Parser::HandlePragmaOpenCLExtension() {
- Actions.setCurrentOpenCLExtension("");
- } else if (!Opt.isKnown(Name))
- PP.Diag(NameLoc, diag::warn_pragma_unknown_extension) << Ident;
-- else if (Opt.isSupportedExtension(Name, getLangOpts()))
-+ else if (Opt.isSupportedExtension(Name))
- Opt.enable(Name, State == Enable);
-- else if (Opt.isSupportedCore(Name, getLangOpts()))
-+ else if (Opt.isSupportedCore(Name))
- PP.Diag(NameLoc, diag::warn_pragma_extension_is_core) << Ident;
- else
- PP.Diag(NameLoc, diag::warn_pragma_unsupported_extension) << Ident;
-diff --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td
-index 745363a6b43f..6a1fce567090 100644
---- a/clang/lib/Sema/OpenCLBuiltins.td
-+++ b/clang/lib/Sema/OpenCLBuiltins.td
-@@ -22,11 +22,13 @@
- class Version<int _Version> {
- int ID = _Version;
- }
-+
- def CLAll : Version< 0>;
- def CL10 : Version<100>;
- def CL11 : Version<110>;
- def CL12 : Version<120>;
- def CL20 : Version<200>;
-+def CL30 : Version<300>;
-
- // Address spaces
- // Pointer types need to be assigned an address space.
-@@ -72,6 +74,14 @@ def ArmIntegerDotProductAccumulateInt8 : FunctionExtension<"cl_arm_integ
- def ArmIntegerDotProductAccumulateInt16 : FunctionExtension<"cl_arm_integer_dot_product_accumulate_int16">;
- def ArmIntegerDotProductAccumulateSaturateInt8 : FunctionExtension<"cl_arm_integer_dot_product_accumulate_saturate_int8">;
-
-+// Features
-+def FuncExtGenericAddressSpace : FunctionExtension<"__opencl_c_generic_address_space">;
-+def FuncExtWorkGroupCollective : FunctionExtension<"__opencl_c_work_group_collective_functions">;
-+def FuncExtPipes : FunctionExtension<"__opencl_c_pipes">;
-+def FuncExtDeviceSidEenqueue : FunctionExtension<"__opencl_c_device_enqueue">;
-+def FuncNonExplicitAtomicFeatures : FunctionExtension<"__opencl_c_atomic_order_seq_cst __opencl_c_atomic_scope_device">;
-+def FuncNonExplicitAtomicFeaturesAndGenericAS : FunctionExtension<"__opencl_c_atomic_order_seq_cst __opencl_c_atomic_scope_device __opencl_c_generic_address_space">;
-+
- // Qualified Type. These map to ASTContext::QualType.
- class QualType<string _Name, bit _IsAbstract=0> {
- // Name of the field or function in a clang::ASTContext
-@@ -236,13 +246,9 @@ class Builtin<string _Name, list<Type> _Signature, list<bit> _Attributes = Attr.
- bit IsConv = _Attributes[2];
- // OpenCL extensions to which the function belongs.
- FunctionExtension Extension = FuncExtNone;
-- // Version of OpenCL from which the function is available (e.g.: CL10).
-- // MinVersion is inclusive.
-- Version MinVersion = CL10;
-- // Version of OpenCL from which the function is not supported anymore.
-- // MaxVersion is exclusive.
-+ // List of OpenCL version in which this function available.
- // CLAll makes the function available for all versions.
-- Version MaxVersion = CLAll;
-+ list<Version> Versions = [CLAll];
- }
-
- //===----------------------------------------------------------------------===//
-@@ -421,7 +427,7 @@ foreach name = ["get_global_size", "get_global_id", "get_local_size",
- def : Builtin<name, [Size, UInt], Attr.Const>;
- }
-
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
- def : Builtin<"get_enqueued_local_size", [Size, UInt]>;
- foreach name = ["get_global_linear_id", "get_local_linear_id"] in {
- def : Builtin<name, [Size]>;
-@@ -494,7 +500,7 @@ foreach name = ["fma", "mad"] in {
- }
-
- // --- Version dependent ---
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- foreach name = ["fract", "modf", "sincos"] in {
- def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, AS>]>;
-@@ -511,7 +517,9 @@ let MaxVersion = CL20 in {
- }
- }
- }
--let MinVersion = CL20 in {
-+
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach name = ["fract", "modf", "sincos"] in {
- def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, GenericAS>]>;
- }
-@@ -524,6 +532,7 @@ let MinVersion = CL20 in {
- def : Builtin<name, [Type, Type, Type, PointerType<GenTypeIntVecAndScalar, GenericAS>]>;
- }
- }
-+ }
- }
-
- // --- Table 9 ---
-@@ -554,7 +563,7 @@ foreach name = ["abs"] in {
- foreach name = ["clz", "popcount"] in {
- def : Builtin<name, [AIGenTypeN, AIGenTypeN], Attr.Const>;
- }
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
- foreach name = ["ctz"] in {
- def : Builtin<name, [AIGenTypeN, AIGenTypeN]>;
- }
-@@ -728,7 +737,7 @@ foreach name = ["select"] in {
- // --- Table 15 ---
- // Variants for OpenCL versions below 2.0, using pointers to the global, local
- // and private address spaces.
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- foreach VSize = [2, 3, 4, 8, 16] in {
- foreach name = ["vload" # VSize] in {
-@@ -771,7 +780,8 @@ let MaxVersion = CL20 in {
- }
- // Variants for OpenCL versions above 2.0, using pointers to the generic
- // address space.
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach VSize = [2, 3, 4, 8, 16] in {
- foreach name = ["vload" # VSize] in {
- def : Builtin<name, [VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, GenericAS>]>;
-@@ -809,6 +819,7 @@ let MinVersion = CL20 in {
- }
- }
- }
-+ }
- }
- // Variants using pointers to the constant address space.
- foreach VSize = [2, 3, 4, 8, 16] in {
-@@ -829,7 +840,7 @@ foreach VSize = [2, 3, 4, 8, 16] in {
- def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, ConstantAS>]>;
- }
- }
--let MaxVersion = CL20 in {
-+let Versions = [CL10, CL11, CL12, CL30] in {
- foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
- def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
- def : Builtin<"vloada_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
-@@ -852,7 +863,8 @@ let MaxVersion = CL20 in {
- }
- }
- }
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- foreach AS = [GenericAS] in {
- def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
- def : Builtin<"vloada_half", [Float, Size, PointerType<ConstType<Half>, AS>]>;
-@@ -874,6 +886,7 @@ let MinVersion = CL20 in {
- }
- }
- }
-+ }
- }
-
- foreach AS = [ConstantAS] in {
-@@ -899,7 +912,9 @@ foreach name = ["async_work_group_strided_copy"] in {
- def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Size, Event]>;
- }
- foreach name = ["wait_group_events"] in {
-+ let Extension = FuncExtGenericAddressSpace in {
- def : Builtin<name, [Void, Int, PointerType<Event, GenericAS>]>;
-+ }
- }
- foreach name = ["prefetch"] in {
- def : Builtin<name, [Void, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size]>;
-@@ -1000,13 +1015,25 @@ foreach AS = [GlobalAS, LocalAS] in {
- }
- }
- }
-+
- // OpenCL v2.0 s6.13.11 - Atomic Functions.
--let MinVersion = CL20 in {
-+
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtGenericAddressSpace in {
-+ foreach TypePair = [[AtomicInt, Int], [AtomicUInt, UInt],
-+ [AtomicLong, Long], [AtomicULong, ULong],
-+ [AtomicFloat, Float], [AtomicDouble, Double]] in {
-+ def : Builtin<"atomic_init",
-+ [Void, PointerType<VolatileType<TypePair[0]>, GenericAS>, TypePair[1]]>;
-+ }
-+ }
-+}
-+
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncNonExplicitAtomicFeaturesAndGenericAS in {
- foreach TypePair = [[AtomicInt, Int], [AtomicUInt, UInt],
- [AtomicLong, Long], [AtomicULong, ULong],
- [AtomicFloat, Float], [AtomicDouble, Double]] in {
-- def : Builtin<"atomic_init",
-- [Void, PointerType<VolatileType<TypePair[0]>, GenericAS>, TypePair[1]]>;
- def : Builtin<"atomic_store",
- [Void, PointerType<VolatileType<TypePair[0]>, GenericAS>, TypePair[1]]>;
- def : Builtin<"atomic_load",
-@@ -1038,6 +1065,59 @@ let MinVersion = CL20 in {
- [TypePair[1], PointerType<VolatileType<TypePair[0]>, GenericAS>, TypePair[2]]>;
- }
- }
-+ }
-+}
-+
-+let Versions = [CL30] in {
-+ foreach AS = [GlobalAS, LocalAS] in {
-+ foreach TypePair = [[AtomicInt, Int], [AtomicUInt, UInt],
-+ [AtomicLong, Long], [AtomicULong, ULong],
-+ [AtomicFloat, Float], [AtomicDouble, Double]] in {
-+ def : Builtin<"atomic_init",
-+ [Void, PointerType<VolatileType<TypePair[0]>, AS>, TypePair[1]]>;
-+ }
-+ }
-+}
-+
-+let Versions = [CL30] in {
-+ let Extension = FuncNonExplicitAtomicFeatures in {
-+ foreach AS = [GlobalAS, LocalAS] in {
-+ foreach TypePair = [[AtomicInt, Int], [AtomicUInt, UInt],
-+ [AtomicLong, Long], [AtomicULong, ULong],
-+ [AtomicFloat, Float], [AtomicDouble, Double]] in {
-+ def : Builtin<"atomic_store",
-+ [Void, PointerType<VolatileType<TypePair[0]>, AS>, TypePair[1]]>;
-+ def : Builtin<"atomic_load",
-+ [TypePair[1], PointerType<VolatileType<TypePair[0]>, AS>]>;
-+ def : Builtin<"atomic_exchange",
-+ [TypePair[1], PointerType<VolatileType<TypePair[0]>, AS>, TypePair[1]]>;
-+ foreach Variant = ["weak", "strong"] in {
-+ def : Builtin<"atomic_compare_exchange_" # Variant,
-+ [Bool, PointerType<VolatileType<TypePair[0]>, AS>,
-+ PointerType<TypePair[1], AS>, TypePair[1]]>;
-+ }
-+ }
-+
-+ foreach TypePair = [[AtomicInt, Int, Int], [AtomicUInt, UInt, UInt],
-+ [AtomicLong, Long, Long], [AtomicULong, ULong, ULong],
-+ [AtomicIntPtr, IntPtr, PtrDiff],
-+ [AtomicUIntPtr, UIntPtr, PtrDiff]] in {
-+ foreach ModOp = ["add", "sub"] in {
-+ def : Builtin<"atomic_fetch_" # ModOp,
-+ [TypePair[1], PointerType<VolatileType<TypePair[0]>, AS>, TypePair[2]]>;
-+ }
-+ }
-+ foreach TypePair = [[AtomicInt, Int, Int], [AtomicUInt, UInt, UInt],
-+ [AtomicLong, Long, Long], [AtomicULong, ULong, ULong],
-+ [AtomicIntPtr, IntPtr, IntPtr],
-+ [AtomicUIntPtr, UIntPtr, UIntPtr]] in {
-+ foreach ModOp = ["or", "xor", "and", "min", "max"] in {
-+ def : Builtin<"atomic_fetch_" # ModOp,
-+ [TypePair[1], PointerType<VolatileType<TypePair[0]>, AS>, TypePair[2]]>;
-+ }
-+ }
-+ }
-+ }
- }
-
- //--------------------------------------------------------------------
-@@ -1217,7 +1297,8 @@ foreach aQual = ["WO", "RW"] in {
- //--------------------------------------------------------------------
- // OpenCL v2.0 s6.13.15 - Work-group Functions
- // --- Table 26 ---
--let MinVersion = CL20 in {
-+let Versions = [CL20, CL30] in {
-+ let Extension = FuncExtWorkGroupCollective in {
- foreach name = ["work_group_all", "work_group_any"] in {
- def : Builtin<name, [Int, Int], Attr.Convergent>;
- }
-@@ -1232,6 +1313,7 @@ let MinVersion = CL20 in {
- def : Builtin<name # op, [IntLongFloatGenType1, IntLongFloatGenType1], Attr.Convergent>;
- }
- }
-+ }
- }
-
-
-@@ -1241,8 +1323,10 @@ let MinVersion = CL20 in {
- // Defined in Builtins.def
-
- // --- Table 28 ---
--// Builtins taking pipe arguments are defined in Builtins.def
--def : Builtin<"is_valid_reserve_id", [Bool, ReserveId]>;
-+let Extension = FuncExtPipes in {
-+ // Builtins taking pipe arguments are defined in Builtins.def
-+ def : Builtin<"is_valid_reserve_id", [Bool, ReserveId]>;
-+}
-
- // --- Table 29 ---
- // Defined in Builtins.def
-@@ -1257,21 +1341,22 @@ def : Builtin<"is_valid_reserve_id", [Bool, ReserveId]>;
- // Defined in Builtins.def
-
- // --- Table 33 ---
--def : Builtin<"enqueue_marker",
-- [Int, Queue, UInt, PointerType<ConstType<ClkEvent>, GenericAS>, PointerType<ClkEvent, GenericAS>]>;
-+let Extension = FuncExtDeviceSidEenqueue in {
-+ def : Builtin<"enqueue_marker",
-+ [Int, Queue, UInt, PointerType<ConstType<ClkEvent>, GenericAS>, PointerType<ClkEvent, GenericAS>]>;
-
--// --- Table 34 ---
--def : Builtin<"retain_event", [Void, ClkEvent]>;
--def : Builtin<"release_event", [Void, ClkEvent]>;
--def : Builtin<"create_user_event", [ClkEvent]>;
--def : Builtin<"is_valid_event", [Bool, ClkEvent]>;
--def : Builtin<"set_user_event_status", [Void, ClkEvent, Int]>;
--// TODO: capture_event_profiling_info
--
--// --- Table 35 ---
--def : Builtin<"get_default_queue", [Queue]>;
--// TODO: ndrange functions
-+ // --- Table 34 ---
-+ def : Builtin<"retain_event", [Void, ClkEvent]>;
-+ def : Builtin<"release_event", [Void, ClkEvent]>;
-+ def : Builtin<"create_user_event", [ClkEvent]>;
-+ def : Builtin<"is_valid_event", [Bool, ClkEvent]>;
-+ def : Builtin<"set_user_event_status", [Void, ClkEvent, Int]>;
-+ // TODO: capture_event_profiling_info
-
-+ // --- Table 35 ---
-+ def : Builtin<"get_default_queue", [Queue]>;
-+ // TODO: ndrange functions
-+}
-
- //--------------------------------------------------------------------
- // End of the builtin functions defined in the OpenCL C specification.
-@@ -1456,7 +1541,7 @@ let Extension = FuncExtKhrSubgroups in {
- "get_sub_group_local_id"] in {
- def : Builtin<name, [UInt]>;
- }
-- let MinVersion = CL20 in {
-+ let Versions = [CL20] in {
- foreach name = ["get_enqueued_num_sub_groups"] in {
- def : Builtin<name, [UInt]>;
- }
-diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
-index 2f2b52106f3d..5092a4691b9b 100644
---- a/clang/lib/Sema/Sema.cpp
-+++ b/clang/lib/Sema/Sema.cpp
-@@ -291,9 +291,10 @@ void Sema::Initialize() {
- // Initialize predefined OpenCL types and supported extensions and (optional)
- // core features.
- if (getLangOpts().OpenCL) {
-+ getOpenCLOptions().setOpenCLVersion(getLangOpts());
- getOpenCLOptions().addSupport(
- Context.getTargetInfo().getSupportedOpenCLOpts());
-- getOpenCLOptions().enableSupportedCore(getLangOpts());
-+ getOpenCLOptions().enableSupportedCore();
- addImplicitTypedef("sampler_t", Context.OCLSamplerTy);
- addImplicitTypedef("event_t", Context.OCLEventTy);
- if (getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) {
-@@ -349,12 +350,18 @@ void Sema::Initialize() {
- "cl_khr_int64_base_atomics cl_khr_int64_extended_atomics");
-
- setOpenCLExtensionForType(AtomicDoubleT, "cl_khr_fp64");
-+ setOpenCLExtensionForType(Context.OCLReserveIDTy, "__opencl_c_pipes");
-+ setOpenCLExtensionForType(Context.OCLClkEventTy,
-+ "__opencl_c_device_enqueue");
-+ setOpenCLExtensionForType(Context.OCLQueueTy,
-+ "__opencl_c_device_enqueue");
- }
-
- setOpenCLExtensionForType(Context.DoubleTy, "cl_khr_fp64");
-
--#define GENERIC_IMAGE_TYPE_EXT(Type, Id, Ext) \
-- setOpenCLExtensionForType(Context.Id, Ext);
-+#define GENERIC_IMAGE_TYPE_EXT(Type, Id, Ext) \
-+ setOpenCLExtensionForType(Context.Id, Ext); \
-+ setOpenCLExtensionForType(Context.Id, "__opencl_c_images");
- #include "clang/Basic/OpenCLImageTypes.def"
- #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
- addImplicitTypedef(#ExtType, Context.Id##Ty); \
-@@ -2423,6 +2430,27 @@ bool Sema::isOpenCLDisabledDecl(Decl *FD) {
- return false;
- }
-
-+template <typename DiagLocT, typename DiagInfoT>
-+void Sema::DiagnoseOpenCLRequiresOption(llvm::StringRef OpenCLOptName,
-+ DiagLocT DiagLoc, DiagInfoT DiagInfo,
-+ unsigned Selector,
-+ SourceRange SrcRange) {
-+ const auto &LO = getLangOpts();
-+ auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
-+ // For versions higher that 3.0 diagnosing feature
-+ if (CLVer >= 300) {
-+ OpenCLOptName =
-+ llvm::StringSwitch<llvm::StringRef>(OpenCLOptName)
-+ .Case("cl_khr_3d_image_writes", "__opencl_c_3d_image_writes")
-+ .Case("cl_khr_subgroups", "__opencl_c_subgroups")
-+ .Case("cl_khr_fp64", "__opencl_c_fp64")
-+ .Default(OpenCLOptName);
-+ }
-+
-+ Diag(DiagLoc, diag::err_opencl_requires_extension)
-+ << Selector << DiagInfo << OpenCLOptName << SrcRange;
-+}
-+
- template <typename T, typename DiagLocT, typename DiagInfoT, typename MapT>
- bool Sema::checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc,
- DiagInfoT DiagInfo, MapT &Map,
-@@ -2434,8 +2462,7 @@ bool Sema::checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc,
- bool Disabled = false;
- for (auto &I : Loc->second) {
- if (I != CurrOpenCLExtension && !getOpenCLOptions().isEnabled(I)) {
-- Diag(DiagLoc, diag::err_opencl_requires_extension) << Selector << DiagInfo
-- << I << SrcRange;
-+ DiagnoseOpenCLRequiresOption(I, DiagLoc, DiagInfo, Selector, SrcRange);
- Disabled = true;
- }
- }
-@@ -2471,3 +2498,13 @@ bool Sema::checkOpenCLDisabledDecl(const NamedDecl &D, const Expr &E) {
- return checkOpenCLDisabledTypeOrDecl(&D, E.getBeginLoc(), FnName,
- OpenCLDeclExtMap, 1, D.getSourceRange());
- }
-+
-+bool Sema::checkOpenCLSubgroupExtForCallExpr(CallExpr *Call) {
-+ if (!getOpenCLOptions().isEnabled("cl_khr_subgroups")) {
-+ DiagnoseOpenCLRequiresOption("cl_khr_subgroups", Call->getBeginLoc(),
-+ Call->getDirectCallee(), 1,
-+ Call->getSourceRange());
-+ return true;
-+ }
-+ return false;
-+}
-diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
-index 1bf04d9cb4f2..9dd63db0f420 100644
---- a/clang/lib/Sema/SemaChecking.cpp
-+++ b/clang/lib/Sema/SemaChecking.cpp
-@@ -835,20 +835,11 @@ static bool checkOpenCLBlockArgs(Sema &S, Expr *BlockArg) {
- return IllegalParams;
- }
-
--static bool checkOpenCLSubgroupExt(Sema &S, CallExpr *Call) {
-- if (!S.getOpenCLOptions().isEnabled("cl_khr_subgroups")) {
-- S.Diag(Call->getBeginLoc(), diag::err_opencl_requires_extension)
-- << 1 << Call->getDirectCallee() << "cl_khr_subgroups";
-- return true;
-- }
-- return false;
--}
--
- static bool SemaOpenCLBuiltinNDRangeAndBlock(Sema &S, CallExpr *TheCall) {
- if (checkArgCount(S, TheCall, 2))
- return true;
-
-- if (checkOpenCLSubgroupExt(S, TheCall))
-+ if (S.checkOpenCLSubgroupExtForCallExpr(TheCall))
- return true;
-
- // First argument is an ndrange_t type.
-@@ -1883,7 +1874,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
- break;
- case Builtin::BIsub_group_reserve_read_pipe:
- case Builtin::BIsub_group_reserve_write_pipe:
-- if (checkOpenCLSubgroupExt(*this, TheCall) ||
-+ if (checkOpenCLSubgroupExtForCallExpr(TheCall) ||
- SemaBuiltinReserveRWPipe(*this, TheCall))
- return ExprError();
- break;
-@@ -1896,7 +1887,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
- break;
- case Builtin::BIsub_group_commit_read_pipe:
- case Builtin::BIsub_group_commit_write_pipe:
-- if (checkOpenCLSubgroupExt(*this, TheCall) ||
-+ if (checkOpenCLSubgroupExtForCallExpr(TheCall) ||
- SemaBuiltinCommitRWPipe(*this, TheCall))
- return ExprError();
- break;
-@@ -4149,6 +4140,20 @@ DiagnoseCStringFormatDirectiveInCFAPI(Sema &S,
- }
- }
-
-+bool Sema::isSupportedOpenCLOMemoryOrdering(int64_t Ordering) const {
-+ assert(llvm::isValidAtomicOrderingCABI(Ordering));
-+ auto OrderingCABI = (llvm::AtomicOrderingCABI)Ordering;
-+ switch (OrderingCABI) {
-+ case llvm::AtomicOrderingCABI::acquire:
-+ case llvm::AtomicOrderingCABI::release:
-+ case llvm::AtomicOrderingCABI::acq_rel:
-+ return OpenCLFeatures.isEnabled("__opencl_c_atomic_order_acq_rel");
-+
-+ default:
-+ return true;
-+ }
-+}
-+
- /// Determine whether the given type has a non-null nullability annotation.
- static bool isNonNullType(ASTContext &ctx, QualType type) {
- if (auto nullability = type->getNullability(ctx))
-@@ -4920,10 +4925,17 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
- if (SubExprs.size() >= 2 && Form != Init) {
- llvm::APSInt Result(32);
- if (SubExprs[1]->isIntegerConstantExpr(Result, Context) &&
-- !isValidOrderingForOp(Result.getSExtValue(), Op))
-+ !isValidOrderingForOp(Result.getSExtValue(), Op)) {
- Diag(SubExprs[1]->getBeginLoc(),
- diag::warn_atomic_op_has_invalid_memory_order)
- << SubExprs[1]->getSourceRange();
-+ } else if (IsOpenCL &&
-+ !isSupportedOpenCLOMemoryOrdering(Result.getSExtValue())) {
-+ Diag(SubExprs[1]->getBeginLoc(),
-+ diag::err_opencl_memory_ordering_require_feat)
-+ << SubExprs[1]->getSourceRange();
-+ return ExprError();
-+ }
- }
-
- if (auto ScopeModel = AtomicExpr::getScopeModel(Op)) {
-diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
-index 5b0417fa8859..2dee60763d57 100644
---- a/clang/lib/Sema/SemaDecl.cpp
-+++ b/clang/lib/Sema/SemaDecl.cpp
-@@ -6290,7 +6290,9 @@ void Sema::deduceOpenCLAddressSpace(ValueDecl *Decl) {
- if (Type->isSamplerT() || Type->isVoidType())
- return;
- LangAS ImplAS = LangAS::opencl_private;
-- if ((getLangOpts().OpenCLCPlusPlus || getLangOpts().OpenCLVersion >= 200) &&
-+ if ((getLangOpts().OpenCLCPlusPlus ||
-+ getOpenCLOptions().isEnabled(
-+ "__opencl_c_program_scope_global_variables")) &&
- Var->hasGlobalStorage())
- ImplAS = LangAS::opencl_global;
- // If the original type from a decayed type is an array type and that array
-@@ -7849,18 +7851,22 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
- // OpenCL C v2.0 s6.5.1 - Variables defined at program scope and static
- // variables inside a function can also be declared in the global
- // address space.
-+ // OpenCL C v3.0 s5.5 - For OpenCL C 2.0, or with the
-+ // __opencl_c_program_scope_global_variables feature macro, the
-+ // address space for a variable at program scope or a static variable
-+ // also be __global
- // C++ for OpenCL inherits rule from OpenCL C v2.0.
- // FIXME: Adding local AS in C++ for OpenCL might make sense.
- if (NewVD->isFileVarDecl() || NewVD->isStaticLocal() ||
- NewVD->hasExternalStorage()) {
-- if (!T->isSamplerT() &&
-- !T->isDependentType() &&
-+ if (!T->isSamplerT() && !T->isDependentType() &&
- !(T.getAddressSpace() == LangAS::opencl_constant ||
- (T.getAddressSpace() == LangAS::opencl_global &&
-- (getLangOpts().OpenCLVersion == 200 ||
-- getLangOpts().OpenCLCPlusPlus)))) {
-+ (OpenCLFeatures.isEnabled(
-+ "__opencl_c_program_scope_global_variables"))))) {
- int Scope = NewVD->isStaticLocal() | NewVD->hasExternalStorage() << 1;
-- if (getLangOpts().OpenCLVersion == 200 || getLangOpts().OpenCLCPlusPlus)
-+ if (OpenCLFeatures.isEnabled(
-+ "__opencl_c_program_scope_global_variables"))
- Diag(NewVD->getLocation(), diag::err_opencl_global_invalid_addr_space)
- << Scope << "global or constant";
- else
-diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
-index a9a2a19b4797..73b35eae176a 100644
---- a/clang/lib/Sema/SemaDeclAttr.cpp
-+++ b/clang/lib/Sema/SemaDeclAttr.cpp
-@@ -6488,7 +6488,7 @@ static void handleInternalLinkageAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
- }
-
- static void handleOpenCLNoSVMAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
-- if (S.LangOpts.OpenCLVersion != 200)
-+ if (S.LangOpts.OpenCLVersion < 200)
- S.Diag(AL.getLoc(), diag::err_attribute_requires_opencl_version)
- << AL << "2.0" << 0;
- else
-@@ -6572,6 +6572,13 @@ static void handleOpenCLAccessAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
- << AL << PDecl->getType() << DeclTy->isImageType();
- D->setInvalidDecl(true);
- return;
-+ } else if ((!S.getLangOpts().OpenCLCPlusPlus &&
-+ S.getLangOpts().OpenCLVersion >= 200) &&
-+ !S.getOpenCLOptions().isEnabled(
-+ "__opencl_c_read_write_images")) {
-+ S.Diag(AL.getLoc(), diag::err_opencl_requires_extension)
-+ << 0 << PDecl->getType() << "__opencl_c_read_write_images";
-+ return;
- }
- }
- }
-diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
-index 22bf35dbd0cb..b2081bb6b407 100644
---- a/clang/lib/Sema/SemaDeclCXX.cpp
-+++ b/clang/lib/Sema/SemaDeclCXX.cpp
-@@ -38,9 +38,9 @@
- #include "clang/Sema/ScopeInfo.h"
- #include "clang/Sema/SemaInternal.h"
- #include "clang/Sema/Template.h"
-+#include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/ScopeExit.h"
- #include "llvm/ADT/SmallString.h"
--#include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/StringExtras.h"
- #include <map>
- #include <set>
-@@ -15228,6 +15228,11 @@ CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
- if (auto *PtrTy = ResultType->getAs<PointerType>()) {
- ResultType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy);
- }
-+ if (CanQual<PointerType> ExpectedPtrTy =
-+ ExpectedResultType->getAs<PointerType>()) {
-+ ExpectedResultType = SemaRef.Context.getCanonicalType(
-+ RemoveAddressSpaceFromPtr(SemaRef, ExpectedPtrTy->getTypePtr()));
-+ }
- }
-
- // Check that the result type is what we expect.
-@@ -15261,6 +15266,11 @@ CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
- FnDecl->getParamDecl(0)->getType()->getAs<PointerType>()) {
- FirstParamType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy);
- }
-+ if (CanQual<PointerType> ExpectedPtrTy =
-+ ExpectedFirstParamType->getAs<PointerType>()) {
-+ ExpectedFirstParamType = SemaRef.Context.getCanonicalType(
-+ RemoveAddressSpaceFromPtr(SemaRef, ExpectedPtrTy->getTypePtr()));
-+ }
- }
-
- // Check that the first parameter type is what we expect.
-diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
-index bcbecd545398..40eaebbc9495 100644
---- a/clang/lib/Sema/SemaLookup.cpp
-+++ b/clang/lib/Sema/SemaLookup.cpp
-@@ -775,19 +775,20 @@ static void InsertOCLBuiltinDeclarationsFromTable(Sema &S, LookupResult &LR,
- // as argument. Only meaningful for generic types, otherwise equals 1.
- unsigned GenTypeMaxCnt;
-
-+ ASTContext &Context = S.Context;
-+
-+ // Ignore this BIF if its version does not match the language options.
-+ unsigned OpenCLVersion = Context.getLangOpts().OpenCLVersion;
-+ if (Context.getLangOpts().OpenCLCPlusPlus)
-+ OpenCLVersion = 200;
-+
-+ unsigned short VersionCode = OpenCLOptions::EncodeVersion(OpenCLVersion);
-+
- for (unsigned SignatureIndex = 0; SignatureIndex < Len; SignatureIndex++) {
- const OpenCLBuiltinStruct &OpenCLBuiltin =
- BuiltinTable[FctIndex + SignatureIndex];
-- ASTContext &Context = S.Context;
-
-- // Ignore this BIF if its version does not match the language options.
-- unsigned OpenCLVersion = Context.getLangOpts().OpenCLVersion;
-- if (Context.getLangOpts().OpenCLCPlusPlus)
-- OpenCLVersion = 200;
-- if (OpenCLVersion < OpenCLBuiltin.MinVersion)
-- continue;
-- if ((OpenCLBuiltin.MaxVersion != 0) &&
-- (OpenCLVersion >= OpenCLBuiltin.MaxVersion))
-+ if (!(OpenCLBuiltin.AllVersions & VersionCode))
- continue;
-
- SmallVector<QualType, 1> RetTypes;
-diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
-index cc151a048b98..f380a5656a57 100644
---- a/clang/lib/Sema/SemaType.cpp
-+++ b/clang/lib/Sema/SemaType.cpp
-@@ -2042,7 +2042,7 @@ static QualType deduceOpenCLPointeeAddrSpace(Sema &S, QualType PointeeType) {
- !PointeeType.hasAddressSpace())
- PointeeType = S.getASTContext().getAddrSpaceQualType(
- PointeeType,
-- S.getLangOpts().OpenCLCPlusPlus || S.getLangOpts().OpenCLVersion == 200
-+ S.getOpenCLOptions().isEnabled("__opencl_c_generic_address_space")
- ? LangAS::opencl_generic
- : LangAS::opencl_private);
- return PointeeType;
-@@ -5316,9 +5316,15 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
- }
-
- case DeclaratorChunk::Pipe: {
-- T = S.BuildReadPipeType(T, DeclType.Loc);
-- processTypeAttrs(state, T, TAL_DeclSpec,
-- D.getMutableDeclSpec().getAttributes());
-+ if (S.getOpenCLOptions().isEnabled("__opencl_c_pipes")) {
-+ T = S.BuildReadPipeType(T, DeclType.Loc);
-+ processTypeAttrs(state, T, TAL_DeclSpec,
-+ D.getMutableDeclSpec().getAttributes());
-+ } else {
-+ D.setInvalidType(true);
-+ T = Context.IntTy;
-+ S.Diag(D.getIdentifierLoc(), diag::err_opencl_pipes_require_feat);
-+ }
- break;
- }
- }
-diff --git a/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl b/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-index e1f3f6fe1419..b43d9df5935c 100644
---- a/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-+++ b/clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
-@@ -2,7 +2,8 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -O0 -triple amdgcn | FileCheck -enable-var-scope -check-prefixes=ALL,AMDGCN %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL2.0 -O0 -triple amdgcn | FileCheck -enable-var-scope -check-prefixes=ALL,AMDGCN,AMDGCN20 %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
--
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -cl-ext=__opencl_c_program_scope_global_variables -O0 -triple spir-unknown-unknown-unknown | FileCheck -enable-var-scope -check-prefixes=SPIR %s
- typedef int int2 __attribute__((ext_vector_type(2)));
-
- typedef struct {
-@@ -39,7 +40,7 @@ struct LargeStructTwoMember {
- int2 y[20];
- };
-
--#if __OPENCL_C_VERSION__ >= 200
-+#ifdef __opencl_c_program_scope_global_variables
- struct LargeStructOneMember g_s;
- #endif
-
-@@ -98,7 +99,7 @@ void FuncOneLargeMember(struct LargeStructOneMember u) {
- // AMDGCN20: %[[r0:.*]] = bitcast %struct.LargeStructOneMember addrspace(5)* %[[byval_temp]] to i8 addrspace(5)*
- // AMDGCN20: call void @llvm.memcpy.p5i8.p1i8.i64(i8 addrspace(5)* align 8 %[[r0]], i8 addrspace(1)* align 8 bitcast (%struct.LargeStructOneMember addrspace(1)* @g_s to i8 addrspace(1)*), i64 800, i1 false)
- // AMDGCN20: call void @FuncOneLargeMember(%struct.LargeStructOneMember addrspace(5)* byval(%struct.LargeStructOneMember) align 8 %[[byval_temp]])
--#if __OPENCL_C_VERSION__ >= 200
-+#ifdef __opencl_c_program_scope_global_variables
- void test_indirect_arg_globl(void) {
- FuncOneLargeMember(g_s);
- }
-diff --git a/clang/test/CodeGenOpenCL/address-spaces-conversions.cl b/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-index 52feccc540bb..9ecffcca5ee9 100644
---- a/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces-conversions.cl
-@@ -1,5 +1,7 @@
- // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -ffake-address-space-map -cl-std=CL2.0 -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -ffake-address-space-map -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -cl-std=CL2.0 -emit-llvm -o - | FileCheck --check-prefix=CHECK-NOFAKE %s
-+// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -emit-llvm -o - | FileCheck --check-prefix=CHECK-NOFAKE %s
- // When -ffake-address-space-map is not used, all addr space mapped to 0 for x86_64.
-
- // test that we generate address space casts everywhere we need conversions of
-diff --git a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-index 50622f099143..e19ec8451d0d 100644
---- a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
-@@ -6,6 +6,7 @@
- // We check that the address spaces are mangled the same in both version of OpenCL
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s
-
- // We can't name this f as private is equivalent to default
- // no specifier given address space so we get multiple definition
-@@ -47,7 +48,7 @@ void f(constant int *arg) { }
- // OCL-20-DAG: @_Z1fPU3AS2i
- // OCL-12-DAG: @_Z1fPU3AS2i
-
--#if __OPENCL_C_VERSION__ >= 200
-+#if __OPENCL_C_VERSION__ == 200
- __attribute__((overloadable))
- void f(generic int *arg) { }
- // ASMANG20: @_Z1fPU3AS4i
-diff --git a/clang/test/CodeGenOpenCL/address-spaces.cl b/clang/test/CodeGenOpenCL/address-spaces.cl
-index 144466a690b3..b150e1080b53 100644
---- a/clang/test/CodeGenOpenCL/address-spaces.cl
-+++ b/clang/test/CodeGenOpenCL/address-spaces.cl
-@@ -1,9 +1,13 @@
- // RUN: %clang_cc1 %s -O0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,SPIR
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,SPIR
- // RUN: %clang_cc1 %s -O0 -DCL20 -cl-std=CL2.0 -ffake-address-space-map -emit-llvm -o - | FileCheck %s --check-prefixes=CL20,CL20SPIR
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-amd-amdhsa -DCL20 -cl-std=CL2.0 -emit-llvm -o - | FileCheck %s --check-prefixes=CL20,CL20AMDGCN
- // RUN: %clang_cc1 %s -O0 -triple amdgcn-mesa-mesa3d -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple amdgcn-mesa-mesa3d -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
- // RUN: %clang_cc1 %s -O0 -triple r600-- -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-+// RUN: %clang_cc1 %s -O0 -cl-std=CL3.0 -triple r600-- -emit-llvm -o - | FileCheck --check-prefixes=CHECK,AMDGCN %s
-
- // SPIR: %struct.S = type { i32, i32, i32* }
- // CL20SPIR: %struct.S = type { i32, i32, i32 addrspace(4)* }
-diff --git a/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl b/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-index 7216cb517495..8d3b30fe8074 100644
---- a/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-+++ b/clang/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 -O0 -cl-std=CL1.2 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL12 %s
-+// RUN: %clang_cc1 -O0 -cl-std=CL3.0 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL12 %s
- // RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn---amdgizcl -emit-llvm %s -o - | FileCheck -check-prefixes=CHECK,CL20 %s
-
- // CL12-LABEL: define void @func1(i32 addrspace(5)* %x)
-diff --git a/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl b/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-index a5d438933fa4..8073c7756eb6 100644
---- a/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-+++ b/clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
-@@ -4,6 +4,17 @@
- // RUN: %clang_cc1 -triple amdgcn---opencl -cl-std=CL2.0 %s -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL1.2 %s -emit-llvm -o - | FileCheck %s
- // RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL2.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple r600 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-ext=__opencl_c_generic_address_space -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple r600 -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn-mesa-mesa3d -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---opencl -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-+// RUN: %clang_cc1 -triple amdgcn---amdgizcl -cl-ext=__opencl_c_fp64 -cl-std=CL3.0 %s -emit-llvm -o - | FileCheck %s
-
- #ifdef __AMDGCN__
- #define PTSIZE 8
-@@ -11,7 +22,7 @@
- #define PTSIZE 4
- #endif
-
--#ifdef cl_khr_fp64
-+#if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
- #endif
- #ifdef cl_khr_fp16
-@@ -59,8 +70,12 @@ void test() {
- check(__alignof__(double) == 8);
- #endif
-
-- check(sizeof(void*) == (__OPENCL_C_VERSION__ >= 200 ? 8 : 4));
-- check(__alignof__(void*) == (__OPENCL_C_VERSION__ >= 200 ? 8 : 4));
-+ check(sizeof(private void*) == 4);
-+ check(__alignof__(private void*) == 4);
-+#ifdef __opencl_c_generic_address_space
-+ check(sizeof(generic void*) == 8);
-+ check(__alignof__(generic void*) == 8);
-+#endif
- check(sizeof(global_ptr_t) == PTSIZE);
- check(__alignof__(global_ptr_t) == PTSIZE);
- check(sizeof(constant_ptr_t) == PTSIZE);
-diff --git a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-index d1ab6aceac5c..70c5bace023b 100644
---- a/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-+++ b/clang/test/CodeGenOpenCL/arm-integer-dot-product.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -cl-std=CL1.2 -emit-llvm -o - -O0 | FileCheck %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -finclude-default-header -cl-std=CL3.0 -emit-llvm -o - -O0 | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : enable
- void test_int8(uchar4 ua, uchar4 ub, char4 sa, char4 sb) {
-diff --git a/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl b/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-index 76ace5dca21e..5dc43e222f75 100644
---- a/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-+++ b/clang/test/CodeGenOpenCL/cl-uniform-wg-size.cl
-@@ -1,6 +1,8 @@
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL1.2 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-NONUNIFORM
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -cl-uniform-work-group-size -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-NONUNIFORM
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -cl-uniform-work-group-size -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
-
- kernel void ker() {};
- // CHECK: define{{.*}}@ker() #0
-diff --git a/clang/test/CodeGenOpenCL/fpmath.cl b/clang/test/CodeGenOpenCL/fpmath.cl
-index 0108d909c94e..b28392739c71 100644
---- a/clang/test/CodeGenOpenCL/fpmath.cl
-+++ b/clang/test/CodeGenOpenCL/fpmath.cl
-@@ -2,6 +2,8 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown -cl-fp32-correctly-rounded-divide-sqrt | FileCheck --check-prefix=CHECK --check-prefix=DIVOPT %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -DNOFP64 -cl-std=CL1.2 -triple r600-unknown-unknown -target-cpu r600 -pedantic | FileCheck --check-prefix=CHECK-FLT %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -DFP64 -cl-std=CL1.2 -triple spir-unknown-unknown -pedantic | FileCheck --check-prefix=CHECK-DBL %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -DNOFP64 -cl-std=CL3.0 -triple r600-unknown-unknown -target-cpu r600 -pedantic | FileCheck --check-prefix=CHECK-FLT %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -DFP64 -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -triple spir-unknown-unknown -pedantic | FileCheck --check-prefix=CHECK-DBL %s
-
- typedef __attribute__(( ext_vector_type(4) )) float float4;
-
-diff --git a/clang/test/CodeGenOpenCL/generic-address-space-feature.cl b/clang/test/CodeGenOpenCL/generic-address-space-feature.cl
-new file mode 100644
-index 000000000000..890860abe4d9
---- /dev/null
-+++ b/clang/test/CodeGenOpenCL/generic-address-space-feature.cl
-@@ -0,0 +1,28 @@
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL12
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL12
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL20
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL2.0 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL20
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64 -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL30
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64,__opencl_c_generic_address_space -finclude-default-header -emit-llvm -o - | FileCheck %s --check-prefixes=CL30-GENERIC
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64 -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL30
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -cl-std=CL3.0 -cl-ext=-cl_khr_fp64,__opencl_c_generic_address_space -fdeclare-opencl-builtins -emit-llvm -o - | FileCheck %s --check-prefixes=CL30-GENERIC
-+
-+void test(global float* src1, local float *src2, private float *src3, float *src4, float tmp) {
-+ // CL20: %{{.+}} = addrspacecast float addrspace(1)* %{{.+}} to float addrspace(4)*
-+ // CL12-NOT: addrspacecast
-+ // CL30-NOT: addrspacecast
-+ // CL30-GENERIC-NOT: addrspacecast
-+ tmp = sincos(tmp, src1);
-+ // CL20: %{{.+}} = addrspacecast float addrspace(3)* %{{.+}} to float addrspace(4)*
-+ // CL12-NOT: addrspacecast
-+ // CL30-NOT: addrspacecast
-+ // CL30-GENERIC-NOT: addrspacecast
-+ tmp = sincos(tmp, src2);
-+
-+ // CL12: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float* {{.+}})
-+ // CL20: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float addrspace(4)* {{.+}})
-+ // CL30: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float* {{.+}})
-+ // CL30-GENERIC: %{{.+}} = call {{(spir_func )?}}float [[FUNCNAME:@.*sincos.*]](float %{{.+}}, float addrspace(4)* {{.+}})
-+ // CHECK: addrspacecast
-+ tmp = sincos(tmp, src4);
-+}
-diff --git a/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl b/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-index 515f13f6e768..5aa31ac6f345 100644
---- a/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-+++ b/clang/test/CodeGenOpenCL/intel-subgroups-avc-ext-types.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -cl-ext=+cl_intel_device_side_avc_motion_estimation -emit-llvm -o - -O0 | FileCheck %s
-+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL3.0 -cl-ext=+cl_intel_device_side_avc_motion_estimation -emit-llvm -o - -O0 | FileCheck %s
-
- // CHECK: %opencl.intel_sub_group_avc_mce_payload_t = type opaque
- // CHECK: %opencl.intel_sub_group_avc_ime_payload_t = type opaque
-diff --git a/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl b/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-index e89237623478..3d6708ac361f 100644
---- a/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-+++ b/clang/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl
-@@ -1,5 +1,8 @@
- // RUN: %clang_cc1 %s -cl-std=CL1.2 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=CL1.2 -emit-llvm -triple amdgcn-unknown-unknown -o - | FileCheck -check-prefixes=AMDGCN %s
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -triple amdgcn-unknown-unknown -o - | FileCheck -check-prefixes=AMDGCN %s
-+
- // Test that the kernels always use the SPIR calling convention
- // to have unambiguous mapping of arguments to feasibly implement
- // clSetKernelArg().
-diff --git a/clang/test/CodeGenOpenCL/logical-ops.cl b/clang/test/CodeGenOpenCL/logical-ops.cl
-index f083a8580ee7..499eab65039b 100644
---- a/clang/test/CodeGenOpenCL/logical-ops.cl
-+++ b/clang/test/CodeGenOpenCL/logical-ops.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
-+// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL3.0 -cl-ext=__opencl_c_fp64 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
- // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=clc++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_khr_fp64 : enable
-diff --git a/clang/test/CodeGenOpenCL/no-half.cl b/clang/test/CodeGenOpenCL/no-half.cl
-index aee8f678f01a..46da7fa339e8 100644
---- a/clang/test/CodeGenOpenCL/no-half.cl
-+++ b/clang/test/CodeGenOpenCL/no-half.cl
-@@ -1,6 +1,7 @@
- // RUN: %clang_cc1 %s -cl-std=cl2.0 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=cl1.2 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
- // RUN: %clang_cc1 %s -cl-std=cl1.1 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
-+// RUN: %clang_cc1 %s -cl-std=cl3.0 -cl-ext=__opencl_c_fp64 -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
-
- #pragma OPENCL EXTENSION cl_khr_fp64:enable
-
-diff --git a/clang/test/CodeGenOpenCL/pipe_builtin.cl b/clang/test/CodeGenOpenCL/pipe_builtin.cl
-index 02b9669b7ab1..0bf35c336199 100644
---- a/clang/test/CodeGenOpenCL/pipe_builtin.cl
-+++ b/clang/test/CodeGenOpenCL/pipe_builtin.cl
-@@ -1,4 +1,7 @@
- // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=cl2.0 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=cl3.0 -cl-ext=__opencl_c_pipes,__opencl_c_subgroups -o - %s | FileCheck %s
-+
- // FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple
- // above to support OpenCL in the MS C++ ABI.
-
-diff --git a/clang/test/CodeGenOpenCL/pipe_types.cl b/clang/test/CodeGenOpenCL/pipe_types.cl
-index ba064c6d7557..b7a523d4f084 100644
---- a/clang/test/CodeGenOpenCL/pipe_types.cl
-+++ b/clang/test/CodeGenOpenCL/pipe_types.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -o - %s | FileCheck %s
-
- // CHECK: %opencl.pipe_ro_t = type opaque
- // CHECK: %opencl.pipe_wo_t = type opaque
-diff --git a/clang/test/CodeGenOpenCL/printf.cl b/clang/test/CodeGenOpenCL/printf.cl
-index fc139d776db6..0133c5595d81 100644
---- a/clang/test/CodeGenOpenCL/printf.cl
-+++ b/clang/test/CodeGenOpenCL/printf.cl
-@@ -1,5 +1,7 @@
- // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-+cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
- // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
-
- typedef __attribute__((ext_vector_type(2))) float float2;
- typedef __attribute__((ext_vector_type(2))) half half2;
-diff --git a/clang/test/CodeGenOpenCL/unroll-hint.cl b/clang/test/CodeGenOpenCL/unroll-hint.cl
-index 0f84450a1ae6..9347c935869b 100644
---- a/clang/test/CodeGenOpenCL/unroll-hint.cl
-+++ b/clang/test/CodeGenOpenCL/unroll-hint.cl
-@@ -1,5 +1,6 @@
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s
- // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL1.2 -o - %s | FileCheck %s
-+// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL3.0 -o - %s | FileCheck %s
-
- /*** for ***/
- void for_count()
-diff --git a/clang/test/Driver/autocomplete.c b/clang/test/Driver/autocomplete.c
-index 18b31320ea80..a6e7be887c8c 100644
---- a/clang/test/Driver/autocomplete.c
-+++ b/clang/test/Driver/autocomplete.c
-@@ -43,6 +43,8 @@
- // CLSTDALL-NEXT: CL1.2
- // CLSTDALL-NEXT: cl2.0
- // CLSTDALL-NEXT: CL2.0
-+// CLSTDALL-NEXT: cl3.0
-+// CLSTDALL-NEXT: CL3.0
- // CLSTDALL-NEXT: clc++
- // CLSTDALL-NEXT: CLC++
- // RUN: %clang --autocomplete=-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER
-diff --git a/clang/test/Driver/opencl.cl b/clang/test/Driver/opencl.cl
-index 05588f2c8b81..cc0a9143ab37 100644
---- a/clang/test/Driver/opencl.cl
-+++ b/clang/test/Driver/opencl.cl
-@@ -2,6 +2,7 @@
- // RUN: %clang -S -### -cl-std=CL1.1 %s 2>&1 | FileCheck --check-prefix=CHECK-CL11 %s
- // RUN: %clang -S -### -cl-std=CL1.2 %s 2>&1 | FileCheck --check-prefix=CHECK-CL12 %s
- // RUN: %clang -S -### -cl-std=CL2.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL20 %s
-+// RUN: %clang -S -### -cl-std=CL3.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL30 %s
- // RUN: %clang -S -### -cl-std=clc++ %s 2>&1 | FileCheck --check-prefix=CHECK-CLCPP %s
- // RUN: %clang -S -### -cl-opt-disable %s 2>&1 | FileCheck --check-prefix=CHECK-OPT-DISABLE %s
- // RUN: %clang -S -### -cl-strict-aliasing %s 2>&1 | FileCheck --check-prefix=CHECK-STRICT-ALIASING %s
-@@ -22,6 +23,7 @@
- // CHECK-CL11: "-cc1" {{.*}} "-cl-std=CL1.1"
- // CHECK-CL12: "-cc1" {{.*}} "-cl-std=CL1.2"
- // CHECK-CL20: "-cc1" {{.*}} "-cl-std=CL2.0"
-+// CHECK-CL30: "-cc1" {{.*}} "-cl-std=CL3.0"
- // CHECK-CLCPP: "-cc1" {{.*}} "-cl-std=clc++"
- // CHECK-OPT-DISABLE: "-cc1" {{.*}} "-cl-opt-disable"
- // CHECK-STRICT-ALIASING: "-cc1" {{.*}} "-cl-strict-aliasing"
-diff --git a/clang/test/Driver/unknown-std.cl b/clang/test/Driver/unknown-std.cl
-index 6f371bac13ac..00209fb62556 100644
---- a/clang/test/Driver/unknown-std.cl
-+++ b/clang/test/Driver/unknown-std.cl
-@@ -10,6 +10,7 @@
- // CHECK-NEXT: note: use 'cl1.1' for 'OpenCL 1.1' standard
- // CHECK-NEXT: note: use 'cl1.2' for 'OpenCL 1.2' standard
- // CHECK-NEXT: note: use 'cl2.0' for 'OpenCL 2.0' standard
-+// CHECK-NEXT: note: use 'cl3.0' for 'OpenCL 3.0' standard
- // CHECK-NEXT: note: use 'clc++' for 'C++ for OpenCL' standard
-
- // Make sure that no other output is present.
-diff --git a/clang/test/Frontend/stdlang.c b/clang/test/Frontend/stdlang.c
-index 51484999e37a..eac4632fbdd6 100644
---- a/clang/test/Frontend/stdlang.c
-+++ b/clang/test/Frontend/stdlang.c
-@@ -9,6 +9,7 @@
- // RUN: %clang_cc1 -x cl -cl-std=CL1.1 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CL1.2 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CL2.0 -DOPENCL %s
-+// RUN: %clang_cc1 -x cl -cl-std=CL3.0 -DOPENCL %s
- // RUN: %clang_cc1 -x cl -cl-std=CLC++ -DOPENCL %s
- // RUN: not %clang_cc1 -x cl -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
- // RUN: not %clang_cc1 -x cl -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
-diff --git a/clang/test/Headers/opencl-c-header.cl b/clang/test/Headers/opencl-c-header.cl
-index 1b151ffdd16a..2716076acdcf 100644
---- a/clang/test/Headers/opencl-c-header.cl
-+++ b/clang/test/Headers/opencl-c-header.cl
-@@ -1,6 +1,7 @@
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1 | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2 | FileCheck %s
-+// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL3.0 | FileCheck %s
- // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=clc++ | FileCheck %s --check-prefix=CHECK20
-
- // Test including the default header as a module.
-@@ -39,9 +40,11 @@
- // RUN: rm -rf %t
- // RUN: mkdir -p %t
- // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
-+// RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL3.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
- // RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s
- // RUN: chmod u-w %t
- // RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL1.2 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
-+// RUN: %clang_cc1 -triple spir64-unknown-unknown -emit-llvm -o - -cl-std=CL3.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MOD %s
- // RUN: %clang_cc1 -triple amdgcn--amdhsa -O0 -emit-llvm -o - -cl-std=CL2.0 -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ftime-report %s 2>&1 | FileCheck --check-prefix=CHECK20 --check-prefix=CHECK-MOD %s
- // RUN: chmod u+w %t
-
-@@ -67,7 +70,7 @@ char f(char x) {
- // from OpenCL 2.0 onwards.
-
- // CHECK20: _Z12write_imagef14ocl_image3d_wo
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
- void test_image3dwo(write_only image3d_t img) {
- write_imagef(img, (0), (0.0f));
- }
-@@ -81,7 +84,7 @@ void test_atomics(__generic volatile unsigned int* a) {
- #endif
-
- // Verify that ATOMIC_VAR_INIT is defined.
--#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
- global atomic_int z = ATOMIC_VAR_INIT(99);
- #endif //__OPENCL_C_VERSION__
-
-diff --git a/clang/test/Index/pipe-size.cl b/clang/test/Index/pipe-size.cl
-index 94a1255f0a48..59b76051eda1 100644
---- a/clang/test/Index/pipe-size.cl
-+++ b/clang/test/Index/pipe-size.cl
-@@ -2,6 +2,13 @@
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple spir-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple spir64-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR64
- // RUN: %clang_cc1 -x cl -O0 -cl-std=CL2.0 -emit-llvm -triple amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefix=AMDGCN
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=X86
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple spir-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple spir64-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIR64
-+// RUN: %clang_cc1 -x cl -O0 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -emit-llvm -triple amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefix=AMDGCN
-+
-+
-+
- __kernel void testPipe( pipe int test )
- {
- int s = sizeof(test);
-diff --git a/clang/test/Preprocessor/init-aarch64.c b/clang/test/Preprocessor/init-aarch64.c
-index df2a6128989b..cbb0995b48b0 100644
---- a/clang/test/Preprocessor/init-aarch64.c
-+++ b/clang/test/Preprocessor/init-aarch64.c
-@@ -109,12 +109,12 @@
- // AARCH64-NEXT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
- // AARCH64_CXX-NEXT: #define __GLIBCXX_BITSIZE_INT_N_0 128
- // AARCH64_CXX-NEXT: #define __GLIBCXX_TYPE_INT_N_0 __int128
--// AARCH64-NEXT: #define __INT16_C_SUFFIX__
-+// AARCH64-NEXT: #define __INT16_C_SUFFIX__
- // AARCH64-NEXT: #define __INT16_FMTd__ "hd"
- // AARCH64-NEXT: #define __INT16_FMTi__ "hi"
- // AARCH64-NEXT: #define __INT16_MAX__ 32767
- // AARCH64-NEXT: #define __INT16_TYPE__ short
--// AARCH64-NEXT: #define __INT32_C_SUFFIX__
-+// AARCH64-NEXT: #define __INT32_C_SUFFIX__
- // AARCH64-NEXT: #define __INT32_FMTd__ "d"
- // AARCH64-NEXT: #define __INT32_FMTi__ "i"
- // AARCH64-NEXT: #define __INT32_MAX__ 2147483647
-@@ -124,7 +124,7 @@
- // AARCH64-NEXT: #define __INT64_FMTi__ "li"
- // AARCH64-NEXT: #define __INT64_MAX__ 9223372036854775807L
- // AARCH64-NEXT: #define __INT64_TYPE__ long int
--// AARCH64-NEXT: #define __INT8_C_SUFFIX__
-+// AARCH64-NEXT: #define __INT8_C_SUFFIX__
- // AARCH64-NEXT: #define __INT8_FMTd__ "hhd"
- // AARCH64-NEXT: #define __INT8_FMTi__ "hhi"
- // AARCH64-NEXT: #define __INT8_MAX__ 127
-@@ -238,7 +238,7 @@
- // AARCH64-NEXT: #define __STDC_UTF_32__ 1
- // AARCH64_C: #define __STDC_VERSION__ 201710L
- // AARCH64-NEXT: #define __STDC__ 1
--// AARCH64-NEXT: #define __UINT16_C_SUFFIX__
-+// AARCH64-NEXT: #define __UINT16_C_SUFFIX__
- // AARCH64-NEXT: #define __UINT16_FMTX__ "hX"
- // AARCH64-NEXT: #define __UINT16_FMTo__ "ho"
- // AARCH64-NEXT: #define __UINT16_FMTu__ "hu"
-@@ -259,7 +259,7 @@
- // AARCH64-NEXT: #define __UINT64_FMTx__ "lx"
- // AARCH64-NEXT: #define __UINT64_MAX__ 18446744073709551615UL
- // AARCH64-NEXT: #define __UINT64_TYPE__ long unsigned int
--// AARCH64-NEXT: #define __UINT8_C_SUFFIX__
-+// AARCH64-NEXT: #define __UINT8_C_SUFFIX__
- // AARCH64-NEXT: #define __UINT8_FMTX__ "hhX"
- // AARCH64-NEXT: #define __UINT8_FMTo__ "hho"
- // AARCH64-NEXT: #define __UINT8_FMTu__ "hhu"
-@@ -329,7 +329,7 @@
- // AARCH64-NEXT: #define __UINT_LEAST8_FMTx__ "hhx"
- // AARCH64-NEXT: #define __UINT_LEAST8_MAX__ 255
- // AARCH64-NEXT: #define __UINT_LEAST8_TYPE__ unsigned char
--// AARCH64-NEXT: #define __USER_LABEL_PREFIX__
-+// AARCH64-NEXT: #define __USER_LABEL_PREFIX__
- // AARCH64-NEXT: #define __VERSION__ "{{.*}}"
- // AARCH64-NEXT: #define __WCHAR_MAX__ 4294967295U
- // AARCH64-NEXT: #define __WCHAR_TYPE__ unsigned int
-diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c
-index 083f0e539d88..6c80517ec4d4 100644
---- a/clang/test/Preprocessor/predefined-macros.c
-+++ b/clang/test/Preprocessor/predefined-macros.c
-@@ -129,6 +129,8 @@
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL12
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL2.0 \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL20
-+// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL3.0 \
-+// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL30
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++ \
-@@ -137,26 +139,37 @@
- // CHECK-CL10: #define CL_VERSION_1_1 110
- // CHECK-CL10: #define CL_VERSION_1_2 120
- // CHECK-CL10: #define CL_VERSION_2_0 200
-+// CHECK-CL10: #define CL_VERSION_3_0 300
- // CHECK-CL10: #define __OPENCL_C_VERSION__ 100
- // CHECK-CL10-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL11: #define CL_VERSION_1_0 100
- // CHECK-CL11: #define CL_VERSION_1_1 110
- // CHECK-CL11: #define CL_VERSION_1_2 120
- // CHECK-CL11: #define CL_VERSION_2_0 200
-+// CHECK-CL11: #define CL_VERSION_3_0 300
- // CHECK-CL11: #define __OPENCL_C_VERSION__ 110
- // CHECK-CL11-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL12: #define CL_VERSION_1_0 100
- // CHECK-CL12: #define CL_VERSION_1_1 110
- // CHECK-CL12: #define CL_VERSION_1_2 120
- // CHECK-CL12: #define CL_VERSION_2_0 200
-+// CHECK-CL12: #define CL_VERSION_3_0 300
- // CHECK-CL12: #define __OPENCL_C_VERSION__ 120
- // CHECK-CL12-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CL20: #define CL_VERSION_1_0 100
- // CHECK-CL20: #define CL_VERSION_1_1 110
- // CHECK-CL20: #define CL_VERSION_1_2 120
- // CHECK-CL20: #define CL_VERSION_2_0 200
-+// CHECK-CL20: #define CL_VERSION_3_0 300
- // CHECK-CL20: #define __OPENCL_C_VERSION__ 200
- // CHECK-CL20-NOT: #define __FAST_RELAXED_MATH__ 1
-+// CHECK-CL30: #define CL_VERSION_1_0 100
-+// CHECK-CL30: #define CL_VERSION_1_1 110
-+// CHECK-CL30: #define CL_VERSION_1_2 120
-+// CHECK-CL30: #define CL_VERSION_2_0 200
-+// CHECK-CL30: #define CL_VERSION_3_0 300
-+// CHECK-CL30: #define __OPENCL_C_VERSION__ 300
-+// CHECK-CL30-NOT: #define __FAST_RELAXED_MATH__ 1
- // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
- // CHECK-CLCPP10: #define __CL_CPP_VERSION_1_0__ 100
- // CHECK-CLCPP10: #define __OPENCL_CPP_VERSION__ 100
-diff --git a/clang/test/Sema/feature-extensions-simult-support.cl b/clang/test/Sema/feature-extensions-simult-support.cl
-new file mode 100644
-index 000000000000..0789105002b2
---- /dev/null
-+++ b/clang/test/Sema/feature-extensions-simult-support.cl
-@@ -0,0 +1,75 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -cl-ext=+cl_khr_subgroups
-+
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_subgroups
-+
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_device_enqueue
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_read_write_images
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64,-cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_3d_image_writes,-cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_subgroups,-cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_3d_image_writes
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+cl_khr_subgroups
-+
-+// expected-no-diagnostics
-+
-+#ifdef cl_khr_fp64
-+ #ifndef __opencl_c_fp64
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_fp64
-+ #ifndef cl_khr_fp64
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#ifdef cl_khr_3d_image_writes
-+ #ifndef __opencl_c_3d_image_writes
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_3d_image_writes
-+ #ifndef cl_khr_3d_image_writes
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#ifdef cl_khr_subgroups
-+ #ifndef __opencl_c_subgroups
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+#ifdef __opencl_c_subgroups
-+ #ifndef cl_khr_subgroups
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#if defined(__opencl_c_pipes) || defined(__opencl_c_device_enqueue)
-+ #ifndef __opencl_c_generic_address_space
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+#if defined(__opencl_c_3d_image_writes) || defined(__opencl_c_read_write_images)
-+ #ifndef __opencl_c_images
-+ #error macros were not properly set up
-+ #endif
-+#endif
-+
-+kernel void test(){}
-diff --git a/clang/test/Sema/features-ignore-pragma.cl b/clang/test/Sema/features-ignore-pragma.cl
-new file mode 100644
-index 000000000000..046ce5390754
---- /dev/null
-+++ b/clang/test/Sema/features-ignore-pragma.cl
-@@ -0,0 +1,24 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_fp64
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_3d_image_writes
-+
-+#pragma OPENCL EXTENSION __opencl_c_fp64 : enable
-+// expected-warning@-1 {{OpenCL feature support can't be controlled via pragma, ignoring}}
-+
-+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-+#ifndef __opencl_c_fp64
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}}
-+#endif
-+
-+#pragma OPENCL EXTENSION cl_khr_subgroups : enable
-+#ifndef __opencl_c_subgroups
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}}
-+#endif
-+
-+#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
-+#ifndef __opencl_c_3d_image_writes
-+// expected-warning@-2{{unsupported OpenCL extension 'cl_khr_3d_image_writes' - ignoring}}
-+#endif
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/opencl-features-pipes.cl b/clang/test/Sema/opencl-features-pipes.cl
-new file mode 100644
-index 000000000000..c0ac778f24a6
---- /dev/null
-+++ b/clang/test/Sema/opencl-features-pipes.cl
-@@ -0,0 +1,18 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.1
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DHAS
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -DHAS
-+// expected-no-diagnostics
-+
-+#ifdef HAS
-+ #ifndef __opencl_c_pipes
-+ #error Feature should be defined
-+ #endif
-+#else
-+ #ifdef __opencl_c_pipes
-+ #error Feature should not be defined
-+ #endif
-+#endif
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/opencl-features.cl b/clang/test/Sema/opencl-features.cl
-new file mode 100644
-index 000000000000..aa432f6b60bf
---- /dev/null
-+++ b/clang/test/Sema/opencl-features.cl
-@@ -0,0 +1,128 @@
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=-__opencl_c_device_enqueue,-__opencl_c_pipes,-__opencl_c_read_write_images
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CLC++
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0
-+// expected-no-diagnostics
-+
-+#ifndef __opencl_c_int64
-+ #error Feature __opencl_c_int64 shouldn't be defined
-+#endif
-+
-+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
-+ #ifndef __opencl_c_3d_image_writes
-+ #error Feature __opencl_c_3d_image_writes should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_order_acq_rel
-+ #error Feature __opencl_c_atomic_order_acq_rel should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_order_seq_cst
-+ #error Feature __opencl_c_atomic_order_seq_cst should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_scope_device
-+ #error Feature __opencl_c_atomic_scope_device should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_atomic_scope_all_devices
-+ #error Feature __opencl_c_atomic_scope_all_devices should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_device_enqueue
-+ #error Feature __opencl_c_device_enqueue should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_generic_address_space
-+ #error Feature __opencl_c_generic_address_space should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_pipes
-+ #error Feature __opencl_c_pipes should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_program_scope_global_variables
-+ #error Feature __opencl_c_program_scope_global_variables should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_read_write_images
-+ #error Feature __opencl_c_read_write_images should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_subgroups
-+ #error Feature __opencl_c_subgroups should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_work_group_collective_functions
-+ #error Feature __opencl_c_work_group_collective_functions should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_fp64
-+ #error Feature __opencl_c_fp64 should be defined
-+ #endif
-+
-+ #ifndef __opencl_c_images
-+ #error Feature __opencl_c_images should be defined
-+ #endif
-+#endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
-+
-+
-+#if __OPENCL_C_VERSION__ == CL_VERSION_3_0
-+ #ifdef __opencl_c_3d_image_writes
-+ #error Feature __opencl_c_3d_image_writes shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_order_acq_rel
-+ #error Feature __opencl_c_atomic_order_acq_rel shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_order_seq_cst
-+ #error Feature __opencl_c_atomic_order_seq_cst shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_scope_device
-+ #error Feature __opencl_c_atomic_scope_device shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_atomic_scope_all_devices
-+ #error Feature __opencl_c_atomic_scope_all_devices shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_device_enqueue
-+ #error Feature __opencl_c_device_enqueue shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_generic_address_space
-+ #error Feature __opencl_c_generic_address_space shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_pipes
-+ #error Feature __opencl_c_pipes shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_program_scope_global_variables
-+ #error Feature __opencl_c_program_scope_global_variables shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_read_write_images
-+ #error Feature __opencl_c_read_write_images shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_subgroups
-+ #error Feature __opencl_c_subgroups shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_work_group_collective_functions
-+ #error Feature __opencl_c_work_group_collective_functions shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_fp64
-+ #error Feature __opencl_c_fp64 shouldn't be defined
-+ #endif
-+
-+ #ifdef __opencl_c_images
-+ #error Feature __opencl_c_images shouldn't be defined
-+ #endif
-+#endif // __OPENCL_C_VERSION__ == CL_VERSION_3_0
-+
-+kernel void foo() {}
-diff --git a/clang/test/Sema/pipe_builtins_feature.cl b/clang/test/Sema/pipe_builtins_feature.cl
-new file mode 100644
-index 000000000000..56fa94fc7705
---- /dev/null
-+++ b/clang/test/Sema/pipe_builtins_feature.cl
-@@ -0,0 +1,21 @@
-+// RUN: %clang_cc1 -cl-std=CL2.0 -fsyntax-only -verify %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -fsyntax-only -verify %s
-+// RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=__opencl_c_pipes -fsyntax-only -verify %s
-+
-+#ifdef __opencl_c_pipes
-+ #ifndef __opencl_c_generic_address_space
-+ #error Generic address space feature must also be defined
-+ #endif
-+// CHECK: expected-no-diagnostics
-+// check that pragma disable all doesn't touch feature support
-+ #pragma OPENCL EXTENSION all : disable
-+#endif
-+
-+void test(read_only pipe int p, global int *ptr) {
-+ reserve_id_t rid;
-+}
-+
-+#ifndef __opencl_c_pipes
-+// expected-error@-5 {{expected parameter declarator}} expected-error@-5 {{expected ')'}} expected-note@-5 {{to match this '('}}
-+// expected-error@-5 {{use of type 'reserve_id_t' requires __opencl_c_pipes extension to be enabled}}
-+#endif
-diff --git a/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl b/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-index a5a838241347..dbdc5cffd073 100644
---- a/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-+++ b/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
-@@ -1,6 +1,9 @@
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL2.0
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL2.0
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
-+// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=clc++
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=clc++
- // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=clc++
-diff --git a/clang/test/SemaOpenCL/address-spaces.cl b/clang/test/SemaOpenCL/address-spaces.cl
-index e9825fd1682a..563f1e649a82 100644
---- a/clang/test/SemaOpenCL/address-spaces.cl
-+++ b/clang/test/SemaOpenCL/address-spaces.cl
-@@ -1,5 +1,6 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -cl-ext=__opencl_c_generic_address_space -verify -pedantic -fsyntax-only
- // RUN: %clang_cc1 %s -cl-std=clc++ -verify -pedantic -fsyntax-only
-
- __constant int ci = 1;
-diff --git a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-index f63e2913c749..727141190a0b 100644
---- a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-+++ b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
-@@ -2,6 +2,12 @@
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir-unknown-unknown" -verify -pedantic -fsyntax-only -DB32 -DQUALS="const volatile"
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir64-unknown-unknown" -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS=
- // RUN: %clang_cc1 %s -cl-std=CL2.0 -triple "spir64-unknown-unknown" -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS="const volatile"
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -DB32 -DQUALS=
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -DB32 -DQUALS="const volatile"
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir64-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS=
-+// RUN: %clang_cc1 %s -cl-std=CL3.0 -triple "spir64-unknown-unknown" -cl-ext=__opencl_c_device_enqueue,__opencl_c_subgroups -verify -pedantic -fsyntax-only -Wconversion -DWCONV -DQUALS="const volatile"
-+
-+
-
- typedef struct {int a;} ndrange_t;
- // Diagnostic tests for different overloads of enqueue_kernel from Table 6.13.17.1 of OpenCL 2.0 Spec.
-@@ -235,11 +241,17 @@ kernel void bar(global unsigned int *buf)
- kernel void foo1(global unsigned int *buf)
- {
- ndrange_t n;
-- buf[0] = get_kernel_max_sub_group_size_for_ndrange(n, ^(){}); // expected-error {{use of declaration 'get_kernel_max_sub_group_size_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+ buf[0] = get_kernel_max_sub_group_size_for_ndrange(n, ^(){});
-+#if __OPENCL_C_VERSION__ < 300
-+// expected-error@-2 {{use of declaration 'get_kernel_max_sub_group_size_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+#endif
- }
-
- kernel void bar1(global unsigned int *buf)
- {
- ndrange_t n;
-- buf[0] = get_kernel_sub_group_count_for_ndrange(n, ^(){}); // expected-error {{use of declaration 'get_kernel_sub_group_count_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+ buf[0] = get_kernel_sub_group_count_for_ndrange(n, ^(){});
-+#if __OPENCL_C_VERSION__ < 300
-+// expected-error@-2 {{use of declaration 'get_kernel_sub_group_count_for_ndrange' requires cl_khr_subgroups extension to be enabled}}
-+#endif
- }
-diff --git a/clang/test/SemaOpenCL/forget-unsupported-builtins.cl b/clang/test/SemaOpenCL/forget-unsupported-builtins.cl
-new file mode 100644
-index 000000000000..14dd03e2c7db
---- /dev/null
-+++ b/clang/test/SemaOpenCL/forget-unsupported-builtins.cl
-@@ -0,0 +1,22 @@
-+// RUN: %clang_cc1 -cl-std=cl3.0 -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -fsyntax-only -cl-ext=__opencl_c_pipes,__opencl_c_generic_address_space,__opencl_c_device_enqueue -verify %s -triple spir-unknown-unknown -DFEATURES
-+
-+#ifndef FEATURES
-+ // expected-no-diagnostics
-+#else
-+ // expected-error@+10 {{cannot redeclare builtin function 'get_pipe_max_packets'}}
-+ // expected-note@+9 {{'get_pipe_max_packets' is a builtin with type 'unsigned int ()'}}
-+ // expected-error@+9 {{cannot redeclare builtin function 'to_local'}}
-+ // expected-note@+8 {{'to_local' is a builtin with type 'void *(void *)'}}
-+ // expected-error@+8 {{cannot redeclare builtin function 'to_global'}}
-+ // expected-note@+7 {{'to_global' is a builtin with type 'void *(void *)'}}
-+ // expected-error@+7 {{cannot redeclare builtin function 'get_kernel_work_group_size'}}
-+ // expected-note@+6 {{'get_kernel_work_group_size' is a builtin with type 'unsigned int ()'}}
-+#endif
-+
-+int get_pipe_max_packets(int);
-+int to_local(int);
-+int to_global(int);
-+int get_kernel_work_group_size(int);
-+
-+kernel void test(global int *dst) {}
-diff --git a/clang/test/SemaOpenCL/image-features.cl b/clang/test/SemaOpenCL/image-features.cl
-new file mode 100644
-index 000000000000..ace6913bb31e
---- /dev/null
-+++ b/clang/test/SemaOpenCL/image-features.cl
-@@ -0,0 +1,20 @@
-+// RUN: %clang_cc1 -cl-std=cl2.0 -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_images -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_3d_image_writes -fsyntax-only -verify %s -triple spir-unknown-unknown
-+// RUN: %clang_cc1 -cl-std=cl3.0 -cl-ext=__opencl_c_read_write_images -fsyntax-only -verify %s -triple spir-unknown-unknown
-+
-+#if defined(__opencl_c_read_write_images) && defined(__opencl_c_3d_image_writes)
-+ // expected-no-diagnostics
-+#endif
-+
-+__kernel void write_3d_image(__write_only image3d_t i) {}
-+
-+#ifndef __opencl_c_3d_image_writes
-+ // expected-error@-3 {{use of type '__write_only image3d_t' requires __opencl_c_3d_image_writes extension to be enabled}}
-+#endif
-+
-+__kernel void read_write_3d_image(__read_write image3d_t i) { }
-+
-+#ifndef __opencl_c_read_write_images
-+ // expected-error@-3 {{use of type '__read_write image3d_t' requires __opencl_c_read_write_images extension to be enabled}}
-+#endif
-diff --git a/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl b/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-index 36e76621d24a..38b0a04726e3 100644
---- a/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-+++ b/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -cl-ext=+cl_khr_subgroups
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_subgroups,__opencl_c_pipes
-
- #pragma OPENCL EXTENSION cl_khr_subgroups : enable
-
-diff --git a/clang/test/SemaOpenCL/storageclass-cl20.cl b/clang/test/SemaOpenCL/storageclass-cl20.cl
-index 581701d2a6a5..469c526ebc30 100644
---- a/clang/test/SemaOpenCL/storageclass-cl20.cl
-+++ b/clang/test/SemaOpenCL/storageclass-cl20.cl
-@@ -1,4 +1,5 @@
- // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
-+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=__opencl_c_program_scope_global_variables,__opencl_c_generic_address_space
-
- int G2 = 0;
- global int G3 = 0;
-diff --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-index 7c63cf51ecfa..785ff93aaf85 100644
---- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-@@ -56,6 +56,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "TableGenBackends.h"
-+#include "clang/Basic/OpenCLOptions.h"
- #include "llvm/ADT/MapVector.h"
- #include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/SmallString.h"
-@@ -69,6 +70,7 @@
- #include "llvm/TableGen/Record.h"
- #include "llvm/TableGen/StringMatcher.h"
- #include "llvm/TableGen/TableGenBackend.h"
-+#include <numeric>
- #include <set>
-
- using namespace llvm;
-@@ -228,6 +230,10 @@ private:
- // The function "tan", having the same signatures, would be mapped to the
- // same entry (<I1, I2, I3>).
- MapVector<BuiltinIndexListTy *, BuiltinTableEntries> SignatureListMap;
-+
-+ // Encode all versions
-+ unsigned short
-+ EncodeBuiltinVersions(std::vector<Record *> BuiltinVersionsRecords) const;
- };
- } // namespace
-
-@@ -338,12 +344,10 @@ struct OpenCLBuiltinStruct {
- const bool IsConst : 1;
- // Function attribute __attribute__((convergent))
- const bool IsConv : 1;
-+ // All opencl versions encoded
-+ const unsigned char AllVersions : 5;
- // OpenCL extension(s) required for this overload.
- const unsigned short Extension;
-- // First OpenCL version in which this overload was introduced (e.g. CL20).
-- const unsigned short MinVersion;
-- // First OpenCL version in which this overload was removed (e.g. CL20).
-- const unsigned short MaxVersion;
- };
-
- )";
-@@ -510,11 +514,9 @@ void BuiltinNameEmitter::EmitBuiltinTable() {
- << (Overload.first->getValueAsBit("IsPure")) << ", "
- << (Overload.first->getValueAsBit("IsConst")) << ", "
- << (Overload.first->getValueAsBit("IsConv")) << ", "
-- << FunctionExtensionIndex[ExtName] << ", "
-- << Overload.first->getValueAsDef("MinVersion")->getValueAsInt("ID")
-- << ", "
-- << Overload.first->getValueAsDef("MaxVersion")->getValueAsInt("ID")
-- << " },\n";
-+ << EncodeBuiltinVersions(
-+ Overload.first->getValueAsListOfDefs("Versions"))
-+ << ", " << FunctionExtensionIndex[ExtName] << " },\n";
- Index++;
- }
- }
-@@ -535,10 +537,8 @@ bool BuiltinNameEmitter::CanReuseSignature(
- if (Rec->getValueAsBit("IsPure") == Rec2->getValueAsBit("IsPure") &&
- Rec->getValueAsBit("IsConst") == Rec2->getValueAsBit("IsConst") &&
- Rec->getValueAsBit("IsConv") == Rec2->getValueAsBit("IsConv") &&
-- Rec->getValueAsDef("MinVersion")->getValueAsInt("ID") ==
-- Rec2->getValueAsDef("MinVersion")->getValueAsInt("ID") &&
-- Rec->getValueAsDef("MaxVersion")->getValueAsInt("ID") ==
-- Rec2->getValueAsDef("MaxVersion")->getValueAsInt("ID") &&
-+ EncodeBuiltinVersions(Rec->getValueAsListOfDefs("Versions")) ==
-+ EncodeBuiltinVersions(Rec2->getValueAsListOfDefs("Versions")) &&
- Rec->getValueAsDef("Extension")->getName() ==
- Rec2->getValueAsDef("Extension")->getName()) {
- return true;
-@@ -814,6 +814,15 @@ static void OCL2Qual(ASTContext &Context, const OpenCLTypeStruct &Ty,
- OS << "\n} // OCL2Qual\n";
- }
-
-+unsigned short BuiltinNameEmitter::EncodeBuiltinVersions(
-+ std::vector<Record *> BuiltinVersionsRecords) const {
-+ return std::accumulate(
-+ BuiltinVersionsRecords.begin(), BuiltinVersionsRecords.end(),
-+ (unsigned short)0, [](unsigned short C, Record *R) {
-+ return C |= clang::OpenCLOptions::EncodeVersion(R->getValueAsInt("ID"));
-+ });
-+}
-+
- void clang::EmitClangOpenCLBuiltins(RecordKeeper &Records, raw_ostream &OS) {
- BuiltinNameEmitter NameChecker(Records, OS);
- NameChecker.Emit();
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-Remove-repo-name-in-LLVM-IR.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-Remove-repo-name-in-LLVM-IR.patch
deleted file mode 100644
index 09089432..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-Remove-repo-name-in-LLVM-IR.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From ff0a6da84b94c16c4519c649f1f7bed3cdf89bbb Mon Sep 17 00:00:00 2001
-From: Feng Zou <feng.zou@intel.com>
-Date: Tue, 20 Oct 2020 11:29:04 +0800
-Subject: [PATCH] Remove repo name in LLVM IR
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-110/patches/llvm/0002-Remove-repo-name-in-LLVM-IR.patch]
-Signed-off-by: Feng Zou <feng.zou@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
-
----
- llvm/cmake/modules/VersionFromVCS.cmake | 23 ++++++++++++-----------
- 1 file changed, 12 insertions(+), 11 deletions(-)
-
-diff --git a/llvm/cmake/modules/VersionFromVCS.cmake b/llvm/cmake/modules/VersionFromVCS.cmake
-index 18edbeabe3e..2d965263478 100644
---- a/llvm/cmake/modules/VersionFromVCS.cmake
-+++ b/llvm/cmake/modules/VersionFromVCS.cmake
-@@ -33,17 +33,18 @@ function(get_source_info path revision repository)
- else()
- set(remote "origin")
- endif()
-- execute_process(COMMAND ${GIT_EXECUTABLE} remote get-url ${remote}
-- WORKING_DIRECTORY ${path}
-- RESULT_VARIABLE git_result
-- OUTPUT_VARIABLE git_output
-- ERROR_QUIET)
-- if(git_result EQUAL 0)
-- string(STRIP "${git_output}" git_output)
-- set(${repository} ${git_output} PARENT_SCOPE)
-- else()
-- set(${repository} ${path} PARENT_SCOPE)
-- endif()
-+ # Do not show repo name in IR
-+ # execute_process(COMMAND ${GIT_EXECUTABLE} remote get-url ${remote}
-+ # WORKING_DIRECTORY ${path}
-+ # RESULT_VARIABLE git_result
-+ # OUTPUT_VARIABLE git_output
-+ # ERROR_QUIET)
-+ # if(git_result EQUAL 0)
-+ # string(STRIP "${git_output}" git_output)
-+ # set(${repository} ${git_output} PARENT_SCOPE)
-+ # else()
-+ # set(${repository} ${path} PARENT_SCOPE)
-+ # endif()
- endif()
- else()
- message(WARNING "Git not found. Version cannot be determined.")
---
-2.18.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch
deleted file mode 100644
index 011c09ee..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From d362652617c5e840089273df0c6623a9745c92a2 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 21 Aug 2019 14:35:31 +0800
-Subject: [PATCH] llvm-spirv: skip building tests
-
-Some of these need clang to be built and since we're building this in-tree,
-that leads to problems when compiling libcxx, compiler-rt which aren't built
-in-tree.
-
-Instead of using SPIRV_SKIP_CLANG_BUILD to skip clang build and adding this to
-all components, disable the building of tests altogether.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- CMakeLists.txt | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index ecebb4cb..578ca602 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -25,13 +25,6 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
- set(CMAKE_CXX_STANDARD 14)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-- if(LLVM_SPIRV_INCLUDE_TESTS)
-- set(LLVM_TEST_COMPONENTS
-- llvm-as
-- llvm-dis
-- )
-- endif(LLVM_SPIRV_INCLUDE_TESTS)
--
- find_package(LLVM ${BASE_LLVM_VERSION} REQUIRED
- COMPONENTS
- Analysis
-@@ -62,9 +55,6 @@ set(LLVM_SPIRV_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
-
- add_subdirectory(lib/SPIRV)
- add_subdirectory(tools/llvm-spirv)
--if(LLVM_SPIRV_INCLUDE_TESTS)
-- add_subdirectory(test)
--endif(LLVM_SPIRV_INCLUDE_TESTS)
-
- install(
- FILES
---
-2.26.2
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend b/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
deleted file mode 100644
index 4e2bc535..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
+++ /dev/null
@@ -1,35 +0,0 @@
-FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:"
-
-SPIRV_BRANCH = "${@bb.utils.contains('LLVMVERSION', '10.0.1', 'llvm_release_100', 'llvm_release_110', d)}"
-
-SPIRV10_SRCREV = "576abae62cecd171992017a4a786e3831221ab8d"
-SPIRV11_SRCREV = "2a8c1e6c9778deaa720a23e08c293006dc5d56fd"
-
-SPIRV_SRCREV = "${@bb.utils.contains('LLVMVERSION', '10.0.1', '${SPIRV10_SRCREV}', '${SPIRV11_SRCREV}', d)}"
-
-SRC_URI_LLVM10 = " \
- file://llvm10-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
- file://fix-shared-libs.patch;patchdir=llvm/projects/llvm-spirv \
- file://BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch;patchdir=llvm \
- file://IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch;patchdir=llvm \
- file://llvm10-OpenCL-3.0-support.patch \
- file://0002-Add-cl_khr_extended_subgroup-extensions.patch \
- file://0001-Memory-leak-fix-for-Managed-Static-Mutex.patch \
- file://llvm10-Remove-repo-name-in-LLVM-IR.patch \
- file://0001-Fix-debug-info-of-work-item-builtin-translation-745.patch;patchdir=llvm/projects/llvm-spirv \
- "
-
-SRC_URI_LLVM11 = " \
- file://llvm11-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
- file://llvm11-OpenCL-3.0-support.patch \
- file://0001-Memory-leak-fix-for-Managed-Static-Mutex.patch \
- file://llvm11-Remove-repo-name-in-LLVM-IR.patch \
- "
-
-SPIRV_LLVM_SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator.git;protocol=https;branch=${SPIRV_BRANCH};destsuffix=git/llvm/projects/llvm-spirv;name=spirv"
-
-SPIRV_LLVM_PATCHES = "${@bb.utils.contains('LLVMVERSION', '10.0.1', '${SRC_URI_LLVM10}', '${SRC_URI_LLVM11}', d)}"
-
-
-SRC_URI_append_intel-x86-common = "${@bb.utils.contains('LLVMVERSION', '12.0.0', '', ' ${SPIRV_LLVM_SRC_URI} ${SPIRV_LLVM_PATCHES} ', d)}"
-SRCREV_spirv = "${@bb.utils.contains('LLVMVERSION', '12.0.0', '', '${SPIRV_SRCREV}', d)}"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch
index 631e0ce6..265fcfa2 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch
@@ -1,44 +1,51 @@
-From 32851d269ac0c027730168c04d9ce32d0eb50905 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 27 May 2020 11:12:09 +0000
-Subject: [PATCH] intel-compute-runtime: allow to find cpp_generation_tool
-
-Build not able to locate cpp_generation_tool.
+From a6361d635e5f3046853883f3ac06fb175116933c Mon Sep 17 00:00:00 2001
+From: Dongwon Kim <dongwon.kim@intel.com>
+Date: Sat, 21 Aug 2021 16:09:39 -0700
+Subject: [PATCH] Build not able to locate cpp_generation_tool.
Upstream-Status: Inappropriate [oe specific]
+
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
- shared/source/built_ins/kernels/CMakeLists.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ shared/source/built_ins/kernels/CMakeLists.txt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/shared/source/built_ins/kernels/CMakeLists.txt b/shared/source/built_ins/kernels/CMakeLists.txt
-index 1b1225077..2e8148c25 100644
+index ed85a37c52..f7c9e79137 100644
--- a/shared/source/built_ins/kernels/CMakeLists.txt
+++ b/shared/source/built_ins/kernels/CMakeLists.txt
-@@ -93,9 +93,9 @@ function(compile_builtin gen_type platform_type builtin bits builtin_options mod
- )
- add_custom_command(
- OUTPUT ${OUTPUT_FILE_CPP}
-- COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${OUTPUTPATH_BASE}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type}
-+ COMMAND cpp_generate_tool --file ${OUTPUTPATH_BASE}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-- DEPENDS ${OUTPUTPATH_BASE}.gen $<TARGET_FILE:cpp_generate_tool>
-+ DEPENDS ${OUTPUTPATH_BASE}.gen cpp_generate_tool
- )
- endfunction()
-
-@@ -136,9 +136,9 @@ function(generate_cpp_spirv builtin)
- )
- add_custom_command(
- OUTPUT ${OUTPUT_FILE_CPP}
-- COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME}
-+ COMMAND cpp_generate_tool --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-- DEPENDS ${GENERATED_SPV_INPUT} $<TARGET_FILE:cpp_generate_tool>
-+ DEPENDS ${GENERATED_SPV_INPUT} cpp_generate_tool
+@@ -107,9 +107,9 @@ function(compile_builtin core_type platform_it builtin bits builtin_options mode
+ )
+ add_custom_command(
+ OUTPUT ${OUTPUT_FILE_CPP}
+- COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${BINARY_OUTPUT}.bin --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --device ${RELEASE_FILENAME}
++ COMMAND cpp_generate_tool --file ${BINARY_OUTPUT}.bin --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --device ${RELEASE_FILENAME}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+- DEPENDS ${OUTPUT_FILES_BINARIES} $<TARGET_FILE:cpp_generate_tool>
++ DEPENDS ${OUTPUT_FILES_BINARIES} cpp_generate_tool
+ )
+ list(APPEND BUILTINS_COMMANDS "${OUTPUT_FILE_CPP}")
+ else()
+@@ -159,9 +159,9 @@ function(generate_cpp_spirv builtin)
+ )
+ add_custom_command(
+ OUTPUT ${OUTPUT_FILE_CPP}
+- COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME}
++ COMMAND cpp_generate_tool --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+- DEPENDS ${GENERATED_SPV_INPUT} $<TARGET_FILE:cpp_generate_tool>
++ DEPENDS ${GENERATED_SPV_INPUT} cpp_generate_tool
+ )
+ set(OUTPUT_LIST_CPP_FILES ${OUTPUT_LIST_CPP_FILES} ${OUTPUT_FILE_CPP} PARENT_SCOPE)
+ else()
+@@ -277,4 +277,4 @@ if(NOT "${OUTPUT_LIST_CPP_FILES}" STREQUAL "")
)
- endfunction()
+ endif()
+-apply_macro_for_each_core_type("SUPPORTED")
+\ No newline at end of file
++apply_macro_for_each_core_type("SUPPORTED")
--
-2.28.0
+2.43.2
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch
new file mode 100644
index 00000000..20d9b847
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Inappropriate
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d52e089778..bc0cf35014 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -727,7 +727,7 @@ if(NOT MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") # Added for gtest
+ endif()
+ endif()
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=vla")
+
+ if(USE_SANITIZE_UB)
+ check_cxx_compiler_flag(-fsanitize=undefined COMPILER_SUPPORTS_UNDEFINED_BEHAVIOR_SANITIZER)
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch
new file mode 100644
index 00000000..5f93b7b6
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch
@@ -0,0 +1,40 @@
+From 1f58c22992ddea4167b01b44448528de427f50d5 Mon Sep 17 00:00:00 2001
+From: Dongwon Kim <dongwon.kim@intel.com>
+Date: Wed, 2 Mar 2022 15:52:45 -0800
+Subject: [PATCH] external ocloc
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
+---
+ cmake/ocloc_cmd_prefix.cmake | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/cmake/ocloc_cmd_prefix.cmake b/cmake/ocloc_cmd_prefix.cmake
+index 2b44330831..03067c9df0 100644
+--- a/cmake/ocloc_cmd_prefix.cmake
++++ b/cmake/ocloc_cmd_prefix.cmake
+@@ -4,12 +4,14 @@
+ # SPDX-License-Identifier: MIT
+ #
+
+-if(WIN32)
+- set(ocloc_cmd_prefix ocloc)
+-else()
+- if(DEFINED NEO__IGC_LIBRARY_PATH)
+- set(ocloc_cmd_prefix ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib>" $<TARGET_FILE:ocloc>)
++if(NOT DEFINED ocloc_cmd_prefix)
++ if(WIN32)
++ set(ocloc_cmd_prefix ocloc)
+ else()
+- set(ocloc_cmd_prefix ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib>" $<TARGET_FILE:ocloc>)
++ if(DEFINED NEO__IGC_LIBRARY_PATH)
++ set(ocloc_cmd_prefix LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $<TARGET_FILE:ocloc>)
++ else()
++ set(ocloc_cmd_prefix LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $<TARGET_FILE:ocloc>)
++ endif()
+ endif()
+ endif()
+--
+2.37.3
+
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.04.18912.bb b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.04.18912.bb
deleted file mode 100644
index d0078f3a..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.04.18912.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-SUMMARY = "The Intel(R) Graphics Compute Runtime for OpenCL(TM)"
-DESCRIPTION = "The Intel(R) Graphics Compute Runtime for OpenCL(TM) \
-is an open source project to converge Intel's development efforts \
-on OpenCL(TM) compute stacks supporting the GEN graphics hardware \
-architecture."
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=ae27f47fd6755510247c19e547e4c804 \
- file://third_party/opencl_headers/LICENSE;md5=dcefc90f4c3c689ec0c2489064e7273b"
-
-SRC_URI = "git://github.com/intel/compute-runtime.git;protocol=https \
- "
-SRC_URI_append_class-target = " file://allow-to-find-cpp-generation-tool.patch"
-
-SRCREV = "5a05d7643c4d8cc14e281b686c78101a7a01e8e1"
-
-S = "${WORKDIR}/git"
-
-DEPENDS += " intel-graphics-compiler gmmlib"
-DEPENDS_append_class-target = " intel-compute-runtime-native libva"
-
-RDEPENDS_${PN} += " intel-graphics-compiler gmmlib"
-
-inherit cmake pkgconfig
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-EXTRA_OECMAKE = " \
- -DIGC_DIR=${STAGING_INCDIR}/igc \
- -DBUILD_TYPE=Release \
- -DSKIP_UNIT_TESTS=1 \
- -DCCACHE_ALLOWED=FALSE \
- "
-EXTRA_OECMAKE_append_class-target = " \
- -Dcloc_cmd_prefix=ocloc \
- "
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[levelzero] = "-DBUILD_WITH_L0=ON, -DBUILD_WITH_L0=OFF, level-zero"
-
-do_install_append_class-native() {
- install -d ${D}${bindir}
- install ${B}/bin/cpp_generate_tool ${D}${bindir}/
-}
-
-FILES_${PN} += " \
- ${libdir}/intel-opencl/libigdrcl.so \
- ${libdir}/libocloc.so \
- "
-
-FILES_${PN}-dev = "${includedir}"
-
-BBCLASSEXTEND = "native nativesdk"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb
new file mode 100644
index 00000000..60125171
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb
@@ -0,0 +1,64 @@
+SUMMARY = "The Intel(R) Graphics Compute Runtime for OpenCL(TM)"
+DESCRIPTION = "The Intel(R) Graphics Compute Runtime for OpenCL(TM) \
+is an open source project to converge Intel's development efforts \
+on OpenCL(TM) compute stacks supporting the GEN graphics hardware \
+architecture."
+
+LICENSE = "MIT & Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eca6ec6997e18db166db7109cdbe611c \
+ file://third_party/opencl_headers/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI = "git://github.com/intel/compute-runtime.git;protocol=https;branch=releases/24.05 \
+ file://disable-werror.patch \
+ file://allow-to-find-cpp-generation-tool.patch \
+ file://external-ocloc.patch \
+ "
+
+SRCREV = "23a9725e62c8181193c90e5e5207507a1f136587"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += " intel-graphics-compiler gmmlib libva qemu-native"
+
+RDEPENDS:${PN} += " intel-graphics-compiler gmmlib"
+
+inherit cmake pkgconfig qemu
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+EXTRA_OECMAKE = " \
+ -DIGC_DIR=${STAGING_INCDIR}/igc \
+ -DBUILD_TYPE=Release \
+ -DSKIP_UNIT_TESTS=1 \
+ -DCCACHE_ALLOWED=FALSE \
+ -DNEO_DISABLE_LD_LLD=ON \
+ -DNEO_DISABLE_LD_GOLD=ON \
+ "
+
+EXTRA_OECMAKE:append:class-target = " \
+ -Docloc_cmd_prefix=ocloc \
+ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \
+ "
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[levelzero] = "-DBUILD_WITH_L0=ON, -DBUILD_WITH_L0=OFF, level-zero"
+
+do_configure:prepend:class-target () {
+ # Write out a qemu wrapper that will be used by cmake.
+ qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${B}/bin'),d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
+ cat > ${WORKDIR}/qemuwrapper << EOF
+#!/bin/sh
+$qemu_binary "\$@"
+EOF
+ chmod +x ${WORKDIR}/qemuwrapper
+}
+
+FILES:${PN} += " \
+ ${libdir}/intel-opencl/libigdrcl.so \
+ ${libdir}/libocloc.so \
+ "
+
+FILES:${PN}-dev = "${includedir}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch
new file mode 100644
index 00000000..377081fd
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch
@@ -0,0 +1,35 @@
+From 3d71670f8ad5b54d434c2f5f71713bb1d5433ae4 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Tue, 12 Oct 2021 23:46:42 +0800
+Subject: [PATCH] BiF/CMakeLists.txt: remove opt from DEPENDS
+
+Otherwise it starts failing with:
+
+| ninja: error: 'IGC/VectorCompiler/lib/BiF/opt', needed by 'IGC/VectorCompiler/lib/BiF/VCBiFPrintfOCL32.opt.bc', missing and no known rule to make it
+
+We don't need to explicitly make sure opt is built when
+using prebuilt binaries.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake b/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake
+index d20d7f887..882e09fea 100644
+--- a/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake
++++ b/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake
+@@ -109,7 +109,7 @@ function(vc_build_bif TARGET RES_FILE CMCL_SRC_PATH BIF_NAME PTR_BIT_SIZE)
+ COMMENT "vc_build_bif: Translating CMCL builtins: ${BIF_CLANG_BC_NAME_FINAL} -> ${BIF_OPT_BC_NAME}"
+ COMMAND CMCLTranslatorTool -o ${BIF_CMCL_BC_NAME} ${BIF_CLANG_BC_NAME_FINAL}
+ COMMAND ${LLVM_OPT_EXE} ${IGC_LLVM_DEPENDENT_OPT_FLAGS} --O2 -o ${BIF_OPT_BC_NAME} ${BIF_CMCL_BC_NAME}
+- DEPENDS CMCLTranslatorTool ${LLVM_OPT_EXE} ${BIF_CLANG_BC_PATH_FINAL}
++ DEPENDS CMCLTranslatorTool ${BIF_CLANG_BC_PATH_FINAL}
+ BYPRODUCTS ${BIF_OPT_BC_PATH}
+ SOURCES ${CMCL_SRC_PATH})
+ set(${RES_FILE} ${BIF_OPT_BC_NAME} PARENT_SCOPE)
+--
+2.43.2
+
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-Fix-build-with-LLVM-12.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-Fix-build-with-LLVM-12.patch
deleted file mode 100644
index 1d2c5767..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-Fix-build-with-LLVM-12.patch
+++ /dev/null
@@ -1,2433 +0,0 @@
-From 869cdb784aa062bd08bd26465bf0b5651e8f112e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
-Date: Thu, 25 Feb 2021 10:39:27 +0100
-Subject: [PATCH 1/3] Fix build with LLVM 12
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Pending
-
-Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- .../LegalizeFunctionSignatures.cpp | 2 +-
- IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 26 +++++++++-----
- IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp | 6 +++-
- IGC/Compiler/CISACodeGen/AdvMemOpt.cpp | 4 +++
- IGC/Compiler/CISACodeGen/CShader.cpp | 14 ++++----
- .../CISACodeGen/ConstantCoalescing.cpp | 14 ++++----
- IGC/Compiler/CISACodeGen/DeSSA.cpp | 3 +-
- IGC/Compiler/CISACodeGen/EmitVISAPass.cpp | 35 +++++++++---------
- IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp | 4 +--
- IGC/Compiler/CISACodeGen/GenIRLowering.cpp | 4 +--
- .../CISACodeGen/GenSimplification.cpp | 5 +--
- .../CISACodeGen/GeometryShaderLowering.cpp | 3 +-
- IGC/Compiler/CISACodeGen/LdShrink.cpp | 10 ++++--
- .../CISACodeGen/LowerGEPForPrivMem.cpp | 8 ++---
- IGC/Compiler/CISACodeGen/MemOpt.cpp | 8 ++---
- IGC/Compiler/CISACodeGen/MemOpt2.cpp | 5 +--
- .../CISACodeGen/OpenCLKernelCodeGen.cpp | 2 +-
- IGC/Compiler/CISACodeGen/PatternMatchPass.cpp | 4 +--
- IGC/Compiler/CISACodeGen/PushAnalysis.cpp | 4 +--
- .../CISACodeGen/RegisterEstimator.cpp | 3 +-
- .../CISACodeGen/RegisterPressureEstimate.hpp | 3 +-
- IGC/Compiler/CISACodeGen/SLMConstProp.cpp | 3 +-
- .../CISACodeGen/ScalarizerCodeGen.cpp | 4 +--
- IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp | 4 +++
- .../CISACodeGen/Simd32Profitability.cpp | 11 ++++--
- IGC/Compiler/CISACodeGen/SimplifyConstant.cpp | 12 +++----
- IGC/Compiler/CISACodeGen/TypeDemote.cpp | 3 +-
- .../CISACodeGen/VariableReuseAnalysis.cpp | 5 +--
- .../CISACodeGen/VariableReuseAnalysis.hpp | 3 +-
- IGC/Compiler/CISACodeGen/VectorPreProcess.cpp | 24 ++++++-------
- IGC/Compiler/CISACodeGen/VectorProcess.cpp | 4 +--
- IGC/Compiler/CISACodeGen/helper.cpp | 10 +++---
- IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp | 15 ++++++--
- IGC/Compiler/CustomSafeOptPass.cpp | 26 +++++++-------
- IGC/Compiler/DebugInfo/ScalarVISAModule.cpp | 3 +-
- IGC/Compiler/GenTTI.cpp | 8 ++++-
- IGC/Compiler/GenUpdateCB.cpp | 3 +-
- IGC/Compiler/HandleFRemInstructions.cpp | 3 +-
- IGC/Compiler/HandleLoadStoreInstructions.cpp | 4 +--
- IGC/Compiler/LegalizationPass.cpp | 28 +++++++--------
- IGC/Compiler/Legalizer/InstPromoter.cpp | 11 ++++--
- IGC/Compiler/Legalizer/InstScalarizer.cpp | 6 ++--
- .../Legalizer/PeepholeTypeLegalizer.cpp | 6 ++--
- IGC/Compiler/Legalizer/TypeLegalizer.cpp | 3 +-
- IGC/Compiler/Legalizer/TypeLegalizer.h | 3 +-
- IGC/Compiler/LowPrecisionOptPass.cpp | 2 +-
- .../AddressSpaceAliasAnalysis.cpp | 9 ++---
- .../AggregateArguments/AggregateArguments.cpp | 3 +-
- .../CorrectlyRoundedDivSqrt.cpp | 3 +-
- .../DeviceEnqueueFuncs/TransformBlocks.cpp | 6 +++-
- .../Optimizer/OpenCLPasses/KernelArgs.cpp | 3 +-
- .../OpenCLPrintf/OpenCLPrintfResolution.cpp | 4 +--
- .../PrivateMemory/PrivateMemoryResolution.cpp | 11 ++++--
- .../ReplaceUnsupportedIntrinsics.cpp | 4 +--
- .../OpenCLPasses/WIFuncs/WIFuncResolution.cpp | 4 +++
- .../Optimizer/PreCompiledFuncImport.cpp | 4 +--
- IGC/Compiler/Optimizer/Scalarizer.cpp | 36 +++++++++----------
- IGC/Compiler/Optimizer/ValueTracker.cpp | 2 +-
- IGC/Compiler/VerificationPass.cpp | 2 +-
- IGC/DebugInfo/DebugInfoUtils.hpp | 4 +++
- IGC/DebugInfo/DwarfDebug.cpp | 8 +++++
- IGC/GenISAIntrinsics/GenIntrinsics.cpp | 6 ++--
- .../BuiltinsFrontendDefinitions.hpp | 2 +-
- .../include/llvmWrapper/Support/TypeSize.h | 8 ++++-
- .../include/llvmWrapper/Transforms/Scalar.h | 4 +--
- IGC/common/igc_resourceDimTypes.h | 5 +++
- 66 files changed, 303 insertions(+), 196 deletions(-)
-
-diff --git a/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp b/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
-index 4046b4a6..8ed36089 100644
---- a/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
-+++ b/IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp
-@@ -156,7 +156,7 @@ inline Type* LegalizedIntVectorType(Module& M, const Type* const oldTy)
- else if (size <= 64) newSize = 64;
- else IGC_ASSERT_MESSAGE(0, "Currently don't support upscaling int sizes > 64 bits");
-
-- return IGCLLVM::FixedVectorType::get(IntegerType::get(M.getContext(), newSize), (unsigned)cast<VectorType>(oldTy)->getNumElements());
-+ return IGCLLVM::FixedVectorType::get(IntegerType::get(M.getContext(), newSize), (unsigned)cast<IGCLLVM::FixedVectorType>(oldTy)->getNumElements());
- }
-
- void LegalizeFunctionSignatures::FixFunctionSignatures()
-diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-index 41d1f2ea..725a1512 100644
---- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-@@ -1576,7 +1576,11 @@ void SPIRVToLLVMDbgTran::transDbgInfo(SPIRVValue *SV, Value *V) {
- Line->getColumn(), scope, iat);
-
- if(scope && !isa<DIFile>(scope))
-+#if LLVM_VERSION_MAJOR >= 12
-+ I->setDebugLoc(DILocation::get(scope->getContext(), Line->getLine(), Line->getColumn(),
-+#else
- I->setDebugLoc(DebugLoc::get(Line->getLine(), Line->getColumn(),
-+#endif
- scope, iat));
- }
- }
-@@ -1925,7 +1929,11 @@ SPIRVToLLVM::transType(SPIRVType *T) {
- auto name = isSubgroupAvcINTELTypeOpCode(OC) ?
- OCLSubgroupINTELTypeOpCodeMap::rmap(OC) :
- BuiltinOpaqueGenericTypeOpCodeMap::rmap(OC);
-+#if LLVM_VERSION_MAJOR >= 12
-+ auto *pST = llvm::StructType::getTypeByName(M->getContext(), name);
-+#else
- auto *pST = M->getTypeByName(name);
-+#endif
- pST = pST ? pST : StructType::create(*Context, name);
-
- return mapType(T, PointerType::get(pST, getOCLOpaqueTypeAddrSpace(OC)));
-@@ -2403,7 +2411,7 @@ Value *SPIRVToLLVM::promoteBool(Value *pVal, BasicBlock *BB)
-
- auto *PromoType = isa<VectorType>(pVal->getType()) ?
- cast<Type>(IGCLLVM::FixedVectorType::get(Type::getInt8Ty(pVal->getContext()),
-- (unsigned)cast<VectorType>(pVal->getType())->getNumElements())) :
-+ (unsigned)cast<IGCLLVM::FixedVectorType>(pVal->getType())->getNumElements())) :
- Type::getInt8Ty(pVal->getContext());
-
- if (auto *C = dyn_cast<Constant>(pVal))
-@@ -2445,7 +2453,7 @@ Value *SPIRVToLLVM::truncBool(Value *pVal, BasicBlock *BB)
-
- auto *TruncType = isa<VectorType>(pVal->getType()) ?
- cast<Type>(IGCLLVM::FixedVectorType::get(Type::getInt1Ty(pVal->getContext()),
-- (unsigned)cast<VectorType>(pVal->getType())->getNumElements())) :
-+ (unsigned)cast<IGCLLVM::FixedVectorType>(pVal->getType())->getNumElements())) :
- Type::getInt1Ty(pVal->getContext());
-
- if (auto *C = dyn_cast<Constant>(pVal))
-@@ -2491,7 +2499,7 @@ Type *SPIRVToLLVM::truncBoolType(SPIRVType *SPVType, Type *LLType)
-
- return isa<VectorType>(LLType) ?
- cast<Type>(IGCLLVM::FixedVectorType::get(Type::getInt1Ty(LLType->getContext()),
-- (unsigned)cast<VectorType>(LLType)->getNumElements())) :
-+ (unsigned)cast<IGCLLVM::FixedVectorType>(LLType)->getNumElements())) :
- Type::getInt1Ty(LLType->getContext());
- }
-
-@@ -2648,7 +2656,7 @@ SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
- {
- if(CV[i]->getType()->isVectorTy())
- {
-- for(uint32_t j = 0; j < cast<VectorType>(CV[i]->getType())->getNumElements(); j++)
-+ for(uint32_t j = 0; j < cast<IGCLLVM::FixedVectorType>(CV[i]->getType())->getNumElements(); j++)
- {
- Value *v = ExtractElementInst::Create( CV[i],ConstantInt::get( *Context,APInt( 32,j ) ),BCC->getName(),BB );
- elm1 = CreateCompositeConstruct( elm1,v,pos++ );
-@@ -3336,7 +3344,7 @@ SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
- auto Vector = transValue(BI->getOperand(0), F, BB);
- auto Scalar = transValue(BI->getOperand(1), F, BB);
-
-- auto VecType = cast<VectorType>(Vector->getType());
-+ auto VecType = cast<IGCLLVM::FixedVectorType>(Vector->getType());
- auto Undef = UndefValue::get(VecType);
-
- auto ScalarVec = InsertElementInst::Create(Undef, Scalar,
-@@ -3361,7 +3369,7 @@ SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
- a->getType()->getScalarSizeInBits() - 1);
- auto *ShiftOp = isa<VectorType>(a->getType()) ?
- ConstantVector::getSplat(
-- IGCLLVM::getElementCount((unsigned)cast<VectorType>(a->getType())->getNumElements()), ShiftAmt) :
-+ IGCLLVM::getElementCount((unsigned)cast<IGCLLVM::FixedVectorType>(a->getType())->getNumElements()), ShiftAmt) :
- ShiftAmt;
-
- // OCL C:
-@@ -3705,15 +3713,15 @@ SPIRVToLLVM::transSPIRVBuiltinFromInst(SPIRVInstruction *BI, BasicBlock *BB) {
- "",
- BB);
- }
-- else if (cast<VectorType>(coordType)->getNumElements() != 4)
-+ else if (cast<IGCLLVM::FixedVectorType>(coordType)->getNumElements() != 4)
- {
- Value *undef = UndefValue::get(coordType);
-
- SmallVector<Constant*, 4> shuffleIdx;
-- for (unsigned i = 0; i < cast<VectorType>(coordType)->getNumElements(); i++)
-+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(coordType)->getNumElements(); i++)
- shuffleIdx.push_back(ConstantInt::get(Type::getInt32Ty(*Context), i));
-
-- for (uint64_t i = (unsigned)cast<VectorType>(coordType)->getNumElements(); i < 4; i++)
-+ for (uint64_t i = (unsigned)cast<IGCLLVM::FixedVectorType>(coordType)->getNumElements(); i < 4; i++)
- shuffleIdx.push_back(ConstantInt::get(Type::getInt32Ty(*Context), 0));
-
- imageCoordinateWiden = new ShuffleVectorInst(
-diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-index 57821556..91b4623c 100644
---- a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-+++ b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-@@ -93,7 +93,11 @@ saveLLVMModule(Module *M, const std::string &OutputFile) {
- PointerType*
- getOrCreateOpaquePtrType(Module *M, const std::string &Name,
- unsigned AddrSpace) {
-+#if LLVM_VERSION_MAJOR >= 12
-+ auto OpaqueType = llvm::StructType::getTypeByName(M->getContext(), Name);
-+#else
- auto OpaqueType = M->getTypeByName(Name);
-+#endif
- if (!OpaqueType)
- OpaqueType = StructType::create(M->getContext(), Name);
- return PointerType::get(OpaqueType, AddrSpace);
-@@ -159,7 +163,7 @@ std::string recursive_mangle(const Type* pType)
- return "i" + utostr(pType->getIntegerBitWidth());
- case IGCLLVM::VectorTyID:
- {
-- unsigned vecLen = (unsigned)cast<VectorType>(pType)->getNumElements();
-+ unsigned vecLen = (unsigned)cast<IGCLLVM::FixedVectorType>(pType)->getNumElements();
- Type* pEltType = cast<VectorType>(pType)->getElementType();
- return "v" + utostr(vecLen) + recursive_mangle(pEltType);
- }
-diff --git a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-index 81acc6ce..fc45a510 100644
---- a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-+++ b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-@@ -134,7 +134,11 @@ bool AdvMemOpt::runOnFunction(Function& F) {
- for (auto I = LI->begin(), E = LI->end(); I != E; ++I)
- for (auto DFI = df_begin(*I), DFE = df_end(*I); DFI != DFE; ++DFI) {
- Loop* L = *DFI;
-+#if LLVM_VERSION_MAJOR >= 12
-+ if (L->isInnermost())
-+#else
- if (L->empty())
-+#endif
- InnermostLoops.push_back(L);
- }
-
-diff --git a/IGC/Compiler/CISACodeGen/CShader.cpp b/IGC/Compiler/CISACodeGen/CShader.cpp
-index e3cb8153..ebc99615 100644
---- a/IGC/Compiler/CISACodeGen/CShader.cpp
-+++ b/IGC/Compiler/CISACodeGen/CShader.cpp
-@@ -430,7 +430,7 @@ void CShader::CreateAliasVars()
- continue;
-
- Type* Ty = V->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- Type* BTy = VTy ? VTy->getElementType() : Ty;
- int nelts = (VTy ? (int)VTy->getNumElements() : 1);
-
-@@ -961,7 +961,7 @@ bool CShader::InsideDivergentCF(llvm::Instruction* inst)
- uint CShader::GetNbVectorElementAndMask(llvm::Value* val, uint32_t& mask)
- {
- llvm::Type* type = val->getType();
-- uint nbElement = int_cast<uint>(cast<VectorType>(type)->getNumElements());
-+ uint nbElement = int_cast<uint>(cast<IGCLLVM::FixedVectorType>(type)->getNumElements());
- mask = 0;
- // we don't process vector bigger than 31 elements as the mask has only 32bits
- // If we want to support longer vectors we need to extend the mask size
-@@ -1166,7 +1166,7 @@ uint32_t CShader::GetExtractMask(llvm::Value* vecVal)
- {
- return it->second;
- }
-- const unsigned int numChannels = vecVal->getType()->isVectorTy() ? (unsigned)cast<VectorType>(vecVal->getType())->getNumElements() : 1;
-+ const unsigned int numChannels = vecVal->getType()->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(vecVal->getType())->getNumElements() : 1;
- IGC_ASSERT_MESSAGE(numChannels <= 32, "Mask has 32 bits maximally!");
- return (1ULL << numChannels) - 1;
- }
-@@ -1174,7 +1174,7 @@ uint32_t CShader::GetExtractMask(llvm::Value* vecVal)
- uint16_t CShader::AdjustExtractIndex(llvm::Value* vecVal, uint16_t index)
- {
- uint16_t result = index;
-- if (cast<VectorType>(vecVal->getType())->getNumElements() < 32)
-+ if (cast<IGCLLVM::FixedVectorType>(vecVal->getType())->getNumElements() < 32)
- {
- uint32_t mask = GetExtractMask(vecVal);
- for (uint i = 0; i < index; ++i)
-@@ -1591,7 +1591,7 @@ auto sizeToSIMDMode = [](uint32_t size)
-
- CVariable* CShader::GetConstant(llvm::Constant* C, CVariable* dstVar)
- {
-- llvm::VectorType* VTy = llvm::dyn_cast<llvm::VectorType>(C->getType());
-+ IGCLLVM::FixedVectorType* VTy = llvm::dyn_cast<IGCLLVM::FixedVectorType>(C->getType());
- if (C && VTy)
- { // Vector constant
- llvm::Type* eTy = VTy->getElementType();
-@@ -1816,7 +1816,7 @@ uint32_t CShader::GetNumElts(llvm::Type* type, bool isUniform)
- {
- IGC_ASSERT(type->getContainedType(0)->isIntegerTy() || type->getContainedType(0)->isFloatingPointTy());
-
-- auto VT = cast<VectorType>(type);
-+ auto VT = cast<IGCLLVM::FixedVectorType>(type);
- numElts *= (uint16_t)VT->getNumElements();
- }
- return numElts;
-@@ -2516,7 +2516,7 @@ CVariable* CShader::GetSymbol(llvm::Value* value, bool fromConstantPool)
- if (isVecType)
- {
- // Map the entire vector value to the CVar
-- unsigned numElements = (unsigned)cast<VectorType>(value->getType())->getNumElements();
-+ unsigned numElements = (unsigned)cast<IGCLLVM::FixedVectorType>(value->getType())->getNumElements();
- var = GetNewVariable(numElements, ISA_TYPE_UQ, (GetContext()->platform.getGRFSize() == 64) ? EALIGN_32WORD : EALIGN_HWORD, true, 1, valName);
- symbolMapping.insert(std::pair<llvm::Value*, CVariable*>(value, var));
-
-diff --git a/IGC/Compiler/CISACodeGen/ConstantCoalescing.cpp b/IGC/Compiler/CISACodeGen/ConstantCoalescing.cpp
-index 1efe116f..47b7c6c0 100644
---- a/IGC/Compiler/CISACodeGen/ConstantCoalescing.cpp
-+++ b/IGC/Compiler/CISACodeGen/ConstantCoalescing.cpp
-@@ -224,7 +224,7 @@ static void checkInsertExtractMatch(InsertElementInst* insertInst, Value* base,
-
- static bool canReplaceInsert(InsertElementInst* insertElt)
- {
-- VectorType* VTy = cast<VectorType>(insertElt->getOperand(0)->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(insertElt->getOperand(0)->getType());
- ConstantInt* index = dyn_cast<ConstantInt>(insertElt->getOperand(2));
- if (!index || index->getZExtValue() != VTy->getNumElements() - 1)
- {
-@@ -312,7 +312,7 @@ void ConstantCoalescing::VectorizePrep(llvm::BasicBlock* bb)
- {
- if (load->getType()->isVectorTy() && wiAns->isUniform(load))
- {
-- srcNElts = (uint32_t)cast<VectorType>(load->getType())->getNumElements();
-+ srcNElts = (uint32_t)cast<IGCLLVM::FixedVectorType>(load->getType())->getNumElements();
- DenseMap<uint64_t, Instruction*> extractElementMap;
-
- for (auto iter = load->user_begin(); iter != load->user_end(); iter++)
-@@ -396,7 +396,7 @@ bool ConstantCoalescing::isProfitableLoad(
- (isa<LoadInst>(I) && wiAns->isUniform(I)) ?
- 16 : 4;
-
-- if (cast<VectorType>(LoadTy)->getNumElements() > MaxVectorInput)
-+ if (cast<IGCLLVM::FixedVectorType>(LoadTy)->getNumElements() > MaxVectorInput)
- return false;
-
- MaxEltPlus = CheckVectorElementUses(I);
-@@ -1787,7 +1787,7 @@ void ConstantCoalescing::AdjustChunk(BufChunk* cov_chunk, uint start_adj, uint s
- WIAnalysis::WIDependancy loadDep = wiAns->whichDepend(cov_chunk->chunkIO);
- irBuilder->SetInsertPoint(cov_chunk->chunkIO->getNextNode());
- Value* vec = UndefValue::get(originalType);
-- for (unsigned i = 0; i < cast<VectorType>(originalType)->getNumElements(); i++)
-+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(originalType)->getNumElements(); i++)
- {
- Value* channel = irBuilder->CreateExtractElement(
- cov_chunk->chunkIO, irBuilder->getInt32(i + start_adj));
-@@ -1851,7 +1851,7 @@ void ConstantCoalescing::MoveExtracts(BufChunk* cov_chunk, Instruction* load, ui
- irBuilder->SetInsertPoint(load->getNextNode());
- Type* vecType = load->getType();
- Value* vec = UndefValue::get(vecType);
-- for (unsigned i = 0; i < cast<VectorType>(vecType)->getNumElements(); i++)
-+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(vecType)->getNumElements(); i++)
- {
- Value* channel = irBuilder->CreateExtractElement(
- cov_chunk->chunkIO, irBuilder->getInt32(i + start_adj));
-@@ -1915,7 +1915,7 @@ void ConstantCoalescing::EnlargeChunk(BufChunk* cov_chunk, uint size_adj)
- WIAnalysis::WIDependancy loadDep = wiAns->whichDepend(cov_chunk->chunkIO);
- irBuilder->SetInsertPoint(cov_chunk->chunkIO->getNextNode());
- Value* vec = UndefValue::get(originalType);
-- for (unsigned i = 0; i < cast<VectorType>(originalType)->getNumElements(); i++)
-+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(originalType)->getNumElements(); i++)
- {
- Value* channel = irBuilder->CreateExtractElement(
- cov_chunk->chunkIO, irBuilder->getInt32(i));
-@@ -2343,7 +2343,7 @@ void ConstantCoalescing::ReplaceLoadWithSamplerLoad(
- if (dstTy->isVectorTy())
- {
- result = UndefValue::get(dstTy);
-- for (uint i = 0; i < cast<VectorType>(dstTy)->getNumElements(); i++)
-+ for (uint i = 0; i < cast<IGCLLVM::FixedVectorType>(dstTy)->getNumElements(); i++)
- {
- Value* tmpData = ExtractFromSamplerData(cast<VectorType>(dstTy)->getElementType(), i);
- result = irBuilder->CreateInsertElement(result, tmpData, irBuilder->getInt32(i));
-diff --git a/IGC/Compiler/CISACodeGen/DeSSA.cpp b/IGC/Compiler/CISACodeGen/DeSSA.cpp
-index f540dc11..6fab0246 100644
---- a/IGC/Compiler/CISACodeGen/DeSSA.cpp
-+++ b/IGC/Compiler/CISACodeGen/DeSSA.cpp
-@@ -83,6 +83,7 @@ IN THE SOFTWARE.
- #include "Compiler/IGCPassSupport.h"
- #include "common/LLVMWarningsPush.hpp"
- #include <llvm/IR/InstIterator.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include <algorithm>
- #include "Probe/Assertion.h"
-@@ -1284,7 +1285,7 @@ int DeSSA::checkInsertElementAlias(
- //
- // If found, return the actual vector size;
- // otherwise, return 0.
-- VectorType* VTy = cast<VectorType>(IEI->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(IEI->getType());
- IGC_ASSERT(nullptr != VTy);
- int nelts = (int)VTy->getNumElements();
- AllIEIs.resize(nelts, nullptr);
-diff --git a/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp b/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp
-index 3ab1cc5f..4502ef62 100644
---- a/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp
-+++ b/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp
-@@ -53,6 +53,7 @@ IN THE SOFTWARE.
- #include "Compiler/IGCPassSupport.h"
- #include "common/LLVMWarningsPush.hpp"
- #include "llvmWrapper/IR/Instructions.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "llvm/Support/Path.h"
- #include "llvmWrapper/IR/Intrinsics.h"
- #include "common/LLVMWarningsPop.hpp"
-@@ -1165,7 +1166,7 @@ bool EmitPass::canRelocatePhiMov(
- if (dst != src)
- {
- int numElt = 1;
-- if (VectorType * vTy = dyn_cast<VectorType>(PN->getType()))
-+ if (IGCLLVM::FixedVectorType * vTy = dyn_cast<IGCLLVM::FixedVectorType>(PN->getType()))
- {
- numElt = int_cast<int>(vTy->getNumElements());
- }
-@@ -1302,7 +1303,7 @@ void EmitPass::MovPhiSources(llvm::BasicBlock* aBB)
- phiSrcDstList.push_back(phiInfo);
-
- int numElt = 0;
-- if (VectorType * vTy = dyn_cast<VectorType>(PN->getType()))
-+ if (IGCLLVM::FixedVectorType * vTy = dyn_cast<IGCLLVM::FixedVectorType>(PN->getType()))
- {
- numElt = int_cast<int>(vTy->getNumElements());
- }
-@@ -5375,7 +5376,7 @@ void EmitPass::emitLegacySimdBlockWrite(llvm::Instruction* inst, llvm::Value* pt
- bool useA64 = isA64Ptr(ptrType, m_currShader->GetContext());
-
- Type* Ty = dataPtr->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- uint32_t nbElements = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
-
- uint32_t typeSizeInBytes = Ty->getScalarSizeInBits() / 8;
-@@ -5621,7 +5622,7 @@ void EmitPass::emitLegacySimdBlockRead(llvm::Instruction* inst, llvm::Value* ptr
- bool useA64 = isA64Ptr(ptrType, m_currShader->GetContext());
-
- Type* Ty = inst->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- uint32_t nbElements = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
-
- uint32_t typeSizeInBytes = Ty->getScalarSizeInBits() / 8;
-@@ -5913,7 +5914,7 @@ void EmitPass::emitMediaBlockIO(const llvm::GenIntrinsicInst* inst, bool isRead)
- };
-
- uint nElts = isa<VectorType>(pDataType) ?
-- (uint)cast<VectorType>(pDataType)->getNumElements() :
-+ (uint)cast<IGCLLVM::FixedVectorType>(pDataType)->getNumElements() :
- 1;
-
- // Now, do the copies.
-@@ -6003,7 +6004,7 @@ void EmitPass::emitSimdMediaBlockRead(llvm::Instruction* inst)
- uint32_t nbElements = 1;
- if (inst->getType()->isVectorTy())
- {
-- nbElements = (uint32_t)cast<VectorType>(inst->getType())->getNumElements();
-+ nbElements = (uint32_t)cast<IGCLLVM::FixedVectorType>(inst->getType())->getNumElements();
- }
- IGC_ASSERT_MESSAGE(nbElements <= 8, "InValid Vector Size");
-
-@@ -6247,7 +6248,7 @@ void EmitPass::emitSimdMediaBlockWrite(llvm::Instruction* inst)
- uint32_t nbElements = 1;
- if (dataPtr->getType()->isVectorTy())
- {
-- nbElements = (uint32_t)cast<VectorType>(dataPtr->getType())->getNumElements();
-+ nbElements = (uint32_t)cast<IGCLLVM::FixedVectorType>(dataPtr->getType())->getNumElements();
- }
- IGC_ASSERT_MESSAGE(nbElements <= 8, "InValid Vector Size");
-
-@@ -8993,8 +8994,8 @@ void EmitPass::emitBitCast(llvm::BitCastInst* btCst)
- {
- Type* srcType = btCst->getOperand(0)->getType();
- Type* dstType = btCst->getType();
-- unsigned int numSrcElement = srcType->isVectorTy() ? (unsigned)cast<VectorType>(srcType)->getNumElements() : 1;
-- unsigned int numDstElement = dstType->isVectorTy() ? (unsigned)cast<VectorType>(dstType)->getNumElements() : 1;
-+ unsigned int numSrcElement = srcType->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(srcType)->getNumElements() : 1;
-+ unsigned int numDstElement = dstType->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(dstType)->getNumElements() : 1;
-
- if (srcType->isPointerTy())
- {
-@@ -9468,7 +9469,7 @@ void EmitPass::emitLoad3DInner(LdRawIntrinsic* inst, ResourceDescriptor& resourc
- {
- IGC_ASSERT_MESSAGE(predDefSurface != ESURFACE_STATELESS, "scratch cannot be uniform");
- Type* loadType = inst->getType();
-- uint numElement = loadType->isVectorTy() ? (uint)cast<VectorType>(loadType)->getNumElements() : 1;
-+ uint numElement = loadType->isVectorTy() ? (uint)cast<IGCLLVM::FixedVectorType>(loadType)->getNumElements() : 1;
- if (predDefSurface == ESURFACE_SLM)
- {
- IGC_ASSERT(numElement <= 4);
-@@ -10795,7 +10796,7 @@ void EmitPass::emitInsert(llvm::Instruction* inst)
- pVecVar = GetSymbol(pVec);
- if (pVecVar != pInstVar)
- {
-- emitVectorCopy(pInstVar, pVecVar, int_cast<unsigned>(dyn_cast<VectorType>(pVecType)->getNumElements()));
-+ emitVectorCopy(pInstVar, pVecVar, int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(pVecType)->getNumElements()));
- }
- }
- }
-@@ -14596,7 +14597,7 @@ bool EmitPass::isUniformStoreOCL(llvm::StoreInst* SI)
-
- Value* storeVal = SI->getValueOperand();
- Type* Ty = storeVal->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- uint32_t elts = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
- Type* eltTy = VTy ? VTy->getElementType() : Ty;
-
-@@ -14626,7 +14627,7 @@ void EmitPass::emitVectorBitCast(llvm::BitCastInst* BCI)
- if (srcTy->isVectorTy())
- {
- srcEltTy = cast<VectorType>(srcTy)->getElementType();
-- srcNElts = (uint32_t)cast<VectorType>(srcTy)->getNumElements();
-+ srcNElts = (uint32_t)cast<IGCLLVM::FixedVectorType>(srcTy)->getNumElements();
- }
- else
- {
-@@ -14636,7 +14637,7 @@ void EmitPass::emitVectorBitCast(llvm::BitCastInst* BCI)
- if (dstTy->isVectorTy())
- {
- dstEltTy = cast<VectorType>(dstTy)->getElementType();
-- dstNElts = (uint32_t)cast<VectorType>(dstTy)->getNumElements();
-+ dstNElts = (uint32_t)cast<IGCLLVM::FixedVectorType>(dstTy)->getNumElements();
- }
- else
- {
-@@ -15215,7 +15216,7 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
- }
-
- Type* Ty = inst->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- Type* eltTy = VTy ? VTy->getElementType() : Ty;
- uint32_t eltBytes = GetScalarTypeSizeInRegister(eltTy);
- IGC_ASSERT_MESSAGE((eltBytes == 1) || (eltBytes == 2) || (eltBytes == 4) || (eltBytes == 8),
-@@ -15667,7 +15668,7 @@ void EmitPass::emitVectorStore(StoreInst* inst, Value* offset, ConstantInt* immO
-
- Value* storedVal = inst->getValueOperand();
- Type* Ty = storedVal->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- Type* eltTy = VTy ? VTy->getElementType() : Ty;
- uint32_t eltBytes = GetScalarTypeSizeInRegister(eltTy);
-
-@@ -16471,7 +16472,7 @@ void EmitPass::emitCopyAll(CVariable* Dst, CVariable* Src, llvm::Type* Ty)
- }
- else if (Ty->isVectorTy())
- {
-- unsigned NElts = (unsigned)cast<VectorType>(Ty)->getNumElements();
-+ unsigned NElts = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements();
- emitVectorCopy(Dst, Src, NElts);
- }
- else
-diff --git a/IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp b/IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp
-index 28248f30..767b477a 100644
---- a/IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp
-+++ b/IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp
-@@ -1961,7 +1961,7 @@ bool InstExpander::visitExtractElement(ExtractElementInst& EEI) {
- // later.
-
- Value* V = EEI.getVectorOperand();
-- unsigned NumElts = (unsigned)cast<VectorType>(V->getType())->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(V->getType())->getNumElements();
- V = IRB->CreateBitCast(V, Emu->getV2Int32Ty(NumElts));
- // Re-calculate indices to Lo and Hi parts.
- Value* Idx = EEI.getIndexOperand();
-@@ -1998,7 +1998,7 @@ bool InstExpander::visitInsertElement(InsertElementInst& IEI) {
-
- // Create the emulated vector.
- Value* NewVal = IEI.getOperand(0);
-- unsigned NumElts = (unsigned)cast<VectorType>(NewVal->getType())->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(NewVal->getType())->getNumElements();
- NewVal = IRB->CreateBitCast(NewVal, Emu->getV2Int32Ty(NumElts));
- // Re-calculate indices to Lo and Hi parts.
- Value* Idx = IEI.getOperand(2);
-diff --git a/IGC/Compiler/CISACodeGen/GenIRLowering.cpp b/IGC/Compiler/CISACodeGen/GenIRLowering.cpp
-index c74a2ac6..78e8a4aa 100644
---- a/IGC/Compiler/CISACodeGen/GenIRLowering.cpp
-+++ b/IGC/Compiler/CISACodeGen/GenIRLowering.cpp
-@@ -453,7 +453,7 @@ Value* GEPLowering::getSExtOrTrunc(Value* Val, Type* NewTy) const {
-
- IGC_ASSERT_MESSAGE(OldTy->isIntOrIntVectorTy(), "Index should be Integer or vector of Integer!");
-
-- if (auto OldVecTy = dyn_cast<VectorType>(OldTy)) {
-+ if (auto OldVecTy = dyn_cast<IGCLLVM::FixedVectorType>(OldTy)) {
- OldWidth = (unsigned)OldVecTy->getNumElements() * OldVecTy->getElementType()->getIntegerBitWidth();
- NewWidth = (unsigned)OldVecTy->getNumElements() * NewTy->getIntegerBitWidth();
- }
-@@ -805,7 +805,7 @@ bool GEPLowering::lowerGetElementPtrInst(GetElementPtrInst* GEP) const
- }
- else
- {
-- if (auto NewIdxVT = dyn_cast<VectorType>(NewIdx->getType())) {
-+ if (auto NewIdxVT = dyn_cast<IGCLLVM::FixedVectorType>(NewIdx->getType())) {
- Value* result = llvm::UndefValue::get(FixedVectorType::get(PtrMathTy, (unsigned)NewIdxVT->getNumElements()));
- for (uint32_t j = 0; j < (uint32_t)NewIdxVT->getNumElements(); j++) {
- result = Builder->CreateInsertElement(result, PointerValue, Builder->getInt32(j));
-diff --git a/IGC/Compiler/CISACodeGen/GenSimplification.cpp b/IGC/Compiler/CISACodeGen/GenSimplification.cpp
-index 8c38f229..f432061e 100644
---- a/IGC/Compiler/CISACodeGen/GenSimplification.cpp
-+++ b/IGC/Compiler/CISACodeGen/GenSimplification.cpp
-@@ -35,6 +35,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/InstVisitor.h>
- #include <llvm/IR/Instruction.h>
- #include <llvm/Support/raw_ostream.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "Probe/Assertion.h"
-
-@@ -164,7 +165,7 @@ bool GenSimplification::simplifyVectorPHINodeCase2(PHINode& PN) const {
-
- Type* Ty = PN.getType();
- Type* EltTy = Ty->getScalarType();
-- unsigned NumElts = (unsigned)cast<VectorType>(Ty)->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements();
-
- SmallVector<Value*, 8> Lanes;
- SmallVector<SmallVector<Value*, 8>, 4> Values;
-@@ -238,7 +239,7 @@ void GenSimplification::visitPHINode(PHINode& PN) {
- void GenSimplification::visitExtractElement(ExtractElementInst& EEI) {
- // Skip non-2-element vector.
- Value* Vec = EEI.getVectorOperand();
-- VectorType* VTy = cast<VectorType>(Vec->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(Vec->getType());
- if (VTy->getNumElements() != 2)
- return;
-
-diff --git a/IGC/Compiler/CISACodeGen/GeometryShaderLowering.cpp b/IGC/Compiler/CISACodeGen/GeometryShaderLowering.cpp
-index e00e8469..a60b9892 100644
---- a/IGC/Compiler/CISACodeGen/GeometryShaderLowering.cpp
-+++ b/IGC/Compiler/CISACodeGen/GeometryShaderLowering.cpp
-@@ -33,6 +33,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/PassManager.h>
- #include <llvm/IR/IRBuilder.h>
- #include <llvm/IR/Verifier.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "Compiler/InitializePasses.h"
- #include "Probe/Assertion.h"
-@@ -507,7 +508,7 @@ void GeometryShaderLowering::AddURBRead(
- {
- Value* vec = UndefValue::get(inst->getType());
- IRBuilder<> builder(inst);
-- for (unsigned int i = 0; i < cast<VectorType>(inst->getType())->getNumElements(); i++)
-+ for (unsigned int i = 0; i < cast<IGCLLVM::FixedVectorType>(inst->getType())->getNumElements(); i++)
- {
- Value* vecElement = builder.CreateExtractElement(urbRead, builder.getInt32(i));
- vec = builder.CreateInsertElement(vec, vecElement, builder.getInt32(i));
-diff --git a/IGC/Compiler/CISACodeGen/LdShrink.cpp b/IGC/Compiler/CISACodeGen/LdShrink.cpp
-index d89fbd0e..2df06df2 100644
---- a/IGC/Compiler/CISACodeGen/LdShrink.cpp
-+++ b/IGC/Compiler/CISACodeGen/LdShrink.cpp
-@@ -30,6 +30,7 @@ IN THE SOFTWARE.
- #include <llvm/Support/Debug.h>
- #include <llvm/Support/MathExtras.h>
- #include <llvm/Support/raw_ostream.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
- #include "Compiler/IGCPassSupport.h"
-@@ -79,7 +80,7 @@ IGC_INITIALIZE_PASS_BEGIN(LdShrink, PASS_FLAG, PASS_DESC, PASS_CFG_ONLY, PASS_AN
- IGC_INITIALIZE_PASS_END(LdShrink, PASS_FLAG, PASS_DESC, PASS_CFG_ONLY, PASS_ANALYSIS)
-
- unsigned LdShrink::getExtractIndexMask(LoadInst* LI) const {
-- VectorType* VTy = dyn_cast<VectorType>(LI->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(LI->getType());
- // Skip non-vector loads.
- if (!VTy)
- return 0;
-@@ -91,9 +92,12 @@ unsigned LdShrink::getExtractIndexMask(LoadInst* LI) const {
- Type* Ty = VTy->getScalarType();
- // Skip non-BYTE addressable data types. So far, check integer types
- // only.
-- if (IntegerType * ITy = dyn_cast<IntegerType>(Ty))
-- if (!ITy->isPowerOf2ByteWidth())
-+ if (IntegerType * ITy = dyn_cast<IntegerType>(Ty)) {
-+ // Unroll isPowerOf2ByteWidth, it was removed in LLVM 12.
-+ unsigned BitWidth = ITy->getBitWidth();
-+ if (!((BitWidth > 7) && isPowerOf2_32(BitWidth)))
- return 0;
-+ }
-
- unsigned Mask = 0; // Maxmimally 32 elements.
-
-diff --git a/IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp b/IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp
-index c12b20d5..5245117d 100644
---- a/IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp
-+++ b/IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp
-@@ -634,7 +634,7 @@ void TransposeHelper::handleGEPInst(
- }
- else
- {
-- arr_sz = (unsigned)cast<VectorType>(T)->getNumElements();
-+ arr_sz = (unsigned)cast<IGCLLVM::FixedVectorType>(T)->getNumElements();
- }
- T = cast<VectorType>(T)->getElementType();
- }
-@@ -656,7 +656,7 @@ void TransposeHelper::handleGEPInst(
- }
- else if (T->isVectorTy())
- {
-- arr_sz = (unsigned)cast<VectorType>(T)->getNumElements();
-+ arr_sz = (unsigned)cast<IGCLLVM::FixedVectorType>(T)->getNumElements();
- T = cast<VectorType>(T)->getElementType();
- }
- else
-@@ -716,7 +716,7 @@ void TransposeHelperPromote::handleLoadInst(
- IRBuilder<> IRB(pLoad);
- IGC_ASSERT(nullptr != pLoad->getType());
- unsigned N = pLoad->getType()->isVectorTy()
-- ? (unsigned)cast<VectorType>(pLoad->getType())->getNumElements()
-+ ? (unsigned)cast<IGCLLVM::FixedVectorType>(pLoad->getType())->getNumElements()
- : 1;
- Value* Val = loadEltsFromVecAlloca(N, pVecAlloca, pScalarizedIdx, IRB, pLoad->getType()->getScalarType());
- pLoad->replaceAllUsesWith(Val);
-@@ -748,7 +748,7 @@ void TransposeHelperPromote::handleStoreInst(
- // %v1 = extractelement <2 x float> %v, i32 1
- // %w1 = insertelement <32 x float> %w0, float %v1, i32 %idx+1
- // store <32 x float> %w1, <32 x float>* %ptr1
-- for (unsigned i = 0, e = (unsigned)cast<VectorType>(pStoreVal->getType())->getNumElements(); i < e; ++i)
-+ for (unsigned i = 0, e = (unsigned)cast<IGCLLVM::FixedVectorType>(pStoreVal->getType())->getNumElements(); i < e; ++i)
- {
- Value* VectorIdx = ConstantInt::get(pScalarizedIdx->getType(), i);
- auto Val = IRB.CreateExtractElement(pStoreVal, VectorIdx);
-diff --git a/IGC/Compiler/CISACodeGen/MemOpt.cpp b/IGC/Compiler/CISACodeGen/MemOpt.cpp
-index e4279cca..aa788b11 100644
---- a/IGC/Compiler/CISACodeGen/MemOpt.cpp
-+++ b/IGC/Compiler/CISACodeGen/MemOpt.cpp
-@@ -125,7 +125,7 @@ namespace {
- MemRefListTy& MemRefs, TrivialMemRefListTy& ToOpt);
-
- unsigned getNumElements(Type* Ty) const {
-- return Ty->isVectorTy() ? (unsigned)cast<VectorType>(Ty)->getNumElements() : 1;
-+ return Ty->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements() : 1;
- }
-
- MemoryLocation getLocation(Instruction* I) const {
-@@ -797,7 +797,7 @@ bool MemOpt::mergeLoad(LoadInst* LeadingLoad,
- Pos = unsigned((std::get<1>(I) - FirstOffset) / LdScalarSize);
-
- if (Ty->isVectorTy()) {
-- if (Pos + cast<VectorType>(Ty)->getNumElements() > NumElts) {
-+ if (Pos + cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements() > NumElts) {
- // This implies we're trying to extract an element from our new load
- // with an index > the size of the new load. If this happens,
- // we'll generate correct code if it does since we don't remove the
-@@ -805,7 +805,7 @@ bool MemOpt::mergeLoad(LoadInst* LeadingLoad,
- continue;
- }
- Value* Val = UndefValue::get(Ty);
-- for (unsigned i = 0, e = (unsigned)cast<VectorType>(Ty)->getNumElements(); i != e; ++i) {
-+ for (unsigned i = 0, e = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements(); i != e; ++i) {
- Value* Ex = Builder.CreateExtractElement(NewLoad, Builder.getInt32(Pos + i));
- Ex = createBitOrPointerCast(Ex, ScalarTy, Builder);
- Val = Builder.CreateInsertElement(Val, Ex, Builder.getInt32(i));
-@@ -1083,7 +1083,7 @@ bool MemOpt::mergeStore(StoreInst* LeadingStore,
- IGC_ASSERT(hasSameSize(ScalarTy, LeadingStoreScalarType));
-
- if (Ty->isVectorTy()) {
-- for (unsigned i = 0, e = (unsigned)cast<VectorType>(Ty)->getNumElements(); i != e; ++i) {
-+ for (unsigned i = 0, e = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements(); i != e; ++i) {
- Value* Ex = Builder.CreateExtractElement(Val, Builder.getInt32(i));
- Ex = createBitOrPointerCast(Ex, LeadingStoreScalarType, Builder);
- NewStoreVal = Builder.CreateInsertElement(NewStoreVal, Ex,
-diff --git a/IGC/Compiler/CISACodeGen/MemOpt2.cpp b/IGC/Compiler/CISACodeGen/MemOpt2.cpp
-index 4b2628d2..20115c73 100644
---- a/IGC/Compiler/CISACodeGen/MemOpt2.cpp
-+++ b/IGC/Compiler/CISACodeGen/MemOpt2.cpp
-@@ -32,6 +32,7 @@ IN THE SOFTWARE.
- #include <llvm/Support/Debug.h>
- #include <llvm/Support/raw_ostream.h>
- #include <llvm/Transforms/Utils/Local.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "GenISAIntrinsics/GenIntrinsics.h"
-
-@@ -124,7 +125,7 @@ namespace {
- if (!Ty->isSingleValueType())
- return UINT_MAX;
- // Simply return 1 so far for scalar types.
-- VectorType* VecTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VecTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- if (!VecTy)
- return 1;
- // Check how that vector is used.
-@@ -153,7 +154,7 @@ namespace {
- return UINT_MAX;
- unsigned EltByte = (Ty->getScalarSizeInBits() + 7) / 8;
- // Simply return 1 so far for scalar types.
-- VectorType* VecTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VecTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- if (!VecTy)
- return EltByte;
- // Check how that vector is used.
-diff --git a/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp b/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp
-index 5baff64f..032d127a 100644
---- a/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp
-+++ b/IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp
-@@ -410,7 +410,7 @@ namespace IGC
- unsigned int numElements = 1;
- if (baseType->isVectorTy())
- {
-- numElements = (unsigned)cast<VectorType>(baseType)->getNumElements();
-+ numElements = (unsigned)cast<IGCLLVM::FixedVectorType>(baseType)->getNumElements();
- baseType = cast<VectorType>(baseType)->getElementType();
- }
-
-diff --git a/IGC/Compiler/CISACodeGen/PatternMatchPass.cpp b/IGC/Compiler/CISACodeGen/PatternMatchPass.cpp
-index 356f1141..52396304 100644
---- a/IGC/Compiler/CISACodeGen/PatternMatchPass.cpp
-+++ b/IGC/Compiler/CISACodeGen/PatternMatchPass.cpp
-@@ -2916,8 +2916,8 @@ namespace IGC
- llvm::Type* srcTy = bTInst->getOperand(0)->getType();
- llvm::Type* dstTy = bTInst->getType();
-
-- srcNElts = (srcTy->isVectorTy()) ? (uint32_t)cast<VectorType>(srcTy)->getNumElements() : 1;
-- dstNElts = (dstTy->isVectorTy()) ? (uint32_t)cast<VectorType>(dstTy)->getNumElements() : 1;
-+ srcNElts = (srcTy->isVectorTy()) ? (uint32_t)cast<IGCLLVM::FixedVectorType>(srcTy)->getNumElements() : 1;
-+ dstNElts = (dstTy->isVectorTy()) ? (uint32_t)cast<IGCLLVM::FixedVectorType>(dstTy)->getNumElements() : 1;
-
- if (srcNElts < dstNElts && srcTy->getScalarSizeInBits() < 64)
- {
-diff --git a/IGC/Compiler/CISACodeGen/PushAnalysis.cpp b/IGC/Compiler/CISACodeGen/PushAnalysis.cpp
-index ba8c2770..8da82db0 100644
---- a/IGC/Compiler/CISACodeGen/PushAnalysis.cpp
-+++ b/IGC/Compiler/CISACodeGen/PushAnalysis.cpp
-@@ -899,7 +899,7 @@ namespace IGC
-
- if (pTypeToPush->isVectorTy())
- {
-- num_elms = (unsigned)cast<VectorType>(pTypeToPush)->getNumElements();
-+ num_elms = (unsigned)cast<IGCLLVM::FixedVectorType>(pTypeToPush)->getNumElements();
- pTypeToPush = cast<VectorType>(pTypeToPush)->getElementType();
- llvm::Type* pVecTy = IGCLLVM::FixedVectorType::get(pTypeToPush, num_elms);
- pReplacedInst = llvm::UndefValue::get(pVecTy);
-@@ -1102,7 +1102,7 @@ namespace IGC
- }
-
- unsigned num_elms =
-- inst->getType()->isVectorTy() ? (unsigned)cast<VectorType>(inst->getType())->getNumElements() : 1;
-+ inst->getType()->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(inst->getType())->getNumElements() : 1;
- llvm::Type* pTypeToPush = inst->getType();
- llvm::Value* replaceVector = nullptr;
- unsigned int numberChannelReplaced = 0;
-diff --git a/IGC/Compiler/CISACodeGen/RegisterEstimator.cpp b/IGC/Compiler/CISACodeGen/RegisterEstimator.cpp
-index 95b937e7..1c6544a4 100644
---- a/IGC/Compiler/CISACodeGen/RegisterEstimator.cpp
-+++ b/IGC/Compiler/CISACodeGen/RegisterEstimator.cpp
-@@ -41,6 +41,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/IRBuilder.h>
- #include <llvm/IR/InstIterator.h>
- #include <llvm/Support/MathExtras.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "Probe/Assertion.h"
-
-@@ -146,7 +147,7 @@ RegUse RegisterEstimator::estimateNumOfRegs(Value* V) const
- Type* Ty = V->getType();
- if (!Ty->isVoidTy())
- {
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- Type* eltTy = VTy ? VTy->getElementType() : Ty;
- uint32_t nelts = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
- uint32_t eltBits = (uint32_t)m_DL->getTypeSizeInBits(eltTy);
-diff --git a/IGC/Compiler/CISACodeGen/RegisterPressureEstimate.hpp b/IGC/Compiler/CISACodeGen/RegisterPressureEstimate.hpp
-index beac138d..ceeafa48 100644
---- a/IGC/Compiler/CISACodeGen/RegisterPressureEstimate.hpp
-+++ b/IGC/Compiler/CISACodeGen/RegisterPressureEstimate.hpp
-@@ -42,6 +42,7 @@ See LRCENSE.TXT for details.
- #include "llvm/Pass.h"
- #include <llvm/IR/InstVisitor.h>
- #include "llvm/Analysis/LoopInfo.h"
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "Compiler/IGCPassSupport.h"
- #include "Compiler/CISACodeGen/WIAnalysis.hpp"
-@@ -240,7 +241,7 @@ namespace IGC
- auto Ty = V->getType();
- if (Ty->isVoidTy())
- return 0;
-- auto VTy = llvm::dyn_cast<llvm::VectorType>(Ty);
-+ auto VTy = llvm::dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- auto eltTy = VTy ? VTy->getElementType() : Ty;
- uint32_t nelts = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
- uint32_t eltBits = (uint32_t)m_DL->getTypeSizeInBits(eltTy);
-diff --git a/IGC/Compiler/CISACodeGen/SLMConstProp.cpp b/IGC/Compiler/CISACodeGen/SLMConstProp.cpp
-index 962083f4..26a7b8be 100644
---- a/IGC/Compiler/CISACodeGen/SLMConstProp.cpp
-+++ b/IGC/Compiler/CISACodeGen/SLMConstProp.cpp
-@@ -39,6 +39,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/InstIterator.h>
- #include <llvm/Support/Debug.h>
- #include <llvm/Support/MathExtras.h>
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPop.hpp"
- #include <vector>
- #include "Probe/Assertion.h"
-@@ -629,7 +630,7 @@ bool SLMConstProp::isEqual(Constant* C0, Constant* C1)
-
- bool SLMConstProp::isFloatType(Type* Ty)
- {
-- if (VectorType * vTy = dyn_cast<VectorType>(Ty))
-+ if (IGCLLVM::FixedVectorType * vTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty))
- {
- if (vTy->getNumElements() > 1)
- {
-diff --git a/IGC/Compiler/CISACodeGen/ScalarizerCodeGen.cpp b/IGC/Compiler/CISACodeGen/ScalarizerCodeGen.cpp
-index ce816416..32ab79c1 100644
---- a/IGC/Compiler/CISACodeGen/ScalarizerCodeGen.cpp
-+++ b/IGC/Compiler/CISACodeGen/ScalarizerCodeGen.cpp
-@@ -66,7 +66,7 @@ void ScalarizerCodeGen::visitBinaryOperator(llvm::BinaryOperator& I)
- {
- bool isNewTypeVector = false;
-
-- VectorType* instType = cast<VectorType>(I.getType());
-+ IGCLLVM::FixedVectorType* instType = cast<IGCLLVM::FixedVectorType>(I.getType());
- unsigned numElements = int_cast<unsigned>(instType->getNumElements());
- unsigned scalarSize = instType->getScalarSizeInBits();
- unsigned newScalarBits = numElements * scalarSize;
-@@ -111,7 +111,7 @@ void ScalarizerCodeGen::visitBinaryOperator(llvm::BinaryOperator& I)
- }
- else
- {
-- VectorType* newVecType = cast<VectorType>(newType);
-+ IGCLLVM::FixedVectorType* newVecType = cast<IGCLLVM::FixedVectorType>(newType);
- unsigned newVecTypeNumEle = int_cast<unsigned>(newVecType->getNumElements());
- Value* ieLogicOp = UndefValue::get(newType);
- for (unsigned i = 0; i < newVecTypeNumEle; i++)
-diff --git a/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp b/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
-index d7baf806..e6fbdf23 100644
---- a/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
-+++ b/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
-@@ -589,12 +589,14 @@ static void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSi
- {
- mpm.add(createPruneUnusedArgumentsPass());
-
-+#if LLVM_VERSION_MAJOR < 12
- if (IGC_GET_FLAG_VALUE(FunctionControl) == FLAG_FCALL_DEFAULT)
- {
- // Don't run IPConstantProp when debugging function calls, to avoid folding function arg/ret constants
- mpm.add(createIPConstantPropagationPass());
- }
- mpm.add(createConstantPropagationPass());
-+#endif
- mpm.add(createDeadCodeEliminationPass());
- mpm.add(createCFGSimplificationPass());
- }
-@@ -1475,8 +1477,10 @@ void OptimizeIR(CodeGenContext* const pContext)
- // possible which potentially allows late stage code sinking of
- // those calls by the instruction combiner.
- mpm.add(createPostOrderFunctionAttrsLegacyPass());
-+#if LLVM_VERSION_MAJOR < 12
- mpm.add(createConstantPropagationPass());
- mpm.add(createIPConstantPropagationPass());
-+#endif
- }
-
- // enable this only when Pooled EU is not supported
-diff --git a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-index 87ba2751..c1f4a419 100644
---- a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-+++ b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-@@ -30,6 +30,7 @@ IN THE SOFTWARE.
- #include <llvmWrapper/IR/DerivedTypes.h>
- #include <llvm/IR/InstIterator.h>
- #include <llvm/IR/Operator.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "GenISAIntrinsics/GenIntrinsics.h"
- #include "GenISAIntrinsics/GenIntrinsicInst.h"
-@@ -577,7 +578,7 @@ static bool isPayloadHeader(Value* V) {
- Argument* Arg = dyn_cast<Argument>(V);
- if (!Arg || !Arg->hasName())
- return false;
-- VectorType* VTy = dyn_cast<VectorType>(Arg->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Arg->getType());
- if (!VTy || VTy->getNumElements() != 8 ||
- !VTy->getElementType()->isIntegerTy(32))
- return false;
-@@ -588,7 +589,7 @@ static bool isR0(Value* V) {
- Argument* Arg = dyn_cast<Argument>(V);
- if (!Arg || !Arg->hasName())
- return false;
-- VectorType* VTy = dyn_cast<VectorType>(Arg->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Arg->getType());
- if (!VTy || VTy->getNumElements() != 8 ||
- !VTy->getElementType()->isIntegerTy(32))
- return false;
-@@ -599,7 +600,7 @@ static bool isEnqueuedLocalSize(Value* V) {
- Argument* Arg = dyn_cast<Argument>(V);
- if (!Arg || !Arg->hasName())
- return false;
-- VectorType* VTy = dyn_cast<VectorType>(Arg->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Arg->getType());
- if (!VTy || VTy->getNumElements() != 3 ||
- !VTy->getElementType()->isIntegerTy(32))
- return false;
-@@ -994,7 +995,11 @@ static bool hasLongStridedLdStInLoop(Function* F, LoopInfo* LI, WIAnalysis* WI)
- // Collect innermost simple loop.
- for (auto I = LI->begin(), E = LI->end(); I != E; ++I) {
- auto L = *I;
-+#if LLVM_VERSION_MAJOR >= 12
-+ if (!L->isInnermost())
-+#else
- if (!L->empty())
-+#endif
- continue;
- if (L->getNumBlocks() != 2)
- continue;
-diff --git a/IGC/Compiler/CISACodeGen/SimplifyConstant.cpp b/IGC/Compiler/CISACodeGen/SimplifyConstant.cpp
-index 73f472b5..0069c4b1 100644
---- a/IGC/Compiler/CISACodeGen/SimplifyConstant.cpp
-+++ b/IGC/Compiler/CISACodeGen/SimplifyConstant.cpp
-@@ -352,7 +352,7 @@ static unsigned getLegalVectorSize(unsigned N) {
- // Check vector size. We may demote the data type if all values can fit into
- // smaller data type.
- //
--static bool checkSize(GlobalVariable* GV, VectorType*& DataType,
-+static bool checkSize(GlobalVariable* GV, IGCLLVM::FixedVectorType*& DataType,
- bool& IsSigned) {
- Constant* Init = GV->getInitializer();
- IGC_ASSERT(isa<ArrayType>(Init->getType()));
-@@ -360,7 +360,7 @@ static bool checkSize(GlobalVariable* GV, VectorType*& DataType,
- unsigned N = (unsigned)ArrayTy->getArrayNumElements();
- Type* BaseTy = ArrayTy->getArrayElementType();
- unsigned VectorSize = 1;
-- if (auto VT = dyn_cast<VectorType>(BaseTy)) {
-+ if (auto VT = dyn_cast<IGCLLVM::FixedVectorType>(BaseTy)) {
- BaseTy = VT->getElementType();
- VectorSize = int_cast<unsigned>(VT->getNumElements());
- N *= VectorSize;
-@@ -483,7 +483,7 @@ static Constant* getConstantVal(Type* VEltTy, Constant* V, bool IsSigned) {
- return ConstantInt::get(VEltTy, IVal, IsSigned);
- }
-
--static void promote(GlobalVariable* GV, VectorType* AllocaType, bool IsSigned,
-+static void promote(GlobalVariable* GV, IGCLLVM::FixedVectorType* AllocaType, bool IsSigned,
- Function* F) {
- // Build the constant vector from constant array.
- unsigned VS = int_cast<unsigned>(AllocaType->getNumElements());
-@@ -507,7 +507,7 @@ static void promote(GlobalVariable* GV, VectorType* AllocaType, bool IsSigned,
- Constant* const Elt = CA->getAggregateElement(i);
- IGC_ASSERT_MESSAGE(nullptr != Elt, "Null AggregateElement");
- if (auto EltTy = dyn_cast<VectorType>(Elt->getType())) {
-- unsigned VectorSize = (unsigned)cast<VectorType>(EltTy)->getNumElements();
-+ unsigned VectorSize = (unsigned)cast<IGCLLVM::FixedVectorType>(EltTy)->getNumElements();
- for (unsigned j = 0; j < VectorSize; ++j) {
- Constant* V = Elt->getAggregateElement(j);
- Vals[i * VectorSize + j] = getConstantVal(VEltTy, V, IsSigned);
-@@ -549,7 +549,7 @@ static void promote(GlobalVariable* GV, VectorType* AllocaType, bool IsSigned,
- unsigned N = 1;
- Value* Offset = Index;
- if (Ty->isVectorTy()) {
-- N = (unsigned)cast<VectorType>(Ty)->getNumElements();
-+ N = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements();
- Offset = Builder.CreateMul(Offset, ConstantInt::get(Offset->getType(), N));
- }
- Value* Val = extractNElts(N, VectorData, Offset, Builder);
-@@ -684,7 +684,7 @@ bool PromoteConstant::runOnFunction(Function& F) {
-
- // If possible demote the data into smaller type. Uses of value will be
- // promoted back with ZExt or SExt.
-- VectorType* AllocaType = nullptr;
-+ IGCLLVM::FixedVectorType* AllocaType = nullptr;
- bool IsSigned = false;
- if (!checkSize(GV, AllocaType, IsSigned))
- continue;
-diff --git a/IGC/Compiler/CISACodeGen/TypeDemote.cpp b/IGC/Compiler/CISACodeGen/TypeDemote.cpp
-index eb7a7b64..b04a0f6e 100644
---- a/IGC/Compiler/CISACodeGen/TypeDemote.cpp
-+++ b/IGC/Compiler/CISACodeGen/TypeDemote.cpp
-@@ -32,6 +32,7 @@ IN THE SOFTWARE.
- #include <llvm/ADT/PostOrderIterator.h>
- #include <llvm/IR/IRBuilder.h>
- #include <llvm/Pass.h>
-+#include <llvmWrapper/IR/DerivedTypes.h>
- #include "common/LLVMWarningsPop.hpp"
- #include "GenISAIntrinsics/GenIntrinsics.h"
- #include "Probe/Assertion.h"
-@@ -288,7 +289,7 @@ bool TypeDemote::demoteOnBasicBlock(BasicBlock* BB) const {
- CastInst* CI = dyn_cast<CastInst>(Index);
- if (CI && (CI->getOpcode() == Instruction::ZExt ||
- CI->getOpcode() == Instruction::SExt)) {
-- unsigned VS = (unsigned)cast<VectorType>(EEI->getVectorOperandType())->getNumElements();
-+ unsigned VS = (unsigned)cast<IGCLLVM::FixedVectorType>(EEI->getVectorOperandType())->getNumElements();
- unsigned N = (unsigned int)CI->getSrcTy()->getPrimitiveSizeInBits();
- unsigned Bound = (N < 32) ? (1U << N) : UINT32_MAX;
- if (VS <= Bound) {
-diff --git a/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.cpp b/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.cpp
-index 1cac7b12..12c4734e 100644
---- a/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.cpp
-+++ b/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.cpp
-@@ -28,6 +28,7 @@ IN THE SOFTWARE.
- #include "Compiler/CodeGenPublic.h"
- #include "common/LLVMWarningsPush.hpp"
- #include <llvm/Support/Debug.h>
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPop.hpp"
- #include <algorithm>
- #include "Probe/Assertion.h"
-@@ -40,13 +41,13 @@ namespace
- // If V is scalar, return 1.
- // if V is vector, return the number of elements.
- inline int getNumElts(Value* V) {
-- VectorType* VTy = dyn_cast<VectorType>(V->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(V->getType());
- return VTy ? (int)VTy->getNumElements() : 1;
- }
-
- inline int getTypeSizeInBits(Type* Ty) {
- int scalarBits = Ty->getScalarSizeInBits();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- return scalarBits * (VTy ? (int)VTy->getNumElements() : 1);
- }
- }
-diff --git a/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.hpp b/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.hpp
-index 56dac17e..42081dca 100644
---- a/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.hpp
-+++ b/IGC/Compiler/CISACodeGen/VariableReuseAnalysis.hpp
-@@ -37,6 +37,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/InstIterator.h>
- #include <llvm/IR/InstVisitor.h>
- #include "llvm/Pass.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "llvm/Support/raw_ostream.h"
- #include "common/LLVMWarningsPop.hpp"
- #include "Compiler/CISACodeGen/RegisterEstimator.hpp"
-@@ -79,7 +80,7 @@ namespace IGC {
- SSubVecDesc(llvm::Value* V)
- : Aliaser(V), BaseVector(V), StartElementOffset(0)
- {
-- llvm::VectorType* VTy = llvm::dyn_cast<llvm::VectorType>(V->getType());
-+ IGCLLVM::FixedVectorType* VTy = llvm::dyn_cast<IGCLLVM::FixedVectorType>(V->getType());
- NumElts = VTy ? (short)VTy->getNumElements() : 1;
- }
-
-diff --git a/IGC/Compiler/CISACodeGen/VectorPreProcess.cpp b/IGC/Compiler/CISACodeGen/VectorPreProcess.cpp
-index 4c2b0644..4cd6a2db 100644
---- a/IGC/Compiler/CISACodeGen/VectorPreProcess.cpp
-+++ b/IGC/Compiler/CISACodeGen/VectorPreProcess.cpp
-@@ -500,7 +500,7 @@ void VectorPreProcess::replaceAllVectorUsesWithScalars(Instruction* VI, ValVecto
- I = VI->getParent()->getFirstNonPHI();
- }
- IRBuilder<> Builder(I);
-- VectorType* VTy = cast<VectorType>(VI->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(VI->getType());
- Value* newVec = UndefValue::get(VTy);
- for (uint32_t i = 0, e = int_cast<uint32_t>(VTy->getNumElements()); i < e; ++i)
- {
-@@ -619,7 +619,7 @@ bool VectorPreProcess::splitStore(
- {
- Instruction* SI = ASI.getInst();
- Value* StoredVal = ASI.getValueOperand();
-- VectorType* VTy = cast<VectorType>(StoredVal->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(StoredVal->getType());
- Type* ETy = VTy->getElementType();
- uint32_t nelts = int_cast<uint32_t>(VTy->getNumElements());
-
-@@ -705,7 +705,7 @@ bool VectorPreProcess::splitStore(
- {
- Type* Ty1 = splitInfo[i].first;
- uint32_t len1 = splitInfo[i].second;
-- VectorType* VTy1 = dyn_cast<VectorType>(Ty1);
-+ IGCLLVM::FixedVectorType* VTy1 = dyn_cast<IGCLLVM::FixedVectorType>(Ty1);
- for (uint32_t j = 0; j < len1; ++j)
- {
- Value* subVec;
-@@ -742,7 +742,7 @@ bool VectorPreProcess::splitStore(
- {
- Type* Ty1 = splitInfo[i].first;
- uint32_t len1 = splitInfo[i].second;
-- VectorType* VTy1 = dyn_cast<VectorType>(Ty1);
-+ IGCLLVM::FixedVectorType* VTy1 = dyn_cast<IGCLLVM::FixedVectorType>(Ty1);
- for (uint32_t j = 0; j < len1; ++j)
- {
- uint32_t vAlign = (uint32_t)MinAlign(Align, (uint32_t)eOffset * EBytes);
-@@ -786,7 +786,7 @@ bool VectorPreProcess::splitLoad(
- {
- Instruction* LI = ALI.getInst();
- bool isLdRaw = isa<LdRawIntrinsic>(LI);
-- VectorType* VTy = cast<VectorType>(LI->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(LI->getType());
- Type* ETy = VTy->getElementType();
- uint32_t nelts = int_cast<uint32_t>(VTy->getNumElements());
-
-@@ -848,7 +848,7 @@ bool VectorPreProcess::splitLoad(
- {
- Type* Ty1 = splitInfo[i].first;
- uint32_t len1 = splitInfo[i].second;
-- VectorType* VTy1 = dyn_cast<VectorType>(Ty1);
-+ IGCLLVM::FixedVectorType* VTy1 = dyn_cast<IGCLLVM::FixedVectorType>(Ty1);
- for (uint32_t j = 0; j < len1; ++j)
- {
- uint32_t vAlign = (uint32_t)MinAlign(Align, eOffset * EBytes);
-@@ -916,7 +916,7 @@ bool VectorPreProcess::splitLoadStore(
- Optional<AbstractStoreInst> ASI = AbstractStoreInst::get(Inst);
- IGC_ASSERT_MESSAGE((ALI || ASI), "Inst should be either load or store");
- Type* Ty = ALI ? ALI->getInst()->getType() : ASI->getValueOperand()->getType();
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- if (!VTy)
- {
- return false;
-@@ -1147,7 +1147,7 @@ void VectorPreProcess::getOrGenScalarValues(
- {
- availBeforeInst = nullptr;
-
-- VectorType* VTy = cast<VectorType>(VecVal->getType());
-+ IGCLLVM::FixedVectorType* VTy = cast<IGCLLVM::FixedVectorType>(VecVal->getType());
- if (!VTy)
- {
- scalars[0] = VecVal;
-@@ -1298,7 +1298,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
- //
- // TODO: further optimize this load into a message with channel masks
- // for cases in which use indices are sparse like {0, 2}.
-- unsigned N = (unsigned)cast<VectorType>(Inst->getType())->getNumElements();
-+ unsigned N = (unsigned)cast<IGCLLVM::FixedVectorType>(Inst->getType())->getNumElements();
- if (N == MaxIndex + 1)
- return Inst;
-
-@@ -1355,7 +1355,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
- if (NBits < 32)
- return Inst;
-
-- unsigned N = (unsigned)cast<VectorType>(Val->getType())->getNumElements();
-+ unsigned N = (unsigned)cast<IGCLLVM::FixedVectorType>(Val->getType())->getNumElements();
- if (auto CV = dyn_cast<ConstantVector>(Val))
- {
- unsigned MaxIndex = 0;
-@@ -1524,7 +1524,7 @@ bool VectorPreProcess::runOnFunction(Function& F)
- for (uint32_t j = 0; j < svals.size(); ++j)
- {
- Type* Ty1 = svals[j]->getType();
-- VectorType* VTy1 = dyn_cast<VectorType>(Ty1);
-+ IGCLLVM::FixedVectorType* VTy1 = dyn_cast<IGCLLVM::FixedVectorType>(Ty1);
- if (VTy1) {
- for (uint32_t k = 0; k < VTy1->getNumElements(); ++k)
- {
-@@ -1573,7 +1573,7 @@ bool VectorPreProcess::runOnFunction(Function& F)
- // If this is a 3-element vector load, remove it
- // from m_Vector3List as well.
- if (isAbstractLoadInst(tInst) && tInst->getType()->isVectorTy() &&
-- cast<VectorType>(tInst->getType())->getNumElements() == 3)
-+ cast<IGCLLVM::FixedVectorType>(tInst->getType())->getNumElements() == 3)
- {
- InstWorkVector::iterator
- tI = m_Vector3List.begin(),
-diff --git a/IGC/Compiler/CISACodeGen/VectorProcess.cpp b/IGC/Compiler/CISACodeGen/VectorProcess.cpp
-index 9f39cdc0..cfe45321 100644
---- a/IGC/Compiler/CISACodeGen/VectorProcess.cpp
-+++ b/IGC/Compiler/CISACodeGen/VectorProcess.cpp
-@@ -240,7 +240,7 @@ bool VectorProcess::reLayoutLoadStore(Instruction* Inst)
- IGC_ASSERT(nullptr != Ptr);
- IGC_ASSERT(nullptr != Ty);
-
-- VectorType* const VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* const VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
-
- // Treat a scalar as 1-element vector
- uint32_t nelts = VTy ? int_cast<uint32_t>(VTy->getNumElements()) : 1;
-@@ -654,7 +654,7 @@ void VectorMessage::getInfo(Type* Ty, uint32_t Align, bool useA32,
- VectorType* VTy = dyn_cast<VectorType>(Ty);
- Type* eTy = VTy ? cast<VectorType>(VTy)->getElementType() : Ty;
- unsigned eltSize = m_emitter->GetScalarTypeSizeInRegister(eTy);
-- unsigned nElts = VTy ? (unsigned)cast<VectorType>(VTy)->getNumElements() : 1;
-+ unsigned nElts = VTy ? (unsigned)cast<IGCLLVM::FixedVectorType>(VTy)->getNumElements() : 1;
- // total bytes
- const unsigned TBytes = nElts * eltSize;
-
-diff --git a/IGC/Compiler/CISACodeGen/helper.cpp b/IGC/Compiler/CISACodeGen/helper.cpp
-index 784affaa..e5507283 100644
---- a/IGC/Compiler/CISACodeGen/helper.cpp
-+++ b/IGC/Compiler/CISACodeGen/helper.cpp
-@@ -1634,7 +1634,7 @@ namespace IGC
- {
- instList[i] = builder.CreateExtractElement(val, static_cast<uint64_t>(0));
- size_t iOld = i;
-- for (unsigned j = 1; j < cast<VectorType>(val->getType())->getNumElements(); j++)
-+ for (unsigned j = 1; j < cast<IGCLLVM::FixedVectorType>(val->getType())->getNumElements(); j++)
- {
- instList.insert(instList.begin()+ iOld +j, builder.CreateExtractElement(val, j));
- i++;
-@@ -1667,7 +1667,7 @@ namespace IGC
- }
- break;
- case IGCLLVM::VectorTyID:
-- num = (unsigned)cast<VectorType>(type)->getNumElements();
-+ num = (unsigned)cast<IGCLLVM::FixedVectorType>(type)->getNumElements();
- for (unsigned i = 0; i < num; i++)
- {
- ScalarizeAggregateMembers(builder, builder.CreateExtractElement(val, i), instList);
-@@ -1707,7 +1707,7 @@ namespace IGC
- }
- break;
- case IGCLLVM::VectorTyID:
-- num = (unsigned)cast<VectorType>(type)->getNumElements();
-+ num = (unsigned)cast<IGCLLVM::FixedVectorType>(type)->getNumElements();
- for (unsigned i = 0; i < num; i++)
- {
- indices.push_back(builder.getInt32(i));
-@@ -1972,8 +1972,8 @@ namespace IGC
- return false;
- }
-
-- VectorType* dVTy = dyn_cast<VectorType>(dTy);
-- VectorType* sVTy = dyn_cast<VectorType>(sTy);
-+ IGCLLVM::FixedVectorType* dVTy = dyn_cast<IGCLLVM::FixedVectorType>(dTy);
-+ IGCLLVM::FixedVectorType* sVTy = dyn_cast<IGCLLVM::FixedVectorType>(sTy);
- int d_nelts = dVTy ? (int)dVTy->getNumElements() : 1;
- int s_nelts = sVTy ? (int)sVTy->getNumElements() : 1;
- if (d_nelts != s_nelts) {
-diff --git a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-index cd7fc66e..adf992cb 100644
---- a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-+++ b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-@@ -153,15 +153,24 @@ void ConvertMSAAPayloadTo16Bit::visitCallInst(CallInst& I)
- // In OGL there are uses of ldmcs other then ldms, using vec4float type.
- // Fix them to use newly created 16bit ldmcs.
- if (ldmcs->getType()->isVectorTy() &&
-+#if LLVM_VERSION_MAJOR >= 12
-+ ldmcs->getType()->getScalarType()->isFloatTy())
-+#else
- ldmcs->getType()->getVectorElementType()->isFloatTy())
-+#endif
- {
- m_builder->SetInsertPoint(ldmcs);
-
-+#if LLVM_VERSION_MAJOR >= 12
-+ uint ldmcsNumOfElements = cast<IGCLLVM::FixedVectorType>(ldmcs->getType())->getNumElements();
-+ uint new_mcs_callNumOfElements = cast<IGCLLVM::FixedVectorType>(new_mcs_call->getType())->getNumElements();
-+#else
- uint ldmcsNumOfElements = ldmcs->getType()->getVectorNumElements();
- uint new_mcs_callNumOfElements = new_mcs_call->getType()->getVectorNumElements();
-+#endif
-
- // vec of 16bit ints to vec of 32bit ints
-- Type* new_mcs_callVecType = VectorType::get(m_builder->getInt32Ty(), new_mcs_callNumOfElements);
-+ Type* new_mcs_callVecType = IGCLLVM::FixedVectorType::get(m_builder->getInt32Ty(), new_mcs_callNumOfElements);
- Value* ldmcsExtendedToInt32 = m_builder->CreateSExt(new_mcs_call, new_mcs_callVecType);
-
- // if new ldmcs has fewer elements than ldmcs, extend vector
-@@ -175,7 +184,7 @@ void ConvertMSAAPayloadTo16Bit::visitCallInst(CallInst& I)
- }
- auto* pMask = ConstantDataVector::get(I.getContext(), maskVals);
-
-- newLdmcsSizedVector = m_builder->CreateShuffleVector(ldmcsExtendedToInt32, UndefValue::get(VectorType::get(m_builder->getInt32Ty(), ldmcsNumOfElements)), pMask);
-+ newLdmcsSizedVector = m_builder->CreateShuffleVector(ldmcsExtendedToInt32, UndefValue::get(IGCLLVM::FixedVectorType::get(m_builder->getInt32Ty(), ldmcsNumOfElements)), pMask);
- }
- else
- {
-@@ -183,7 +192,7 @@ void ConvertMSAAPayloadTo16Bit::visitCallInst(CallInst& I)
- }
- IGC_ASSERT(newLdmcsSizedVector);
-
-- Type* ldmcsFloatVecType = VectorType::get(m_builder->getFloatTy(), ldmcsNumOfElements);
-+ Type* ldmcsFloatVecType = IGCLLVM::FixedVectorType::get(m_builder->getFloatTy(), ldmcsNumOfElements);
- Value* ldmcsBitcastedToFloat = m_builder->CreateBitCast(ldmcsExtendedToInt32, ldmcsFloatVecType);
- ldmcs->replaceAllUsesWith(ldmcsBitcastedToFloat);
- }
-diff --git a/IGC/Compiler/CustomSafeOptPass.cpp b/IGC/Compiler/CustomSafeOptPass.cpp
-index 707bbfbe..72859a91 100644
---- a/IGC/Compiler/CustomSafeOptPass.cpp
-+++ b/IGC/Compiler/CustomSafeOptPass.cpp
-@@ -1372,7 +1372,7 @@ void IGC::CustomSafeOptPass::visitSampleBptr(llvm::SampleIntrinsic* sampleInst)
- bool CustomSafeOptPass::isIdentityMatrix(ExtractElementInst& I)
- {
- bool found = false;
-- auto extractType = cast<VectorType>(I.getVectorOperandType());
-+ auto extractType = cast<IGCLLVM::FixedVectorType>(I.getVectorOperandType());
- auto extractTypeVecSize = (uint32_t)extractType->getNumElements();
- if (extractTypeVecSize == 20 ||
- extractTypeVecSize == 16)
-@@ -1601,7 +1601,7 @@ void CustomSafeOptPass::visitExtractElementInst(ExtractElementInst& I)
- int elOffset = (int)(bitShift / eltSize);
- elOffset = rightShift ? elOffset : -elOffset;
- unsigned int newIndex = (unsigned int)((int)cstIndex->getZExtValue() + elOffset);
-- if (newIndex < cast<VectorType>(vecType)->getNumElements())
-+ if (newIndex < cast<IGCLLVM::FixedVectorType>(vecType)->getNumElements())
- {
- IRBuilder<> builder(&I);
- Value* newBitCast = builder.CreateBitCast(binOp->getOperand(0), vecType);
-@@ -2001,7 +2001,7 @@ void GenSpecificPattern::createBitcastExtractInsertPattern(BinaryOperator& I, Va
- else if (auto IEIInst = dyn_cast<InsertElementInst>(Op))
- {
- auto opType = IEIInst->getType();
-- if (opType->isVectorTy() && cast<VectorType>(opType)->getElementType()->isIntegerTy(32) && cast<VectorType>(opType)->getNumElements() == 2)
-+ if (opType->isVectorTy() && cast<VectorType>(opType)->getElementType()->isIntegerTy(32) && cast<IGCLLVM::FixedVectorType>(opType)->getNumElements() == 2)
- {
- elem = IEIInst->getOperand(1);
- }
-@@ -2064,7 +2064,7 @@ void GenSpecificPattern::visitBinaryOperator(BinaryOperator& I)
- else if (match(&I, pattern2) && AndOp2->getType()->isIntegerTy(64))
- {
- ConstantVector* cVec = dyn_cast<ConstantVector>(VecOp);
-- VectorType* vector_type = dyn_cast<VectorType>(VecOp->getType());
-+ IGCLLVM::FixedVectorType* vector_type = dyn_cast<IGCLLVM::FixedVectorType>(VecOp->getType());
- if (cVec && vector_type &&
- isa<ConstantInt>(cVec->getOperand(0)) &&
- cast<ConstantInt>(cVec->getOperand(0))->isZero() &&
-@@ -2210,7 +2210,7 @@ void GenSpecificPattern::visitBinaryOperator(BinaryOperator& I)
- BitCastInst* opBC = cast<BitCastInst>(op);
-
- auto opType = opBC->getType();
-- if (!(opType->isVectorTy() && cast<VectorType>(opType)->getElementType()->isIntegerTy(32) && cast<VectorType>(opType)->getNumElements() == 2))
-+ if (!(opType->isVectorTy() && cast<VectorType>(opType)->getElementType()->isIntegerTy(32) && cast<IGCLLVM::FixedVectorType>(opType)->getNumElements() == 2))
- return nullptr;
-
- if (opBC->getSrcTy()->isDoubleTy())
-@@ -2630,8 +2630,8 @@ void GenSpecificPattern::visitBitCastInst(BitCastInst& I)
- if (zExtInst->getOperand(0)->getType()->isIntegerTy(32) &&
- isa<InsertElementInst>(bitCastInst->getOperand(0)) &&
- bitCastInst->getOperand(0)->getType()->isVectorTy() &&
-- cast<VectorType>(bitCastInst->getOperand(0)->getType())->getElementType()->isIntegerTy(32) &&
-- cast<VectorType>(bitCastInst->getOperand(0)->getType())->getNumElements() == 2)
-+ cast<IGCLLVM::FixedVectorType>(bitCastInst->getOperand(0)->getType())->getElementType()->isIntegerTy(32) &&
-+ cast<IGCLLVM::FixedVectorType>(bitCastInst->getOperand(0)->getType())->getNumElements() == 2)
- {
- InsertElementInst* insertElementInst = cast<InsertElementInst>(bitCastInst->getOperand(0));
-
-@@ -2731,7 +2731,7 @@ void GenSpecificPattern::visitFNeg(llvm::UnaryOperator& I)
- }
- else
- {
-- uint32_t vectorSize = cast<VectorType>(I.getType())->getNumElements();
-+ uint32_t vectorSize = cast<IGCLLVM::FixedVectorType>(I.getType())->getNumElements();
- fsub = llvm::UndefValue::get(I.getType());
-
- for (uint32_t i = 0; i < vectorSize; ++i)
-@@ -2845,7 +2845,7 @@ Constant* IGCConstProp::replaceShaderConstant(LoadInst* inst)
- if (inst->getType()->isVectorTy())
- {
- Type* srcEltTy = cast<VectorType>(inst->getType())->getElementType();
-- uint32_t srcNElts = (uint32_t)cast<VectorType>(inst->getType())->getNumElements();
-+ uint32_t srcNElts = (uint32_t)cast<IGCLLVM::FixedVectorType>(inst->getType())->getNumElements();
- uint32_t eltSize_in_bytes = (unsigned int)srcEltTy->getPrimitiveSizeInBits() / 8;
- IRBuilder<> builder(inst);
- Value* vectorValue = UndefValue::get(inst->getType());
-@@ -3122,7 +3122,7 @@ Constant* IGCConstProp::ConstantFoldCmpInst(CmpInst* CI)
- {
- bool AllTrue = true, AllFalse = true;
- auto VecOpnd = cast<Constant>(EEI->getVectorOperand());
-- unsigned N = (unsigned)cast<VectorType>(VecOpnd->getType())->getNumElements();
-+ unsigned N = (unsigned)cast<IGCLLVM::FixedVectorType>(VecOpnd->getType())->getNumElements();
- for (unsigned i = 0; i < N; ++i)
- {
- Constant* const Opnd = VecOpnd->getAggregateElement(i);
-@@ -3918,8 +3918,8 @@ namespace IGC
- BitCastInst* BC = dyn_cast<BitCastInst>(&*BI++);
- if (!BC) continue;
- // Skip non-element-wise bitcast.
-- VectorType* DstVTy = dyn_cast<VectorType>(BC->getType());
-- VectorType* SrcVTy = dyn_cast<VectorType>(BC->getOperand(0)->getType());
-+ IGCLLVM::FixedVectorType* DstVTy = dyn_cast<IGCLLVM::FixedVectorType>(BC->getType());
-+ IGCLLVM::FixedVectorType* SrcVTy = dyn_cast<IGCLLVM::FixedVectorType>(BC->getOperand(0)->getType());
- if (!DstVTy || !SrcVTy || DstVTy->getNumElements() != SrcVTy->getNumElements())
- continue;
- // Skip if it's not used only all extractelement.
-@@ -4689,7 +4689,7 @@ void SplitIndirectEEtoSel::visitExtractElementInst(llvm::ExtractElementInst& I)
- {
- using namespace llvm::PatternMatch;
-
-- VectorType* vecTy = I.getVectorOperandType();
-+ IGCLLVM::FixedVectorType* vecTy = dyn_cast<IGCLLVM::FixedVectorType>(I.getVectorOperandType());
- uint64_t num = vecTy->getNumElements();
- Type* eleType = vecTy->getElementType();
-
-diff --git a/IGC/Compiler/DebugInfo/ScalarVISAModule.cpp b/IGC/Compiler/DebugInfo/ScalarVISAModule.cpp
-index 885ad65a..923f296e 100644
---- a/IGC/Compiler/DebugInfo/ScalarVISAModule.cpp
-+++ b/IGC/Compiler/DebugInfo/ScalarVISAModule.cpp
-@@ -32,6 +32,7 @@ IN THE SOFTWARE.
- #include "DebugInfo/DebugInfoUtils.hpp"
-
- #include "common/LLVMWarningsPush.hpp"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "llvm/IR/Function.h"
- #include "llvm/IR/Module.h"
- #include "common/LLVMWarningsPop.hpp"
-@@ -581,7 +582,7 @@ ScalarVisaModule::GetVariableLocation(const llvm::Instruction* pInst) const
-
- if (pType->isVectorTy())
- {
-- vectorNumElements = (unsigned)cast<VectorType>(pType)->getNumElements();
-+ vectorNumElements = (unsigned)cast<IGCLLVM::FixedVectorType>(pType)->getNumElements();
- }
- else if (!pVar->IsUniform())
- {
-diff --git a/IGC/Compiler/GenTTI.cpp b/IGC/Compiler/GenTTI.cpp
-index 34b21c73..9e4d2f26 100644
---- a/IGC/Compiler/GenTTI.cpp
-+++ b/IGC/Compiler/GenTTI.cpp
-@@ -216,7 +216,13 @@ namespace llvm {
-
- // Skip non-simple loop.
- if (L->getNumBlocks() != 1) {
-- if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) && L->empty()) {
-+ if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) &&
-+#if LLVM_VERSION_MAJOR >= 12
-+ L->isInnermost()
-+#else
-+ L->empty()
-+#endif
-+ ) {
- auto countNonPHI = [](BasicBlock* BB) {
- unsigned Total = BB->size();
- unsigned PHIs = 0;
-diff --git a/IGC/Compiler/GenUpdateCB.cpp b/IGC/Compiler/GenUpdateCB.cpp
-index 89b414b6..9034066c 100644
---- a/IGC/Compiler/GenUpdateCB.cpp
-+++ b/IGC/Compiler/GenUpdateCB.cpp
-@@ -24,6 +24,7 @@ IN THE SOFTWARE.
-
- #include "common/LLVMWarningsPush.hpp"
- #include "llvmWrapper/Bitcode/BitcodeWriter.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include <llvm/Support/ScaledNumber.h>
- #include <llvm/Bitcode/BitcodeReader.h>
- #include "llvm/IR/DebugInfo.h"
-@@ -384,7 +385,7 @@ bool GenUpdateCB::runOnFunction(Function& F)
- isResInfo(dyn_cast<GenIntrinsicInst>(inst,
- GenISAIntrinsic::GenISA_resinfoptr), texId, lod, isUAV))
- {
-- unsigned nelems = (unsigned)cast<VectorType>(inst->getType())->getNumElements();
-+ unsigned nelems = (unsigned)cast<IGCLLVM::FixedVectorType>(inst->getType())->getNumElements();
- SmallVector< SmallVector<ExtractElementInst*, 1>, 4> extracts(nelems);
- if (VectorUsedByConstExtractOnly(inst, extracts))
- {
-diff --git a/IGC/Compiler/HandleFRemInstructions.cpp b/IGC/Compiler/HandleFRemInstructions.cpp
-index 94995a56..4523f3f0 100644
---- a/IGC/Compiler/HandleFRemInstructions.cpp
-+++ b/IGC/Compiler/HandleFRemInstructions.cpp
-@@ -28,6 +28,7 @@ IN THE SOFTWARE.
- #include <llvm/IR/Instructions.h>
- #include <llvm/IR/InstIterator.h>
- #include <llvm/Transforms/Utils/BasicBlockUtils.h>
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPop.hpp"
- #include "Compiler/IGCPassSupport.h"
- #include "Probe/Assertion.h"
-@@ -77,7 +78,7 @@ void HandleFRemInstructions::visitFRem(llvm::BinaryOperator& I)
-
- if (ValType->isVectorTy())
- {
-- auto VecCount = cast<VectorType>(ValType)->getNumElements();
-+ auto VecCount = cast<IGCLLVM::FixedVectorType>(ValType)->getNumElements();
- if (VecCount == 2 || VecCount == 3 || VecCount == 4 || VecCount == 8 || VecCount == 16)
- {
- VecStr = "v" + std::to_string(VecCount);
-diff --git a/IGC/Compiler/HandleLoadStoreInstructions.cpp b/IGC/Compiler/HandleLoadStoreInstructions.cpp
-index d18eec73..c5535701 100644
---- a/IGC/Compiler/HandleLoadStoreInstructions.cpp
-+++ b/IGC/Compiler/HandleLoadStoreInstructions.cpp
-@@ -77,7 +77,7 @@ void HandleLoadStoreInstructions::visitLoadInst(llvm::LoadInst& I)
-
- if (I.getType()->isVectorTy())
- {
-- numVectorElements = (uint32_t)cast<VectorType>(I.getType())->getNumElements();
-+ numVectorElements = (uint32_t)cast<IGCLLVM::FixedVectorType>(I.getType())->getNumElements();
- doubleDstType = IGCLLVM::FixedVectorType::get(builder.getDoubleTy(), numVectorElements);
- }
- uint as = ptrv->getType()->getPointerAddressSpace();
-@@ -163,7 +163,7 @@ void HandleLoadStoreInstructions::visitStoreInst(llvm::StoreInst& I)
-
- if (I.getValueOperand()->getType()->isVectorTy())
- {
-- numVectorElements = (uint32_t)cast<VectorType>(I.getValueOperand()->getType())->getNumElements();
-+ numVectorElements = (uint32_t)cast<IGCLLVM::FixedVectorType>(I.getValueOperand()->getType())->getNumElements();
- }
-
-
-diff --git a/IGC/Compiler/LegalizationPass.cpp b/IGC/Compiler/LegalizationPass.cpp
-index b651350b..9524a495 100644
---- a/IGC/Compiler/LegalizationPass.cpp
-+++ b/IGC/Compiler/LegalizationPass.cpp
-@@ -670,7 +670,7 @@ void Legalization::visitBitCastInst(llvm::BitCastInst& I)
- if (!isa<TruncInst>(pZ->getOperand(0)))
- return;
-
-- auto* pVecTy = cast<VectorType>(pZ->getDestTy());
-+ auto* pVecTy = cast<IGCLLVM::FixedVectorType>(pZ->getDestTy());
- if (pVecTy->getNumElements() != 3)
- return;
-
-@@ -765,7 +765,7 @@ void Legalization::visitSelectInst(SelectInst& I)
- }
- else if (I.getType()->isVectorTy())
- {
-- unsigned int vecSize = (unsigned)cast<VectorType>(I.getType())->getNumElements();
-+ unsigned int vecSize = (unsigned)cast<IGCLLVM::FixedVectorType>(I.getType())->getNumElements();
- Value* newVec = UndefValue::get(I.getType());
- m_builder->SetInsertPoint(&I);
- for (unsigned int i = 0; i < vecSize; i++)
-@@ -1147,7 +1147,7 @@ void Legalization::visitStoreInst(StoreInst& I)
- if (ConstantDataVector * vec = dyn_cast<ConstantDataVector>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(vec->getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getElementAsConstant(i);
-@@ -1168,7 +1168,7 @@ void Legalization::visitStoreInst(StoreInst& I)
- else if (ConstantVector * vec = dyn_cast<ConstantVector>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(vec->getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getOperand(i);
-@@ -1189,7 +1189,7 @@ void Legalization::visitStoreInst(StoreInst& I)
- else if (ConstantAggregateZero * vec = dyn_cast<ConstantAggregateZero>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(vec->getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getElementValue(i);
-@@ -1340,7 +1340,7 @@ void Legalization::visitInsertElementInst(InsertElementInst& I)
- if (ConstantDataVector * vec = dyn_cast<ConstantDataVector>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(vec->getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getElementAsConstant(i);
-@@ -1360,7 +1360,7 @@ void Legalization::visitInsertElementInst(InsertElementInst& I)
- else if (ConstantVector * vec = dyn_cast<ConstantVector>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(I.getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getOperand(i);
-@@ -1380,7 +1380,7 @@ void Legalization::visitInsertElementInst(InsertElementInst& I)
- else if (ConstantAggregateZero * vec = dyn_cast<ConstantAggregateZero>(I.getOperand(0)))
- {
- Value* newVec = UndefValue::get(I.getType());
-- unsigned int nbElement = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned int i = 0; i < nbElement; i++)
- {
- Constant* cst = vec->getElementValue(i);
-@@ -1397,7 +1397,7 @@ void Legalization::visitInsertElementInst(InsertElementInst& I)
- else if (I.getOperand(1)->getType()->isIntegerTy(1))
- {
- // This promotes i1 insertelement to i32
-- unsigned int nbElement = (unsigned)cast<VectorType>(I.getOperand(0)->getType())->getNumElements();
-+ unsigned int nbElement = (unsigned)cast<IGCLLVM::FixedVectorType>(I.getOperand(0)->getType())->getNumElements();
- Value* newVec = UndefValue::get(IGCLLVM::FixedVectorType::get(m_builder->getInt32Ty(), nbElement));
- PromoteInsertElement(&I, newVec);
- }
-@@ -1410,7 +1410,7 @@ void Legalization::visitShuffleVectorInst(ShuffleVectorInst& I)
- // If the original vector is a constant, just use the scalar constant,
- // otherwise extract from the original vector.
-
-- VectorType* resType = cast<VectorType>(I.getType());
-+ IGCLLVM::FixedVectorType* resType = cast<IGCLLVM::FixedVectorType>(I.getType());
- Value* newVec = UndefValue::get(resType);
- Value* src0 = I.getOperand(0);
- Value* src1 = I.getOperand(1);
-@@ -1421,7 +1421,7 @@ void Legalization::visitShuffleVectorInst(ShuffleVectorInst& I)
- Constant* mask = I.getShuffleMaskForBitcode();
- #endif
- // The two inputs are guaranteed to be of the same type
-- VectorType* inType = cast<VectorType>(src0->getType());
-+ IGCLLVM::FixedVectorType* inType = cast<IGCLLVM::FixedVectorType>(src0->getType());
- int inCount = int_cast<int>(inType->getNumElements());
- int inBase = 2; // 2 means using undef
- // if inType == resType, use src0/src1 as the input
-@@ -1637,7 +1637,7 @@ Type* Legalization::LegalAllocaType(Type* type) const
- #endif
- legalType = IGCLLVM::FixedVectorType::get(
- LegalAllocaType(cast<VectorType>(type)->getElementType()),
-- (unsigned)cast<VectorType>(type)->getNumElements());
-+ (unsigned)cast<IGCLLVM::FixedVectorType>(type)->getNumElements());
- break;
- case Type::StructTyID:
- return LegalStructAllocaType(type);
-@@ -1937,7 +1937,7 @@ void Legalization::visitIntrinsicInst(llvm::IntrinsicInst& I)
- Value* newValue = nullptr;
- if (srcType->isVectorTy())
- {
-- auto sourceVT = cast<VectorType>(srcType);
-+ auto sourceVT = cast<IGCLLVM::FixedVectorType>(srcType);
- const unsigned int numElements = (uint32_t)sourceVT->getNumElements();
- Value* dstVec = UndefValue::get(srcType);
- for (unsigned int i = 0; i < numElements; ++i)
-@@ -2081,7 +2081,7 @@ void Legalization::visitTruncInst(llvm::TruncInst& I) {
- }
-
- Src = BC->getOperand(0);
-- VectorType* VTy = dyn_cast<VectorType>(Src->getType());
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Src->getType());
- // Bail out if it's not bitcasted from <3 x i16>
- if (!VTy || VTy->getNumElements() != 3 || !VTy->getElementType()->isIntegerTy(16))
- return;
-diff --git a/IGC/Compiler/Legalizer/InstPromoter.cpp b/IGC/Compiler/Legalizer/InstPromoter.cpp
-index bba1d96d..8fadf89f 100644
---- a/IGC/Compiler/Legalizer/InstPromoter.cpp
-+++ b/IGC/Compiler/Legalizer/InstPromoter.cpp
-@@ -25,6 +25,7 @@ IN THE SOFTWARE.
- #define DEBUG_TYPE "type-legalizer"
- #include "TypeLegalizer.h"
- #include "InstPromoter.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPush.hpp"
- #include "llvm/Support/Debug.h"
- #include "llvm/Support/MathExtras.h"
-@@ -394,10 +395,16 @@ bool InstPromoter::visitBitCastInst(BitCastInst& I) {
- unsigned N =
- Val->getType()->getScalarSizeInBits() / DestTy->getScalarSizeInBits();
- Value* BC =
-- IRB->CreateBitCast(Val, VectorType::get(DestTy->getScalarType(), N));
-+ IRB->CreateBitCast(Val, IGCLLVM::FixedVectorType::get(DestTy->getScalarType(), N));
-
- std::vector<Constant*> Vals;
-- for (unsigned i = 0; i < DestTy->getVectorNumElements(); i++)
-+ for (unsigned i = 0;
-+#if LLVM_VERSION_MAJOR >= 12
-+ i < cast<IGCLLVM::FixedVectorType>(DestTy)->getNumElements();
-+#else
-+ i < DestTy->getVectorNumElements();
-+#endif
-+ i++)
- Vals.push_back(IRB->getInt32(i));
-
- Value* Mask = ConstantVector::get(Vals);
-diff --git a/IGC/Compiler/Legalizer/InstScalarizer.cpp b/IGC/Compiler/Legalizer/InstScalarizer.cpp
-index 3902f740..c8e18cc5 100644
---- a/IGC/Compiler/Legalizer/InstScalarizer.cpp
-+++ b/IGC/Compiler/Legalizer/InstScalarizer.cpp
-@@ -130,7 +130,7 @@ bool InstScalarizer::visitLoadInst(LoadInst& I) {
- // otherwise, it's broken.
- IGC_ASSERT(TL->getTypeSizeInBits(EltTy) == TL->getTypeStoreSizeInBits(EltTy));
-
-- unsigned NumElts = (unsigned)cast<VectorType>(OrigTy)->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(OrigTy)->getNumElements();
- unsigned Elt = 0;
-
- Type* NewPtrTy = PointerType::get(EltTy, AS);
-@@ -268,7 +268,7 @@ bool InstScalarizer::visitStoreInst(StoreInst& I) {
- // otherwise, it's broken.
- IGC_ASSERT(TL->getTypeSizeInBits(EltTy) == TL->getTypeStoreSizeInBits(EltTy));
-
-- unsigned NumElts = (unsigned)cast<VectorType>(OrigTy)->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(OrigTy)->getNumElements();
- unsigned Elt = 0;
-
- Type* NewPtrTy = PointerType::get(EltTy, AS);
-@@ -498,7 +498,7 @@ bool InstScalarizer::visitInsertElementInst(InsertElementInst& I) {
- IGC_ASSERT(EltSeq->size());
- IGC_ASSERT(VecSeqCopy.size() % EltSeq->size() == 0);
-
-- unsigned NumElts = (unsigned)cast<VectorType>(I.getOperand(0)->getType())->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(I.getOperand(0)->getType())->getNumElements();
- unsigned i = 0;
- for (unsigned Elt = 0; Elt != NumElts; ++Elt) {
- if (Elt == Idx) {
-diff --git a/IGC/Compiler/Legalizer/PeepholeTypeLegalizer.cpp b/IGC/Compiler/Legalizer/PeepholeTypeLegalizer.cpp
-index 28f8ce84..778132c4 100644
---- a/IGC/Compiler/Legalizer/PeepholeTypeLegalizer.cpp
-+++ b/IGC/Compiler/Legalizer/PeepholeTypeLegalizer.cpp
-@@ -162,7 +162,7 @@ void PeepholeTypeLegalizer::legalizePhiInstruction(Instruction& I)
-
- if (quotient > 1)
- {
-- unsigned numElements = I.getType()->isVectorTy() ? (unsigned)cast<VectorType>(I.getType())->getNumElements() : 1;
-+ unsigned numElements = I.getType()->isVectorTy() ? (unsigned)cast<IGCLLVM::FixedVectorType>(I.getType())->getNumElements() : 1;
- Type* newType = IGCLLVM::FixedVectorType::get(Type::getIntNTy(I.getContext(), promoteToInt), quotient * numElements);
-
- PHINode* newPhi = m_builder->CreatePHI(newType, oldPhi->getNumIncomingValues());
-@@ -223,7 +223,7 @@ void PeepholeTypeLegalizer::legalizeExtractElement(Instruction& I)
- unsigned elementWidth = extract->getType()->getScalarSizeInBits();
- if (!isLegalInteger(elementWidth) && extract->getType()->isIntOrIntVectorTy())
- {
-- unsigned numElements = (unsigned)cast<VectorType>(extract->getOperand(0)->getType())->getNumElements();
-+ unsigned numElements = (unsigned)cast<IGCLLVM::FixedVectorType>(extract->getOperand(0)->getType())->getNumElements();
- unsigned quotient, promoteToInt;
- promoteInt(elementWidth, quotient, promoteToInt, DL->getLargestLegalIntTypeSizeInBits());
-
-@@ -850,7 +850,7 @@ void PeepholeTypeLegalizer::cleanupZExtInst(Instruction& I) {
- }
-
- unsigned ipElmtSize = prevInst->getOperand(0)->getType()->getScalarSizeInBits();
-- unsigned ipVecSize = (unsigned)cast<VectorType>(prevInst->getOperand(0)->getType())->getNumElements();
-+ unsigned ipVecSize = (unsigned)cast<IGCLLVM::FixedVectorType>(prevInst->getOperand(0)->getType())->getNumElements();
- unsigned convFactor = promoteToInt / ipElmtSize;
-
- Value* vecRes = UndefValue::get(IGCLLVM::FixedVectorType::get(llvm::Type::getIntNTy(I.getContext(), promoteToInt), quotient));
-diff --git a/IGC/Compiler/Legalizer/TypeLegalizer.cpp b/IGC/Compiler/Legalizer/TypeLegalizer.cpp
-index f8f71d71..a46f42bd 100644
---- a/IGC/Compiler/Legalizer/TypeLegalizer.cpp
-+++ b/IGC/Compiler/Legalizer/TypeLegalizer.cpp
-@@ -32,6 +32,7 @@ IN THE SOFTWARE.
- #include "InstScalarizer.h"
- #include "InstElementizer.h"
- #include "common/LLVMWarningsPush.hpp"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "llvm/ADT/PostOrderIterator.h"
- #include "llvm/IR/CFG.h"
- #include "llvm/Support/Debug.h"
-@@ -290,7 +291,7 @@ TypeSeq* TypeLegalizer::getScalarizedTypeSeq(Type* Ty) {
- }
-
- Type* EltTy = cast<VectorType>(Ty)->getElementType();
-- for (unsigned i = 0, e = (unsigned)cast<VectorType>(Ty)->getNumElements(); i != e; ++i)
-+ for (unsigned i = 0, e = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements(); i != e; ++i)
- TMI->second.push_back(EltTy);
-
- return &TMI->second;
-diff --git a/IGC/Compiler/Legalizer/TypeLegalizer.h b/IGC/Compiler/Legalizer/TypeLegalizer.h
-index f3ce264c..a6910d08 100644
---- a/IGC/Compiler/Legalizer/TypeLegalizer.h
-+++ b/IGC/Compiler/Legalizer/TypeLegalizer.h
-@@ -28,6 +28,7 @@ IN THE SOFTWARE.
- #include "llvmWrapper/IR/Instructions.h"
- #include "llvmWrapper/Analysis/InlineCost.h"
- #include "llvmWrapper/IR/InstrTypes.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "llvmWrapper/Support/Alignment.h"
- #include "llvm/ADT/ArrayRef.h"
- #include "llvm/ADT/DenseMap.h"
-@@ -287,7 +288,7 @@ namespace IGC {
- if (!Ty->isVectorTy())
- return false;
-
-- unsigned NumElts = (unsigned)cast<VectorType>(Ty)->getNumElements();
-+ unsigned NumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements();
- Type* EltTy = cast<VectorType>(Ty)->getElementType();
- const auto& ProfitLengths = getProfitLoadVectorLength(EltTy);
-
-diff --git a/IGC/Compiler/LowPrecisionOptPass.cpp b/IGC/Compiler/LowPrecisionOptPass.cpp
-index 64912719..1d1db949 100644
---- a/IGC/Compiler/LowPrecisionOptPass.cpp
-+++ b/IGC/Compiler/LowPrecisionOptPass.cpp
-@@ -252,7 +252,7 @@ bool LowPrecisionOpt::propagateSamplerType(llvm::GenIntrinsicInst& I)
- return false;
- }
-
-- VectorType* oldTy = cast<VectorType>(I.getType());
-+ IGCLLVM::FixedVectorType* oldTy = cast<IGCLLVM::FixedVectorType>(I.getType());
- llvm::SmallVector<llvm::Type*, 4> overloadTys;
- auto retTy = IGCLLVM::FixedVectorType::get(newDstType, int_cast<unsigned int>(oldTy->getNumElements()));
- overloadTys.push_back(retTy);
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-index 393b4b0a..e9c07b34 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-@@ -23,6 +23,8 @@ IN THE SOFTWARE.
- ============================= end_copyright_notice ===========================*/
-
- #include "llvm/Config/llvm-config.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
-+#include "llvmWrapper/Analysis/TargetLibraryInfo.h"
- #include "Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.h"
- #include "Compiler/CodeGenPublic.h"
- #include "Compiler/IGCPassSupport.h"
-@@ -178,12 +180,11 @@ namespace {
- bool doInitialization(Module& M) override {
- if(M.size() > 0)
- {
-- Result.reset(new AddressSpaceAAResult(
-- getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
- #if LLVM_VERSION_MAJOR >= 10
-- *M.begin()
-+ Function &F = *M.begin();
- #endif
-- ),
-+ Result.reset(new AddressSpaceAAResult(
-+ getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(),
- *getAnalysis<CodeGenContextWrapper>().getCodeGenContext()));
- }
- return false;
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/AggregateArguments/AggregateArguments.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/AggregateArguments/AggregateArguments.cpp
-index 67535cfc..3cdd2975 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/AggregateArguments/AggregateArguments.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AggregateArguments/AggregateArguments.cpp
-@@ -24,6 +24,7 @@ IN THE SOFTWARE.
-
- #include "Compiler/Optimizer/OpenCLPasses/AggregateArguments/AggregateArguments.hpp"
- #include "Compiler/IGCPassSupport.h"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPush.hpp"
- #include "llvm/IR/Function.h"
- #include "common/LLVMWarningsPop.hpp"
-@@ -130,7 +131,7 @@ static uint64_t getNumElements(Type* type)
- {
- return arrayType->getNumElements();
- }
-- if (VectorType * vectorType = dyn_cast<VectorType>(type))
-+ if (IGCLLVM::FixedVectorType * vectorType = dyn_cast<IGCLLVM::FixedVectorType>(type))
- {
- return vectorType->getNumElements();
- }
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/CorrectlyRoundedDivSqrt/CorrectlyRoundedDivSqrt.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/CorrectlyRoundedDivSqrt/CorrectlyRoundedDivSqrt.cpp
-index 2a9d7499..79ed0948 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/CorrectlyRoundedDivSqrt/CorrectlyRoundedDivSqrt.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/CorrectlyRoundedDivSqrt/CorrectlyRoundedDivSqrt.cpp
-@@ -27,6 +27,7 @@ IN THE SOFTWARE.
- #include "Compiler/IGCPassSupport.h"
- #include "GenISAIntrinsics/GenIntrinsicInst.h"
-
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPush.hpp"
- #include <llvm/IR/Function.h>
- #include <llvm/IR/Instructions.h>
-@@ -133,7 +134,7 @@ Value* CorrectlyRoundedDivSqrt::emitIEEEDivide(BinaryOperator* I, Value* Op0, Va
- }
- else
- {
-- auto vType = dyn_cast<VectorType>(Ty);
-+ auto vType = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- unsigned VecLen = (uint32_t)vType->getNumElements();
- Divide = UndefValue::get(Ty);
- for (unsigned i = 0; i < VecLen; i++)
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-index c5ff3ac0..119520ed 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-@@ -952,7 +952,11 @@ namespace //Anonymous
- {
- auto ndrangeStructName = "struct.ndrange_t";
- auto module = _deviceExecCall->getModule();
-+#if LLVM_VERSION_MAJOR >= 12
-+ auto ndrangeTy = llvm::StructType::getTypeByName(module->getContext(), ndrangeStructName);
-+#else
- auto ndrangeTy = module->getTypeByName(ndrangeStructName);
-+#endif
- if (ndrangeTy == nullptr)
- {
- //create struct type
-@@ -1697,7 +1701,7 @@ namespace //Anonymous
- // this generates <element_type><num_elements> string. Ie for char2 element_type is char and num_elements is 2
- // that is done by callin BaseTypeName on vector element type, this recursive call has only a depth of one since
- // there are no compound vectors in OpenCL.
-- auto vType = llvm::dyn_cast<VectorType>(type);
-+ auto vType = llvm::dyn_cast<IGCLLVM::FixedVectorType>(type);
- return BaseTypeName(type->getContainedType(0), os) << vType->getNumElements();
- }
- default:
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/KernelArgs.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/KernelArgs.cpp
-index 6448463d..7df71079 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/KernelArgs.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/KernelArgs.cpp
-@@ -24,6 +24,7 @@ IN THE SOFTWARE.
-
- #include "Compiler/Optimizer/OpenCLPasses/KernelArgs.hpp"
- #include "AdaptorCommon/ImplicitArgs.hpp"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPush.hpp"
- #include <llvm/IR/Argument.h>
- #include <llvm/IR/DataLayout.h>
-@@ -388,7 +389,7 @@ unsigned int KernelArg::calcAssociatedArgNo(const ImplicitArg& implicitArg, cons
-
- unsigned int KernelArg::getNumComponents() const
- {
-- if (VectorType * vecType = dyn_cast<VectorType>(m_arg->getType()))
-+ if (IGCLLVM::FixedVectorType * vecType = dyn_cast<IGCLLVM::FixedVectorType>(m_arg->getType()))
- {
- // Vector
- return int_cast<unsigned int>(vecType->getNumElements());
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp
-index c7414b8e..74964510 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp
-@@ -719,7 +719,7 @@ Value* OpenCLPrintfResolution::fixupPrintfArg(CallInst& printfCall, Value* arg,
- }
-
- Type* newType = Type::getFloatTy(arg->getContext());
-- if (auto argVT = dyn_cast<VectorType>(arg->getType()))
-+ if (auto argVT = dyn_cast<IGCLLVM::FixedVectorType>(arg->getType()))
- {
- newType = IGCLLVM::FixedVectorType::get(newType, (unsigned)argVT->getNumElements());
- }
-@@ -749,7 +749,7 @@ void OpenCLPrintfResolution::preprocessPrintfArgs(CallInst& printfCall)
- IGC::SHADER_PRINTF_TYPE argDataType = getPrintfArgDataType(arg);
- arg = fixupPrintfArg(printfCall, arg, argDataType);
- uint vecSize = 0;
-- if (auto argVType = dyn_cast<VectorType>(argType)) {
-+ if (auto argVType = dyn_cast<IGCLLVM::FixedVectorType>(argType)) {
- vecSize = (uint)argVType->getNumElements();
- }
- m_argDescriptors.push_back(SPrintfArgDescriptor(argDataType, arg, vecSize));
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-index 2ed5a2b6..07f85f4c 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-@@ -29,6 +29,7 @@ IN THE SOFTWARE.
- #include "Compiler/IGCPassSupport.h"
- #include "Compiler/CISACodeGen/GenCodeGenModule.h"
- #include "Compiler/CISACodeGen/LowerGEPForPrivMem.hpp"
-+#include "llvmWrapper/IR/DerivedTypes.h"
- #include "common/LLVMWarningsPush.hpp"
- #include "llvm/Transforms/Utils/Local.h"
- #include "llvm/IR/DataLayout.h"
-@@ -604,7 +605,7 @@ public:
- Type* scalarptrTy = PointerType::get(scalarType, pLoad->getPointerAddressSpace());
- IGC_ASSERT(scalarType->getPrimitiveSizeInBits() / 8 == elementSize);
- Value* vec = UndefValue::get(pLoad->getType());
-- auto pLoadVT = cast<VectorType>(pLoad->getType());
-+ auto pLoadVT = cast<IGCLLVM::FixedVectorType>(pLoad->getType());
- for (unsigned i = 0, e = (unsigned)pLoadVT->getNumElements(); i < e; ++i)
- {
- Value* ptr = IRB.CreateIntToPtr(address, scalarptrTy);
-@@ -643,7 +644,7 @@ public:
- IGC_ASSERT(scalarType->getPrimitiveSizeInBits() / 8 == elementSize);
- Value* vec = pStore->getValueOperand();
-
-- unsigned vecNumElts = (unsigned)cast<VectorType>(vec->getType())->getNumElements();
-+ unsigned vecNumElts = (unsigned)cast<IGCLLVM::FixedVectorType>(vec->getType())->getNumElements();
- for (unsigned i = 0; i < vecNumElts; ++i)
- {
- Value* ptr = IRB.CreateIntToPtr(address, scalarptrTy);
-@@ -707,7 +708,7 @@ bool PrivateMemoryResolution::testTransposedMemory(const Type* pTmpType, const T
- }
- else if(pTmpType->isVectorTy())
- {
-- auto pTmpVType = cast<VectorType>(pTmpType);
-+ auto pTmpVType = cast<IGCLLVM::FixedVectorType>(pTmpType);
- tmpAllocaSize *= pTmpVType->getNumElements();
- pTmpType = pTmpType->getContainedType(0);
- ok = (nullptr != pTmpType);
-@@ -815,7 +816,11 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
- // Construct an empty DebugLoc.
- IF_DEBUG_INFO(DebugLoc entryDebugLoc);
- // Assign with the function location if available.
-+#if LLVM_VERSION_MAJOR >= 12
-+ IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DILocation::get(subprogram->getContext(), subprogram->getLine(), 0, subprogram););
-+#else
- IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DebugLoc::get(subprogram->getLine(), 0, subprogram););
-+#endif
- IF_DEBUG_INFO(entryBuilder.SetCurrentDebugLocation(entryDebugLoc));
-
- if (privateOnStack)
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/ReplaceUnsupportedIntrinsics/ReplaceUnsupportedIntrinsics.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/ReplaceUnsupportedIntrinsics/ReplaceUnsupportedIntrinsics.cpp
-index c8414efa..68491d48 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/ReplaceUnsupportedIntrinsics/ReplaceUnsupportedIntrinsics.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/ReplaceUnsupportedIntrinsics/ReplaceUnsupportedIntrinsics.cpp
-@@ -254,7 +254,7 @@ Instruction* ReplaceUnsupportedIntrinsics::insertLoop(Instruction* Loc, Value* L
- Value* ReplaceUnsupportedIntrinsics::replicateScalar(
- Value* ScalarVal, Type* Ty, Instruction* InsertBefore)
- {
-- VectorType* VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- Type* ETy = VTy ? VTy->getElementType() : Ty;
- uint32_t sBits = (unsigned int)ScalarVal->getType()->getPrimitiveSizeInBits();
- uint32_t nBits = (unsigned int)ETy->getPrimitiveSizeInBits();
-@@ -868,7 +868,7 @@ void ReplaceUnsupportedIntrinsics::replaceFunnelShift(IntrinsicInst* I) {
- }
-
- Value* numBits = Builder.getIntN(sizeInBits, sizeInBits);
-- if (auto IVT = dyn_cast<VectorType>(I->getType())) {
-+ if (auto IVT = dyn_cast<IGCLLVM::FixedVectorType>(I->getType())) {
- numBits = ConstantVector::getSplat(IGCLLVM::getElementCount((uint32_t)IVT->getNumElements()), cast<Constant>(numBits));
- }
- auto shiftModulo = Builder.CreateURem(I->getArgOperand(2), numBits);
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-index 7188cc50..535d6268 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-@@ -303,7 +303,11 @@ static Value* BuildLoadInst(CallInst& CI, unsigned int Offset, Type* DataType)
- auto Size = ElemByteSize;
- if (DataType->isVectorTy())
- {
-+#if LLVM_VERSION_MAJOR >= 12
-+ Size *= cast<IGCLLVM::FixedVectorType>(DataType)->getNumElements();
-+#else
- Size *= DataType->getVectorNumElements();
-+#endif
- }
- unsigned int AlignedOffset = (Offset / ElemByteSize) * ElemByteSize;
- unsigned int LoadByteSize = (Offset == AlignedOffset) ? Size : Size * 2;
-diff --git a/IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp b/IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp
-index 1fda21d5..63a22864 100644
---- a/IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp
-+++ b/IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp
-@@ -340,7 +340,7 @@ bool PreCompiledFuncImport::preProcessDouble()
- }
- else
- {
-- uint32_t vectorSize = cast<VectorType>(Inst->getType())->getNumElements();
-+ uint32_t vectorSize = cast<IGCLLVM::FixedVectorType>(Inst->getType())->getNumElements();
- fsub = llvm::UndefValue::get(Inst->getType());
-
- for (uint32_t i = 0; i < vectorSize; ++i)
-@@ -936,7 +936,7 @@ void PreCompiledFuncImport::processDivide(BinaryOperator& inst, EmulatedFunction
-
- Type* argumentType = inst.getOperand(0)->getType();
-
-- if (auto argumentVType = dyn_cast<VectorType>(argumentType))
-+ if (auto argumentVType = dyn_cast<IGCLLVM::FixedVectorType>(argumentType))
- {
- numElements = (unsigned)argumentVType->getNumElements();
- }
-diff --git a/IGC/Compiler/Optimizer/Scalarizer.cpp b/IGC/Compiler/Optimizer/Scalarizer.cpp
-index 4f59eaf9..a4e73a6d 100644
---- a/IGC/Compiler/Optimizer/Scalarizer.cpp
-+++ b/IGC/Compiler/Optimizer/Scalarizer.cpp
-@@ -289,7 +289,7 @@ void ScalarizeFunction::scalarizeInstruction(BinaryOperator* BI)
- {
- V_PRINT(scalarizer, "\t\tBinary instruction\n");
- IGC_ASSERT_MESSAGE(BI, "instruction type dynamic cast failed");
-- VectorType* instType = dyn_cast<VectorType>(BI->getType());
-+ IGCLLVM::FixedVectorType* instType = dyn_cast<IGCLLVM::FixedVectorType>(BI->getType());
- // Only need handling for vector binary ops
- if (!instType) return;
-
-@@ -349,7 +349,7 @@ void ScalarizeFunction::scalarizeInstruction(CmpInst* CI)
- {
- V_PRINT(scalarizer, "\t\tCompare instruction\n");
- IGC_ASSERT_MESSAGE(CI, "instruction type dynamic cast failed");
-- VectorType* instType = dyn_cast<VectorType>(CI->getType());
-+ IGCLLVM::FixedVectorType* instType = dyn_cast<IGCLLVM::FixedVectorType>(CI->getType());
- // Only need handling for vector compares
- if (!instType) return;
-
-@@ -397,13 +397,13 @@ void ScalarizeFunction::scalarizeInstruction(CastInst* CI)
- {
- V_PRINT(scalarizer, "\t\tCast instruction\n");
- IGC_ASSERT_MESSAGE(CI, "instruction type dynamic cast failed");
-- VectorType* instType = dyn_cast<VectorType>(CI->getType());
-+ IGCLLVM::FixedVectorType* instType = dyn_cast<IGCLLVM::FixedVectorType>(CI->getType());
-
- // For BitCast - we only scalarize if src and dst types have same vector length
- if (isa<BitCastInst>(CI))
- {
- if (!instType) return recoverNonScalarizableInst(CI);
-- VectorType* srcType = dyn_cast<VectorType>(CI->getOperand(0)->getType());
-+ IGCLLVM::FixedVectorType* srcType = dyn_cast<IGCLLVM::FixedVectorType>(CI->getOperand(0)->getType());
- if (!srcType || (instType->getNumElements() != srcType->getNumElements()))
- {
- return recoverNonScalarizableInst(CI);
-@@ -458,7 +458,7 @@ void ScalarizeFunction::scalarizeInstruction(PHINode* PI)
- {
- V_PRINT(scalarizer, "\t\tPHI instruction\n");
- IGC_ASSERT_MESSAGE(PI, "instruction type dynamic cast failed");
-- VectorType* instType = dyn_cast<VectorType>(PI->getType());
-+ IGCLLVM::FixedVectorType* instType = dyn_cast<IGCLLVM::FixedVectorType>(PI->getType());
- // Only need handling for vector PHI
- if (!instType) return;
-
-@@ -569,7 +569,7 @@ void ScalarizeFunction::scalarizeInstruction(SelectInst* SI)
- {
- V_PRINT(scalarizer, "\t\tSelect instruction\n");
- IGC_ASSERT_MESSAGE(SI, "instruction type dynamic cast failed");
-- VectorType* instType = dyn_cast<VectorType>(SI->getType());
-+ IGCLLVM::FixedVectorType* instType = dyn_cast<IGCLLVM::FixedVectorType>(SI->getType());
- // Only need handling for vector select
- if (!instType) return;
-
-@@ -651,7 +651,7 @@ void ScalarizeFunction::scalarizeInstruction(ExtractElementInst* EI)
-
- // Connect the "extracted" value to all its consumers
- uint64_t scalarIndex = cast<ConstantInt>(scalarIndexVal)->getZExtValue();
-- auto valueVType = cast<VectorType>(vectorValue->getType());
-+ auto valueVType = cast<IGCLLVM::FixedVectorType>(vectorValue->getType());
- if (static_cast<unsigned int>(scalarIndex) < (unsigned)valueVType->getNumElements())
- {
- IGC_ASSERT_MESSAGE(NULL != operand[static_cast<unsigned int>(scalarIndex)], "SCM error");
-@@ -715,7 +715,7 @@ void ScalarizeFunction::scalarizeInstruction(InsertElementInst* II)
- if (isa<UndefValue>(sourceVectorValue))
- {
- // Scalarize the undef value (generate a scalar undef)
-- VectorType* inputVectorType = dyn_cast<VectorType>(sourceVectorValue->getType());
-+ IGCLLVM::FixedVectorType* inputVectorType = dyn_cast<IGCLLVM::FixedVectorType>(sourceVectorValue->getType());
- IGC_ASSERT_MESSAGE(inputVectorType, "expected vector argument");
-
- UndefValue* undefVal = UndefValue::get(inputVectorType->getElementType());
-@@ -756,7 +756,7 @@ void ScalarizeFunction::scalarizeInstruction(ShuffleVectorInst* SI)
- IGC_ASSERT(nullptr != sourceVector0Value);
- Value* sourceVector1Value = SI->getOperand(1);
- IGC_ASSERT(nullptr != sourceVector1Value);
-- VectorType* const inputType = dyn_cast<VectorType>(sourceVector0Value->getType());
-+ IGCLLVM::FixedVectorType* const inputType = dyn_cast<IGCLLVM::FixedVectorType>(sourceVector0Value->getType());
- IGC_ASSERT_MESSAGE(nullptr != inputType, "vector input error");
- IGC_ASSERT_MESSAGE(inputType == sourceVector1Value->getType(), "vector input error");
- unsigned sourceVectorWidth = int_cast<unsigned>(inputType->getNumElements());
-@@ -778,7 +778,7 @@ void ScalarizeFunction::scalarizeInstruction(ShuffleVectorInst* SI)
-
- // Generate array for shuffled scalar values
- SmallVector<Value*, MAX_INPUT_VECTOR_WIDTH>newVector;
-- unsigned width = int_cast<unsigned>(SI->getType()->getNumElements());
-+ unsigned width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(SI->getType())->getNumElements());
-
- // Generate undef value, which may be needed as some scalar elements
- UndefValue* undef = UndefValue::get(inputType->getElementType());
-@@ -847,7 +847,7 @@ void ScalarizeFunction::scalarizeInstruction(GetElementPtrInst* GI)
-
- if (baseValue->getType()->isVectorTy())
- {
-- width = int_cast<unsigned>(dyn_cast<VectorType>(baseValue->getType())->getNumElements());
-+ width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(baseValue->getType())->getNumElements());
- // Obtain the scalarized operands
- obtainScalarizedValues(operand1, NULL, baseValue, GI);
- ptrTy = dyn_cast<VectorType>(baseValue->getType())->getElementType();
-@@ -858,7 +858,7 @@ void ScalarizeFunction::scalarizeInstruction(GetElementPtrInst* GI)
- }
- if (indexValue->getType()->isVectorTy())
- {
-- width = int_cast<unsigned>(dyn_cast<VectorType>(indexValue->getType())->getNumElements());
-+ width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(indexValue->getType())->getNumElements());
- // Obtain the scalarized operands
- obtainScalarizedValues(operand2, NULL, indexValue, GI);
- }
-@@ -897,7 +897,7 @@ void ScalarizeFunction::scalarizeInstruction(LoadInst* LI)
- V_PRINT(scalarizer, "\t\tLoad instruction\n");
- IGC_ASSERT_MESSAGE(LI, "instruction type dynamic cast failed");
-
-- VectorType* dataType = dyn_cast<VectorType>(LI->getType());
-+ IGCLLVM::FixedVectorType* dataType = dyn_cast<IGCLLVM::FixedVectorType>(LI->getType());
- if (isScalarizableLoadStoreType(dataType) && m_pDL)
- {
- // Prepare empty SCM entry for the instruction
-@@ -969,7 +969,7 @@ void ScalarizeFunction::scalarizeInstruction(StoreInst* SI)
-
- int indexPtr = SI->getPointerOperandIndex();
- int indexData = 1 - indexPtr;
-- VectorType* dataType = dyn_cast<VectorType>(SI->getOperand(indexData)->getType());
-+ IGCLLVM::FixedVectorType* dataType = dyn_cast<IGCLLVM::FixedVectorType>(SI->getOperand(indexData)->getType());
- if (isScalarizableLoadStoreType(dataType) && m_pDL)
- {
- // Get additional info from instruction
-@@ -1040,7 +1040,7 @@ void ScalarizeFunction::obtainScalarizedValues(SmallVectorImpl<Value*>& retValue
- {
- V_PRINT(scalarizer, "\t\t\tObtaining scalar value... " << *origValue << "\n");
-
-- VectorType* origType = dyn_cast<VectorType>(origValue->getType());
-+ IGCLLVM::FixedVectorType* origType = dyn_cast<IGCLLVM::FixedVectorType>(origValue->getType());
- IGC_ASSERT_MESSAGE(origType, "Value must have a vector type!");
- unsigned width = int_cast<unsigned>(origType->getNumElements());
-
-@@ -1202,7 +1202,7 @@ void ScalarizeFunction::obtainVectorValueWhichMightBeScalarizedImpl(Value* vecto
- }
-
- Value* assembledVector = UndefValue::get(vectorVal->getType());
-- unsigned width = int_cast<unsigned>(dyn_cast<VectorType>(vectorVal->getType())->getNumElements());
-+ unsigned width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(vectorVal->getType())->getNumElements());
- for (unsigned i = 0; i < width; i++)
- {
- IGC_ASSERT_MESSAGE(NULL != valueEntry->scalarValues[i], "SCM entry has NULL value");
-@@ -1262,7 +1262,7 @@ void ScalarizeFunction::updateSCMEntryWithValues(ScalarizeFunction::SCMEntry* en
- bool matchDbgLoc)
- {
- IGC_ASSERT_MESSAGE((origValue->getType()->isArrayTy() || origValue->getType()->isVectorTy()), "only Vector values are supported");
-- unsigned width = int_cast<unsigned>(dyn_cast<VectorType>(origValue->getType())->getNumElements());
-+ unsigned width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(origValue->getType())->getNumElements());
-
- entry->isOriginalVectorRemoved = isOrigValueRemoved;
-
-@@ -1326,7 +1326,7 @@ void ScalarizeFunction::resolveDeferredInstructions()
- Instruction* vectorInst = dyn_cast<Instruction>(current.unresolvedInst);
- IGC_ASSERT_MESSAGE(vectorInst, "DRL only handles unresolved instructions");
-
-- VectorType* currType = dyn_cast<VectorType>(vectorInst->getType());
-+ IGCLLVM::FixedVectorType* currType = dyn_cast<IGCLLVM::FixedVectorType>(vectorInst->getType());
- IGC_ASSERT_MESSAGE(currType, "Cannot have DRL of non-vector value");
- unsigned width = int_cast<unsigned>(currType->getNumElements());
-
-diff --git a/IGC/Compiler/Optimizer/ValueTracker.cpp b/IGC/Compiler/Optimizer/ValueTracker.cpp
-index c06f7312..d8f0d385 100644
---- a/IGC/Compiler/Optimizer/ValueTracker.cpp
-+++ b/IGC/Compiler/Optimizer/ValueTracker.cpp
-@@ -178,7 +178,7 @@ Value* ValueTracker::handleExtractElement(ExtractElementInst* E)
- {
- auto mask = I->getShuffleMask();
- uint shuffleidx = int_cast<uint>(mask[(uint)idx]);
-- auto vType = dyn_cast<VectorType>(I->getOperand(0)->getType());
-+ auto vType = dyn_cast<IGCLLVM::FixedVectorType>(I->getOperand(0)->getType());
- baseValue = (shuffleidx < vType->getNumElements()) ?
- I->getOperand(0) : I->getOperand(1);
- }
-diff --git a/IGC/Compiler/VerificationPass.cpp b/IGC/Compiler/VerificationPass.cpp
-index 98437d79..40d50f5a 100644
---- a/IGC/Compiler/VerificationPass.cpp
-+++ b/IGC/Compiler/VerificationPass.cpp
-@@ -302,7 +302,7 @@ bool VerificationPass::verifyType(Type* type, Value* val)
-
- case IGCLLVM::VectorTyID:
- {
-- auto VType = cast<VectorType>(type);
-+ auto VType = cast<IGCLLVM::FixedVectorType>(type);
- unsigned typeSize = (unsigned)VType->getNumElements();
- if (!m_IGC_IR_spec.vectorTypeSizes.count(typeSize))
- {
-diff --git a/IGC/DebugInfo/DebugInfoUtils.hpp b/IGC/DebugInfo/DebugInfoUtils.hpp
-index 7f2e288a..b77a550d 100644
---- a/IGC/DebugInfo/DebugInfoUtils.hpp
-+++ b/IGC/DebugInfo/DebugInfoUtils.hpp
-@@ -108,7 +108,11 @@ namespace IGC
- IGCLLVM::DIBuilder Builder(M);
- llvm::DIGlobalVariable* GV = GVs[j]->getVariable();
- llvm::DIScope* scopeToUse = GV->getScope();
-+#if LLVM_VERSION_MAJOR >= 12
-+ llvm::DILocation* locToUse = llvm::DILocation::get(scopeToUse->getContext(), GV->getLine(), 0, scopeToUse, loc);
-+#else
- llvm::DILocation* locToUse = llvm::DebugLoc::get(GV->getLine(), 0, scopeToUse, loc);
-+#endif
- if (llvm::isa<llvm::DICompileUnit>(GV->getScope()))
- {
- // Function has no DebugLoc so it is either internal
-diff --git a/IGC/DebugInfo/DwarfDebug.cpp b/IGC/DebugInfo/DwarfDebug.cpp
-index 683b83f7..bd9f17b7 100644
---- a/IGC/DebugInfo/DwarfDebug.cpp
-+++ b/IGC/DebugInfo/DwarfDebug.cpp
-@@ -2102,9 +2102,17 @@ static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext& Ctx)
- // Check for number of operands since the compatibility is cheap here.
- if (SP->getNumOperands() > 19)
- {
-+#if LLVM_VERSION_MAJOR >= 12
-+ return DILocation::get(SP->getContext(), SP->getScopeLine(), 0, SP);
-+#else
- return DebugLoc::get(SP->getScopeLine(), 0, SP);
-+#endif
- }
-+#if LLVM_VERSION_MAJOR >= 12
-+ return DILocation::get(SP->getContext(), SP->getLine(), 0, SP);
-+#else
- return DebugLoc::get(SP->getLine(), 0, SP);
-+#endif
- }
-
- return DebugLoc();
-diff --git a/IGC/GenISAIntrinsics/GenIntrinsics.cpp b/IGC/GenISAIntrinsics/GenIntrinsics.cpp
-index 708cfdaa..772155b2 100644
---- a/IGC/GenISAIntrinsics/GenIntrinsics.cpp
-+++ b/IGC/GenISAIntrinsics/GenIntrinsics.cpp
-@@ -204,7 +204,7 @@ static Type *DecodeFixedType(ArrayRef<GenISAIntrinsic::IITDescriptor> &Infos,
- case IITDescriptor::SameVecWidthArgument: {
- Type *EltTy = DecodeFixedType(Infos, Tys, Context);
- Type *Ty = Tys[D.getArgumentNumber()];
-- if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {
-+ if (IGCLLVM::FixedVectorType *VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty)) {
- return IGCLLVM::FixedVectorType::get(EltTy, int_cast<unsigned int>(VTy->getNumElements()));
- }
- IGC_ASSERT_EXIT_MESSAGE(0, "unhandled");
-@@ -215,7 +215,7 @@ static Type *DecodeFixedType(ArrayRef<GenISAIntrinsic::IITDescriptor> &Infos,
- }
- case IITDescriptor::VecOfPtrsToElt: {
- Type *Ty = Tys[D.getArgumentNumber()];
-- VectorType *VTy = dyn_cast<VectorType>(Ty);
-+ IGCLLVM::FixedVectorType *VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
- if (!VTy)
- IGC_ASSERT_EXIT_MESSAGE(0, "Expected an argument of Vector Type");
- Type *EltTy = cast<VectorType>(VTy)->getElementType();
-@@ -434,7 +434,7 @@ static std::string getMangledTypeStr(Type* Ty) {
- Result += "f";
- }
- else if (isa<VectorType>(Ty))
-- Result += "v" + utostr(cast<VectorType>(Ty)->getNumElements()) +
-+ Result += "v" + utostr(cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements()) +
- getMangledTypeStr(cast<VectorType>(Ty)->getElementType());
- else if (Ty)
- Result += EVT::getEVT(Ty).getEVTString();
-diff --git a/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp b/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
-index a89d63b9..a1bc5d2c 100644
---- a/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
-+++ b/IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp
-@@ -4929,7 +4929,7 @@ void LLVM3DBuilder<preserveNames, T, Inserter>::VectorToScalars(
- IGC_ASSERT(nullptr != vector->getType());
- IGC_ASSERT(vector->getType()->isVectorTy());
-
-- const unsigned count = (unsigned)llvm::cast<llvm::VectorType>(vector->getType())->getNumElements();
-+ const unsigned count = (unsigned)llvm::cast<IGCLLVM::FixedVectorType>(vector->getType())->getNumElements();
- IGC_ASSERT(1 < count);
- IGC_ASSERT(count <= 4);
- IGC_ASSERT(count <= maxSize);
-diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-index 08e5d6cf..30e29720 100644
---- a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-+++ b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-@@ -35,10 +35,16 @@ using namespace llvm;
- namespace IGCLLVM {
- #if LLVM_VERSION_MAJOR < 11
- inline unsigned getElementCount(unsigned EC) { return EC; }
--#else
-+#elif LLVM_VERSION_MAJOR == 11
- inline ElementCount getElementCount(unsigned EC) {
- return ElementCount(EC, false);
- }
-+#elif LLVM_VERSION_MAJOR == 12
-+inline ElementCount getElementCount(unsigned EC) {
-+ return ElementCount::get(EC, false);
-+}
-+#else
-+#error "unsupported LLVM version"
- #endif
- } // namespace IGCLLVM
-
-diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
-index f6e54fb1..5266ee87 100644
---- a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
-+++ b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Scalar.h
-@@ -44,7 +44,7 @@ namespace IGCLLVM
- {
- return llvm::createLoopUnrollPass(OptLevel, false, Threshold, Count, AllowPartial, Runtime, UpperBound, AllowPeeling);
- }
--#elif LLVM_VERSION_MAJOR == 9 || LLVM_VERSION_MAJOR == 10 || LLVM_VERSION_MAJOR == 11
-+#elif LLVM_VERSION_MAJOR >= 9 && LLVM_VERSION_MAJOR <= 12
- inline static llvm::Pass * createLoopUnrollPass(
- int OptLevel = 2, int Threshold = -1, int Count = -1,
- int AllowPartial = -1, int Runtime = -1,
-@@ -52,7 +52,7 @@ namespace IGCLLVM
- {
- return llvm::createLoopUnrollPass(OptLevel, false, false, Threshold, Count, AllowPartial, Runtime, UpperBound, AllowPeeling);
- }
--#elif LLVM_VERSION_MAJOR >= 12
-+#else
- //DO NOT assume same function signature for all incoming llvm versions! Double check to upgrade!
- #error Not supported llvm version.
- #endif
-diff --git a/IGC/common/igc_resourceDimTypes.h b/IGC/common/igc_resourceDimTypes.h
-index 6831b06c..d790330f 100644
---- a/IGC/common/igc_resourceDimTypes.h
-+++ b/IGC/common/igc_resourceDimTypes.h
-@@ -66,6 +66,11 @@ namespace IGC
- resourceDimTypeId == DIM_2D_TYPE || resourceDimTypeId == DIM_2D_ARRAY_TYPE ||
- resourceDimTypeId == DIM_3D_TYPE || resourceDimTypeId == DIM_CUBE_TYPE || resourceDimTypeId == DIM_CUBE_ARRAY_TYPE));
-
-+#if LLVM_VERSION_MAJOR >= 12
-+ llvm::LLVMContext& llvmCtx = module.getContext();
-+ return llvm::StructType::getTypeByName(llvmCtx, ResourceDimensionTypeName[resourceDimTypeId]);
-+#else
- return module.getTypeByName(ResourceDimensionTypeName[resourceDimTypeId]);
-+#endif
- }
- }
-\ No newline at end of file
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch
new file mode 100644
index 00000000..dca75e22
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch
@@ -0,0 +1,31 @@
+From e69a3181482e5f442756a61c7b683914072884f1 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Mon, 9 Jan 2023 11:43:05 +0800
+Subject: [PATCH] external/SPIRV-Tools: change path to tools and headers
+
+We clone the SPIRV headers and tools in a different directory to ensure
+file path substitutions take place.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+
+---
+ external/SPIRV-Tools/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/external/SPIRV-Tools/CMakeLists.txt b/external/SPIRV-Tools/CMakeLists.txt
+index 9afa5746c..7ca24d5dc 100644
+--- a/external/SPIRV-Tools/CMakeLists.txt
++++ b/external/SPIRV-Tools/CMakeLists.txt
+@@ -43,8 +43,8 @@ else() #By default use build from sources
+ message(STATUS "[SPIRV-Tools] : Building from source")
+ message(STATUS "[SPIRV-Tools] : Current source dir: ${CMAKE_CURRENT_SOURCE_DIR}")
+
+- set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../SPIRV-Headers") # used in subdirectory
+- set(SPIRV-Tools_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../SPIRV-Tools")
++ set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../SPIRV-Headers") # used in subdirectory
++ set(SPIRV-Tools_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../SPIRV-Tools")
+
+ set(SPIRV-Tools_OUTPUT_DIR "${IGC_OPTION__OUTPUT_DIR}/external/SPIRV-Tools/build")
+ set(IGC_BUILD__SPIRV-Headers_DIR "${SPIRV-Headers_SOURCE_DIR}")
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch
new file mode 100644
index 00000000..39443931
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch
@@ -0,0 +1,24 @@
+From 5648568e597acd0fed82aac3e6aef0f95a1b78d1 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Thu, 19 May 2022 22:50:09 +0800
+Subject: [PATCH] fix tblgen
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ IGC/cmake/igc_llvm.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/IGC/cmake/igc_llvm.cmake b/IGC/cmake/igc_llvm.cmake
+index 10322533c..9020cb3c8 100644
+--- a/IGC/cmake/igc_llvm.cmake
++++ b/IGC/cmake/igc_llvm.cmake
+@@ -52,7 +52,7 @@ else()
+ set(LLVM_OPT_EXE "opt" CACHE STRING "")
+
+ set(LLVM_TABLEGEN_EXE "llvm-tblgen")
+- if(CMAKE_CROSSCOMPILING)
++ if(TRUE)
+ if(DEFINED LLVM_TABLEGEN)
+ set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
+ else()
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-skip-execution-of-ElfPackager.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-skip-execution-of-ElfPackager.patch
deleted file mode 100644
index 65342d9c..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-skip-execution-of-ElfPackager.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 5501fab763aa2b11437fbdb19e07a11157a7d3e6 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Thu, 6 Feb 2020 14:56:56 +0800
-Subject: [PATCH] skip execution of ElfPackager
-
-ElfPackager adds the ability to convert llvm bitcode into elf files for
-easier partitioning. Skip for now until we start building a native
-version for this.
-
-Upstream-Status: Inappropriate [configuration specific]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- IGC/ElfPackager/CMakeLists.txt | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/IGC/ElfPackager/CMakeLists.txt b/IGC/ElfPackager/CMakeLists.txt
-index 563ac9d6..c6c74ce9 100644
---- a/IGC/ElfPackager/CMakeLists.txt
-+++ b/IGC/ElfPackager/CMakeLists.txt
-@@ -71,12 +71,12 @@ include_directories (
- ${IGC_SOURCE_DIR}/AdaptorOCL/CLElfLib/
- )
-
--if(NOT ANDROID)
-- add_custom_command(TARGET ${IGC_BUILD__PROJ__ElfPackager}
-- POST_BUILD
-- COMMAND $<TARGET_FILE:${IGC_BUILD__PROJ__ElfPackager}> -includeSizet -funcList ${CMAKE_CURRENT_SOURCE_DIR}/function_bin.txt ${IGC_BUILD__BIF_DIR}/OCLBiFImpl.bc ${IGC_BUILD__BIF_DIR}/igdclbif.bin
-- )
--endif()
-+#if(NOT ANDROID)
-+# add_custom_command(TARGET ${IGC_BUILD__PROJ__ElfPackager}
-+# POST_BUILD
-+# COMMAND $<TARGET_FILE:${IGC_BUILD__PROJ__ElfPackager}> -includeSizet -funcList ${CMAKE_CURRENT_SOURCE_DIR}/function_bin.txt ${IGC_BUILD__BIF_DIR}/OCLBiFImpl.bc ${IGC_BUILD__BIF_DIR}/igdclbif.bin
-+# )
-+#endif()
-
-
- add_dependencies("${IGC_BUILD__PROJ__ElfPackager}" "${IGC_BUILD__PROJ__BiFModule_OCL}")
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-Review-fixes-for-LLVM-12-phase-1.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-Review-fixes-for-LLVM-12-phase-1.patch
deleted file mode 100644
index 6580df75..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-Review-fixes-for-LLVM-12-phase-1.patch
+++ /dev/null
@@ -1,318 +0,0 @@
-From 60136b453bb3a109bfc88c4040b871af9d522ed5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
-Date: Thu, 25 Feb 2021 19:40:21 +0100
-Subject: [PATCH 2/3] Review fixes for LLVM 12 phase 1
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Pending
-
-Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 6 +-----
- IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp | 6 +-----
- IGC/Compiler/CISACodeGen/AdvMemOpt.cpp | 7 ++-----
- IGC/Compiler/CISACodeGen/Simd32Profitability.cpp | 7 ++-----
- IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp | 11 +----------
- IGC/Compiler/GenTTI.cpp | 9 ++-------
- IGC/Compiler/Legalizer/InstPromoter.cpp | 8 +-------
- .../DeviceEnqueueFuncs/TransformBlocks.cpp | 6 +-----
- .../OpenCLPasses/WIFuncs/WIFuncResolution.cpp | 4 ----
- IGC/Compiler/Optimizer/Scalarizer.cpp | 2 +-
- IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h | 10 ++++++++++
- .../include/llvmWrapper/Support/TypeSize.h | 4 +---
- .../include/llvmWrapper/Transforms/Utils/LoopUtils.h | 8 ++++++++
- IGC/common/igc_resourceDimTypes.h | 5 ++---
- 14 files changed, 33 insertions(+), 60 deletions(-)
-
-diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-index 725a1512..12f42be8 100644
---- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-@@ -1929,11 +1929,7 @@ SPIRVToLLVM::transType(SPIRVType *T) {
- auto name = isSubgroupAvcINTELTypeOpCode(OC) ?
- OCLSubgroupINTELTypeOpCodeMap::rmap(OC) :
- BuiltinOpaqueGenericTypeOpCodeMap::rmap(OC);
--#if LLVM_VERSION_MAJOR >= 12
-- auto *pST = llvm::StructType::getTypeByName(M->getContext(), name);
--#else
-- auto *pST = M->getTypeByName(name);
--#endif
-+ auto *pST = IGCLLVM::getTypeByName(M, name);
- pST = pST ? pST : StructType::create(*Context, name);
-
- return mapType(T, PointerType::get(pST, getOCLOpaqueTypeAddrSpace(OC)));
-diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-index 91b4623c..f4f0dee5 100644
---- a/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-+++ b/IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp
-@@ -93,11 +93,7 @@ saveLLVMModule(Module *M, const std::string &OutputFile) {
- PointerType*
- getOrCreateOpaquePtrType(Module *M, const std::string &Name,
- unsigned AddrSpace) {
--#if LLVM_VERSION_MAJOR >= 12
-- auto OpaqueType = llvm::StructType::getTypeByName(M->getContext(), Name);
--#else
-- auto OpaqueType = M->getTypeByName(Name);
--#endif
-+ auto OpaqueType = IGCLLVM::getTypeByName(M, Name);
- if (!OpaqueType)
- OpaqueType = StructType::create(M->getContext(), Name);
- return PointerType::get(OpaqueType, AddrSpace);
-diff --git a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-index fc45a510..a612a473 100644
---- a/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-+++ b/IGC/Compiler/CISACodeGen/AdvMemOpt.cpp
-@@ -33,6 +33,7 @@ IN THE SOFTWARE.
- #include <llvm/Support/Debug.h>
- #include <llvm/Support/raw_ostream.h>
- #include <llvm/Transforms/Utils/Local.h>
-+#include "llvmWrapper/Transforms/Utils/LoopUtils.h"
- #include "common/LLVMWarningsPop.hpp"
- #include "GenISAIntrinsics/GenIntrinsics.h"
- #include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
-@@ -134,11 +135,7 @@ bool AdvMemOpt::runOnFunction(Function& F) {
- for (auto I = LI->begin(), E = LI->end(); I != E; ++I)
- for (auto DFI = df_begin(*I), DFE = df_end(*I); DFI != DFE; ++DFI) {
- Loop* L = *DFI;
--#if LLVM_VERSION_MAJOR >= 12
-- if (L->isInnermost())
--#else
-- if (L->empty())
--#endif
-+ if (IGCLLVM::isInnermost(L))
- InnermostLoops.push_back(L);
- }
-
-diff --git a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-index c1f4a419..5393d4e8 100644
---- a/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-+++ b/IGC/Compiler/CISACodeGen/Simd32Profitability.cpp
-@@ -28,6 +28,7 @@ IN THE SOFTWARE.
- #include "Compiler/CISACodeGen/Platform.hpp"
- #include "common/LLVMWarningsPush.hpp"
- #include <llvmWrapper/IR/DerivedTypes.h>
-+#include <llvmWrapper/Transforms/Utils/LoopUtils.h>
- #include <llvm/IR/InstIterator.h>
- #include <llvm/IR/Operator.h>
- #include <llvmWrapper/IR/DerivedTypes.h>
-@@ -995,11 +996,7 @@ static bool hasLongStridedLdStInLoop(Function* F, LoopInfo* LI, WIAnalysis* WI)
- // Collect innermost simple loop.
- for (auto I = LI->begin(), E = LI->end(); I != E; ++I) {
- auto L = *I;
--#if LLVM_VERSION_MAJOR >= 12
-- if (!L->isInnermost())
--#else
-- if (!L->empty())
--#endif
-+ if (!IGCLLVM::isInnermost(L))
- continue;
- if (L->getNumBlocks() != 2)
- continue;
-diff --git a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-index adf992cb..33473c23 100644
---- a/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-+++ b/IGC/Compiler/ConvertMSAAPayloadTo16Bit.cpp
-@@ -153,21 +153,12 @@ void ConvertMSAAPayloadTo16Bit::visitCallInst(CallInst& I)
- // In OGL there are uses of ldmcs other then ldms, using vec4float type.
- // Fix them to use newly created 16bit ldmcs.
- if (ldmcs->getType()->isVectorTy() &&
--#if LLVM_VERSION_MAJOR >= 12
-- ldmcs->getType()->getScalarType()->isFloatTy())
--#else
-- ldmcs->getType()->getVectorElementType()->isFloatTy())
--#endif
-+ cast<IGCLLVM::FixedVectorType>(ldmcs->getType())->getElementType()->isFloatTy())
- {
- m_builder->SetInsertPoint(ldmcs);
-
--#if LLVM_VERSION_MAJOR >= 12
- uint ldmcsNumOfElements = cast<IGCLLVM::FixedVectorType>(ldmcs->getType())->getNumElements();
- uint new_mcs_callNumOfElements = cast<IGCLLVM::FixedVectorType>(new_mcs_call->getType())->getNumElements();
--#else
-- uint ldmcsNumOfElements = ldmcs->getType()->getVectorNumElements();
-- uint new_mcs_callNumOfElements = new_mcs_call->getType()->getVectorNumElements();
--#endif
-
- // vec of 16bit ints to vec of 32bit ints
- Type* new_mcs_callVecType = IGCLLVM::FixedVectorType::get(m_builder->getInt32Ty(), new_mcs_callNumOfElements);
-diff --git a/IGC/Compiler/GenTTI.cpp b/IGC/Compiler/GenTTI.cpp
-index 9e4d2f26..53e3ec9e 100644
---- a/IGC/Compiler/GenTTI.cpp
-+++ b/IGC/Compiler/GenTTI.cpp
-@@ -37,6 +37,7 @@ IN THE SOFTWARE.
- #include "llvm/Analysis/LoopInfo.h"
- #include "llvm/Analysis/ScalarEvolution.h"
- #include "llvm/Support/raw_ostream.h"
-+#include "llvmWrapper/Transforms/Utils/LoopUtils.h"
- #include "common/LLVMWarningsPop.hpp"
-
- using namespace llvm;
-@@ -216,13 +217,7 @@ namespace llvm {
-
- // Skip non-simple loop.
- if (L->getNumBlocks() != 1) {
-- if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) &&
--#if LLVM_VERSION_MAJOR >= 12
-- L->isInnermost()
--#else
-- L->empty()
--#endif
-- ) {
-+ if (IGC_IS_FLAG_ENABLED(EnableAdvRuntimeUnroll) && IGCLLVM::isInnermost(L)) {
- auto countNonPHI = [](BasicBlock* BB) {
- unsigned Total = BB->size();
- unsigned PHIs = 0;
-diff --git a/IGC/Compiler/Legalizer/InstPromoter.cpp b/IGC/Compiler/Legalizer/InstPromoter.cpp
-index 8fadf89f..63cbccb5 100644
---- a/IGC/Compiler/Legalizer/InstPromoter.cpp
-+++ b/IGC/Compiler/Legalizer/InstPromoter.cpp
-@@ -398,13 +398,7 @@ bool InstPromoter::visitBitCastInst(BitCastInst& I) {
- IRB->CreateBitCast(Val, IGCLLVM::FixedVectorType::get(DestTy->getScalarType(), N));
-
- std::vector<Constant*> Vals;
-- for (unsigned i = 0;
--#if LLVM_VERSION_MAJOR >= 12
-- i < cast<IGCLLVM::FixedVectorType>(DestTy)->getNumElements();
--#else
-- i < DestTy->getVectorNumElements();
--#endif
-- i++)
-+ for (unsigned i = 0; i < cast<IGCLLVM::FixedVectorType>(DestTy)->getNumElements(); i++)
- Vals.push_back(IRB->getInt32(i));
-
- Value* Mask = ConstantVector::get(Vals);
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-index 119520ed..a3681b79 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/DeviceEnqueueFuncs/TransformBlocks.cpp
-@@ -952,11 +952,7 @@ namespace //Anonymous
- {
- auto ndrangeStructName = "struct.ndrange_t";
- auto module = _deviceExecCall->getModule();
--#if LLVM_VERSION_MAJOR >= 12
-- auto ndrangeTy = llvm::StructType::getTypeByName(module->getContext(), ndrangeStructName);
--#else
-- auto ndrangeTy = module->getTypeByName(ndrangeStructName);
--#endif
-+ auto ndrangeTy = IGCLLVM::getTypeByName(module, ndrangeStructName);
- if (ndrangeTy == nullptr)
- {
- //create struct type
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-index 535d6268..c23c661d 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp
-@@ -303,11 +303,7 @@ static Value* BuildLoadInst(CallInst& CI, unsigned int Offset, Type* DataType)
- auto Size = ElemByteSize;
- if (DataType->isVectorTy())
- {
--#if LLVM_VERSION_MAJOR >= 12
- Size *= cast<IGCLLVM::FixedVectorType>(DataType)->getNumElements();
--#else
-- Size *= DataType->getVectorNumElements();
--#endif
- }
- unsigned int AlignedOffset = (Offset / ElemByteSize) * ElemByteSize;
- unsigned int LoadByteSize = (Offset == AlignedOffset) ? Size : Size * 2;
-diff --git a/IGC/Compiler/Optimizer/Scalarizer.cpp b/IGC/Compiler/Optimizer/Scalarizer.cpp
-index a4e73a6d..38627553 100644
---- a/IGC/Compiler/Optimizer/Scalarizer.cpp
-+++ b/IGC/Compiler/Optimizer/Scalarizer.cpp
-@@ -778,7 +778,7 @@ void ScalarizeFunction::scalarizeInstruction(ShuffleVectorInst* SI)
-
- // Generate array for shuffled scalar values
- SmallVector<Value*, MAX_INPUT_VECTOR_WIDTH>newVector;
-- unsigned width = int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(SI->getType())->getNumElements());
-+ unsigned width = int_cast<unsigned>(cast<IGCLLVM::FixedVectorType>(SI->getType())->getNumElements());
-
- // Generate undef value, which may be needed as some scalar elements
- UndefValue* undef = UndefValue::get(inputType->getElementType());
-diff --git a/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h b/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
-index a3f5a0b8..6a5407bb 100644
---- a/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
-+++ b/IGC/WrapperLLVM/include/llvmWrapper/IR/DerivedTypes.h
-@@ -29,6 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- #include "llvm/Config/llvm-config.h"
- #include "llvm/IR/DerivedTypes.h"
-+#include "llvm/IR/Module.h"
-
- namespace IGCLLVM
- {
-@@ -62,6 +63,15 @@ namespace IGCLLVM
- return false;
- #endif
- }
-+
-+ inline llvm::StructType *getTypeByName(llvm::Module *M, llvm::StringRef Name) {
-+#if LLVM_VERSION_MAJOR >= 12
-+ return llvm::StructType::getTypeByName(M->getContext(), Name);
-+#else
-+ return M->getTypeByName(Name);
-+#endif
-+ }
-+
- }
-
- #endif
-diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-index 30e29720..7021820c 100644
---- a/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-+++ b/IGC/WrapperLLVM/include/llvmWrapper/Support/TypeSize.h
-@@ -39,12 +39,10 @@ inline unsigned getElementCount(unsigned EC) { return EC; }
- inline ElementCount getElementCount(unsigned EC) {
- return ElementCount(EC, false);
- }
--#elif LLVM_VERSION_MAJOR == 12
-+#else
- inline ElementCount getElementCount(unsigned EC) {
- return ElementCount::get(EC, false);
- }
--#else
--#error "unsupported LLVM version"
- #endif
- } // namespace IGCLLVM
-
-diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
-index db47b00b..bce9cfc1 100644
---- a/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
-+++ b/IGC/WrapperLLVM/include/llvmWrapper/Transforms/Utils/LoopUtils.h
-@@ -41,6 +41,14 @@ namespace IGCLLVM
- return llvm::InsertPreheaderForLoop(L, DT, LI, nullptr, PreserveLCSSA);
- }
- #endif
-+
-+ inline bool isInnermost(llvm::Loop *L) {
-+#if LLVM_VERSION_MAJOR >= 12
-+ return L->isInnermost();
-+#else
-+ return L->empty();
-+#endif
-+ }
- }
-
- #endif
-diff --git a/IGC/common/igc_resourceDimTypes.h b/IGC/common/igc_resourceDimTypes.h
-index d790330f..2d675969 100644
---- a/IGC/common/igc_resourceDimTypes.h
-+++ b/IGC/common/igc_resourceDimTypes.h
-@@ -67,10 +67,9 @@ namespace IGC
- resourceDimTypeId == DIM_3D_TYPE || resourceDimTypeId == DIM_CUBE_TYPE || resourceDimTypeId == DIM_CUBE_ARRAY_TYPE));
-
- #if LLVM_VERSION_MAJOR >= 12
-- llvm::LLVMContext& llvmCtx = module.getContext();
-- return llvm::StructType::getTypeByName(llvmCtx, ResourceDimensionTypeName[resourceDimTypeId]);
-+ return llvm::StructType::getTypeByName(module.getContext(), ResourceDimensionTypeName[resourceDimTypeId]);
- #else
- return module.getTypeByName(ResourceDimensionTypeName[resourceDimTypeId]);
- #endif
- }
--}
-\ No newline at end of file
-+}
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/improve_src_package_reproducibility.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch
index c694836f..650130a8 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/improve_src_package_reproducibility.patch
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch
@@ -1,4 +1,4 @@
-From 2fa3f2da1179bd5b2eeac82839d386f0111e611c Mon Sep 17 00:00:00 2001
+From 0559332abd04b6c8bc70171d201f43d2e4735336 Mon Sep 17 00:00:00 2001
From: Lee Chee Yang <chee.yang.lee@intel.com>
Date: Wed, 2 Sep 2020 08:28:35 +0800
Subject: [PATCH] Improve Reproducibility for src package
@@ -9,15 +9,16 @@ this only works on bison 3.7 onward, hence check for bison version
before adding the flags.
Upstream-Status: Inappropriate [applying --file-prefix-map in such way does not work for upstream]
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
+
---
visa/CMakeLists.txt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/visa/CMakeLists.txt b/visa/CMakeLists.txt
-index 981c35d2..d5944370 100644
+index 6be467587..930c386a6 100644
--- a/visa/CMakeLists.txt
+++ b/visa/CMakeLists.txt
-@@ -109,8 +109,11 @@ endif()
+@@ -123,8 +123,11 @@ endif()
set(bison_output_file ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.cpp)
set(flex_output_file ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.cpp)
@@ -31,6 +32,3 @@ index 981c35d2..d5944370 100644
ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser)
set(CISAScanner_dependencies)
---
-2.28.0
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Review-fixes-for-LLVM-12-phase-2.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Review-fixes-for-LLVM-12-phase-2.patch
deleted file mode 100644
index 189c2b3f..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Review-fixes-for-LLVM-12-phase-2.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From c6d333637537263930acb1b6c5dadb0467d745f6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
-Date: Fri, 26 Feb 2021 06:39:35 +0100
-Subject: [PATCH 3/3] Review fixes for LLVM 12 phase 2
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Pending
-
-Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp | 4 ----
- .../AddressSpaceAliasAnalysis.cpp | 10 +++++-----
- .../PrivateMemory/PrivateMemoryResolution.cpp | 4 ----
- IGC/DebugInfo/DebugInfoUtils.hpp | 4 ----
- IGC/DebugInfo/DwarfDebug.cpp | 8 --------
- 5 files changed, 5 insertions(+), 25 deletions(-)
-
-diff --git a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-index 12f42be8..c4f9d1ea 100644
---- a/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-+++ b/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp
-@@ -1576,11 +1576,7 @@ void SPIRVToLLVMDbgTran::transDbgInfo(SPIRVValue *SV, Value *V) {
- Line->getColumn(), scope, iat);
-
- if(scope && !isa<DIFile>(scope))
--#if LLVM_VERSION_MAJOR >= 12
- I->setDebugLoc(DILocation::get(scope->getContext(), Line->getLine(), Line->getColumn(),
--#else
-- I->setDebugLoc(DebugLoc::get(Line->getLine(), Line->getColumn(),
--#endif
- scope, iat));
- }
- }
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-index e9c07b34..b6b779da 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp
-@@ -23,8 +23,7 @@ IN THE SOFTWARE.
- ============================= end_copyright_notice ===========================*/
-
- #include "llvm/Config/llvm-config.h"
--#include "llvmWrapper/IR/DerivedTypes.h"
--#include "llvmWrapper/Analysis/TargetLibraryInfo.h"
-+#include <llvm/Analysis/TargetLibraryInfo.h>
- #include "Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.h"
- #include "Compiler/CodeGenPublic.h"
- #include "Compiler/IGCPassSupport.h"
-@@ -180,11 +179,12 @@ namespace {
- bool doInitialization(Module& M) override {
- if(M.size() > 0)
- {
-+ Result.reset(new AddressSpaceAAResult(
-+ getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
- #if LLVM_VERSION_MAJOR >= 10
-- Function &F = *M.begin();
-+ *M.begin()
- #endif
-- Result.reset(new AddressSpaceAAResult(
-- getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(),
-+ ),
- *getAnalysis<CodeGenContextWrapper>().getCodeGenContext()));
- }
- return false;
-diff --git a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-index 07f85f4c..98ea616f 100644
---- a/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-+++ b/IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp
-@@ -816,11 +816,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
- // Construct an empty DebugLoc.
- IF_DEBUG_INFO(DebugLoc entryDebugLoc);
- // Assign with the function location if available.
--#if LLVM_VERSION_MAJOR >= 12
- IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DILocation::get(subprogram->getContext(), subprogram->getLine(), 0, subprogram););
--#else
-- IF_DEBUG_INFO_IF(DISubprogram *subprogram = m_currFunction->getSubprogram(), entryDebugLoc = DebugLoc::get(subprogram->getLine(), 0, subprogram););
--#endif
- IF_DEBUG_INFO(entryBuilder.SetCurrentDebugLocation(entryDebugLoc));
-
- if (privateOnStack)
-diff --git a/IGC/DebugInfo/DebugInfoUtils.hpp b/IGC/DebugInfo/DebugInfoUtils.hpp
-index b77a550d..88b30a75 100644
---- a/IGC/DebugInfo/DebugInfoUtils.hpp
-+++ b/IGC/DebugInfo/DebugInfoUtils.hpp
-@@ -108,11 +108,7 @@ namespace IGC
- IGCLLVM::DIBuilder Builder(M);
- llvm::DIGlobalVariable* GV = GVs[j]->getVariable();
- llvm::DIScope* scopeToUse = GV->getScope();
--#if LLVM_VERSION_MAJOR >= 12
- llvm::DILocation* locToUse = llvm::DILocation::get(scopeToUse->getContext(), GV->getLine(), 0, scopeToUse, loc);
--#else
-- llvm::DILocation* locToUse = llvm::DebugLoc::get(GV->getLine(), 0, scopeToUse, loc);
--#endif
- if (llvm::isa<llvm::DICompileUnit>(GV->getScope()))
- {
- // Function has no DebugLoc so it is either internal
-diff --git a/IGC/DebugInfo/DwarfDebug.cpp b/IGC/DebugInfo/DwarfDebug.cpp
-index bd9f17b7..3d9f0835 100644
---- a/IGC/DebugInfo/DwarfDebug.cpp
-+++ b/IGC/DebugInfo/DwarfDebug.cpp
-@@ -2102,17 +2102,9 @@ static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext& Ctx)
- // Check for number of operands since the compatibility is cheap here.
- if (SP->getNumOperands() > 19)
- {
--#if LLVM_VERSION_MAJOR >= 12
- return DILocation::get(SP->getContext(), SP->getScopeLine(), 0, SP);
--#else
-- return DebugLoc::get(SP->getScopeLine(), 0, SP);
--#endif
- }
--#if LLVM_VERSION_MAJOR >= 12
- return DILocation::get(SP->getContext(), SP->getLine(), 0, SP);
--#else
-- return DebugLoc::get(SP->getLine(), 0, SP);
--#endif
- }
-
- return DebugLoc();
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/link-to-LLVMGenXIntrinsics.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/link-to-LLVMGenXIntrinsics.patch
deleted file mode 100644
index aead2d1c..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/link-to-LLVMGenXIntrinsics.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 11b923c99cbe3580885ce40c322277fc823107a0 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Tue, 2 Feb 2021 13:39:53 +0800
-Subject: [PATCH] IGC/VectorCompiler/CMakeLists.txt: link to external
- LLVMGenXIntrinsics
-
-By default LLVMGenXIntrinsics is to be build In-tree, but we want to
-link externally.
-
-Fix llvm-tblgen path.
-
-Upstream-Status: Inappropriate [configuration specific]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- IGC/VectorCompiler/CMakeLists.txt | 32 ++-----------------------------
- 1 file changed, 2 insertions(+), 30 deletions(-)
-
-diff --git a/IGC/VectorCompiler/CMakeLists.txt b/IGC/VectorCompiler/CMakeLists.txt
-index 86f343ee..b4268160 100644
---- a/IGC/VectorCompiler/CMakeLists.txt
-+++ b/IGC/VectorCompiler/CMakeLists.txt
-@@ -53,10 +53,7 @@ if(IGC_BUILD__USING_SYSTEM_LLVM OR (WIN32 AND LLVM_USE_PREBUILT))
- message(STATUS "[VC] Using system llvm")
-
- # Need to search for llvm-tblgen
-- find_program(LLVM_TABLEGEN_EXE "llvm-tblgen"
-- ${LLVM_TOOLS_BINARY_DIR}
-- NO_DEFAULT_PATH
-- )
-+ find_program(LLVM_TABLEGEN_EXE "llvm-tblgen")
- if(LLVM_TABLEGEN_EXE-NOTFOUND)
- message(FATAL_ERROR "[VC] llvm-tblgen is not found")
- endif()
-@@ -140,32 +137,7 @@ if(LLVM_ON_WIN32)
- add_compile_options(/wd4141)
- endif()
-
--if(DEFINED VC_INTRINSICS_SRC)
-- set(INTRSRC "${VC_INTRINSICS_SRC}/GenXIntrinsics")
--endif()
--
--if(NOT DEFINED INTRSRC)
-- set(INTRSRC "${CMAKE_CURRENT_SOURCE_DIR}/../../../vc-intrinsics/GenXIntrinsics")
--endif()
--
--message(STATUS "[VC] Using vc-intrinsics source from: ${INTRSRC}")
--
--# We are using prebuilt SPIRV and building intrinsics.
--set(INTRBUILD "${CMAKE_CURRENT_BINARY_DIR}/intrbuild")
--add_subdirectory(${INTRSRC} ${INTRBUILD})
--# Make separate target for intrinstics headers.
--# Ideally, this should be inside intrinsics, but
--# this breaks in-tree build of intrinsics with LLVM.
--add_library(VCIntrinsicsHeaders INTERFACE)
--target_include_directories(VCIntrinsicsHeaders
-- INTERFACE
-- ${INTRSRC}/include
-- ${INTRBUILD}/include
-- )
--add_dependencies(VCIntrinsicsHeaders
-- GenXIntrinsics
-- )
--
-+find_package(LLVMGenXIntrinsics REQUIRED)
- include(cmake/spirv.cmake)
- include(${IGC_SOURCE_DIR}/cmake/utils.cmake)
-
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.15985.7.bb b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.15985.7.bb
new file mode 100644
index 00000000..96d828b6
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.15985.7.bb
@@ -0,0 +1,75 @@
+SUMMARY = "The Intel(R) Graphics Compiler for OpenCL(TM)"
+DESCRIPTION = "The Intel(R) Graphics Compiler for OpenCL(TM) is an \
+llvm based compiler for OpenCL(TM) targeting Intel Gen graphics \
+hardware architecture."
+
+LICENSE = "MIT & Apache-2.0"
+LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \
+ file://LICENSE.md;md5=488d74376edf2765f6e78d271543dde3 \
+ file://NOTICES.txt;md5=7f4fbc3eb2c34807465e63b1ec3c9d1a"
+
+SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https;name=igc;branch=releases/igc-1.0.15985 \
+ git://github.com/intel/vc-intrinsics.git;protocol=https;destsuffix=git/vc-intrinsics;name=vc;nobranch=1 \
+ git://github.com/KhronosGroup/SPIRV-Tools.git;protocol=https;destsuffix=git/SPIRV-Tools;name=spirv-tools;branch=main \
+ git://github.com/KhronosGroup/SPIRV-Headers.git;protocol=https;destsuffix=git/SPIRV-Headers;name=spirv-headers;branch=main \
+ file://0003-Improve-Reproducibility-for-src-package.patch \
+ file://0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch \
+ file://0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch \
+ "
+
+SRC_URI:append:class-native = " file://0001-fix-tblgen.patch"
+
+SRCREV_igc = "6cc111d262e1c3abcf4bc6b6d8a589ebf821a5c0"
+SRCREV_vc = "da892e1982b6c25b9a133f85b4ac97142d8a3def"
+SRCREV_spirv-tools = "f0cc85efdbbe3a46eae90e0f915dc1509836d0fc"
+SRCREV_spirv-headers = "cca08c63cefa129d082abca0302adcb81610b465"
+
+SRCREV_FORMAT = "igc_vc_spirv-tools_spirv-headers"
+
+# Used to replace with relative path in reproducibility patch
+export B
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig qemu python3native
+
+CXXFLAGS:append = " -Wno-error=nonnull"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+DEPENDS += " flex-native bison-native clang clang-cross-x86_64 opencl-clang qemu-native python3-mako-native"
+
+RDEPENDS:${PN} += "opencl-clang"
+
+PACKAGECONFIG ??= "vc"
+PACKAGECONFIG[vc] = "-DIGC_BUILD__VC_ENABLED=ON -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR=ON -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Prebuilds,-DIGC_BUILD__VC_ENABLED=OFF,"
+
+EXTRA_OECMAKE = " \
+ -DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} \
+ -DVC_INTRINSICS_SRC="${S}/vc-intrinsics" \
+ -DIGC_OPTION__LLVM_MODE=Prebuilds \
+ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
+ -DLLVM_LINK_EXE=${STAGING_BINDIR_NATIVE}/llvm-link \
+ -DCLANG_EXE=${STAGING_BINDIR_NATIVE}/clang \
+ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \
+ "
+
+do_configure:prepend:class-target () {
+ # Write out a qemu wrapper that will be used by cmake.
+ qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
+ cat > ${WORKDIR}/qemuwrapper << EOF
+#!/bin/sh
+$qemu_binary "\$@"
+EOF
+ chmod +x ${WORKDIR}/qemuwrapper
+}
+
+UPSTREAM_CHECK_GITTAGREGEX = "^igc-(?P<pver>(?!19\..*)\d+(\.\d+)+)$"
+
+FILES:${PN} += " \
+ ${libdir}/igc/NOTICES.txt \
+ "
+
+# libigc.so contains buildpaths
+INSANE_SKIP:${PN} += "buildpaths"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.6646.bb b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.6646.bb
deleted file mode 100644
index 582db553..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.6646.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-SUMMARY = "The Intel(R) Graphics Compiler for OpenCL(TM)"
-DESCRIPTION = "The Intel(R) Graphics Compiler for OpenCL(TM) is an \
-llvm based compiler for OpenCL(TM) targeting Intel Gen graphics \
-hardware architecture."
-
-LICENSE = "MIT & BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \
- file://IGC/Compiler/LegalizationPass.cpp;beginline=1;endline=23;md5=8b19c5999abc484f18232b0905367f9f \
- file://NOTICES.txt;md5=b12e73994de4fbe0f688cf0bc91512a0"
-
-SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https; \
- file://0001-skip-execution-of-ElfPackager.patch \
- file://link-to-LLVMGenXIntrinsics.patch \
- file://improve_src_package_reproducibility.patch \
- file://0001-Fix-build-with-LLVM-12.patch \
- file://0002-Review-fixes-for-LLVM-12-phase-1.patch \
- file://0003-Review-fixes-for-LLVM-12-phase-2.patch \
- "
-
-SRCREV = "535aaaef03ce338e05e6162118082e6e007e8c10"
-
-# Used to replace with relative path in reproducibility patch
-export B
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-DEPENDS += " flex-native bison-native clang opencl-clang vc-intrinsics"
-DEPENDS_append_class-target = " clang-cross-x86_64"
-
-RDEPENDS_${PN} += "opencl-clang"
-
-EXTRA_OECMAKE = "-DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 -DIGC_BUILD__VC_ENABLED=OFF -DIGC_BUILD__USE_KHRONOS_SPIRV_TRANSLATOR=ON"
-
-BBCLASSEXTEND = "native nativesdk"
-
-UPSTREAM_CHECK_GITTAGREGEX = "^igc-(?P<pver>(?!19\..*)\d+(\.\d+)+)$"
-
-FILES_${PN} += " \
- ${libdir}/igc/NOTICES.txt \
- "
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch
deleted file mode 100644
index 8ffa853b..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 7fc05c52dd91902fa324a7aac9b90715cfca4717 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 15 Apr 2020 17:55:32 +0800
-Subject: [PATCH] Building in-tree with LLVM 10.0 with the LLVM_LINK_LLVM_DYLIB
-
-Failed to link with the LLVMSPIRVLib library.
-
-Add an explicit dependency to force the correct build order and linking.
-
-Reference:
-https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/a6d4ccf082858e63e139ca06c02a071c343d2657
-
-Upstream-Status: Submitted [https://github.com/intel/opencl-clang/pull/118]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 51c140d..b8b514e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -208,7 +208,7 @@ link_directories(
-
- set(OPENCL_CLANG_LINK_LIBS ${CMAKE_DL_LIBS})
-
--if(NOT LLVMSPIRVLib IN_LIST LLVM_AVAILABLE_LIBS)
-+if(NOT LLVMSPIRVLib IN_LIST LLVM_AVAILABLE_LIBS OR (USE_PREBUILT_LLVM AND LLVM_LINK_LLVM_DYLIB))
- # SPIRV-LLVM-Translator is not included into LLVM as a component.
- # So, we need to list it here explicitly as an external library
- list(APPEND OPENCL_CLANG_LINK_LIBS LLVMSPIRVLib)
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch
new file mode 100644
index 00000000..031a77c7
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch
@@ -0,0 +1,49 @@
+From 5aea653e611b59c70e529a1bd71885a509831557 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Tue, 1 Aug 2023 11:15:31 +0800
+Subject: [PATCH] cl_headers/CMakeLists.txt: use clang from native sysroot
+
+Allow clang to be found in target sysroot for target builds and dont try
+to compile cross binaries, we do that ourselves.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ CMakeLists.txt | 8 ++++----
+ cl_headers/CMakeLists.txt | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5864009..60ba39e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,10 +35,10 @@ set(CMAKE_MODULE_PATH
+
+ include(CMakeFunctions)
+
+-if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL)
+- include(CrossCompile)
+- llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release)
+-endif()
++#if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL)
++# include(CrossCompile)
++# llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release)
++#endif()
+
+ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ set(USE_PREBUILT_LLVM ON)
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 16cabb7..4423536 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ set(CL_HEADERS_LIB cl_headers)
+ if(USE_PREBUILT_LLVM)
+- find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
++ find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR})
+ else()
+ set(CLANG_COMMAND $<TARGET_FILE:clang>)
+ endif()
+--
+2.37.3
+
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
deleted file mode 100644
index 8df7e3ab..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f3ef79a6301bab0b3a447f07ceb94c39a95009df Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Thu, 2 Apr 2020 08:59:20 +0800
-Subject: [PATCH] don't redefine LLVM_TABLEGEN_EXE
-
-Use the value that has been passed by the user.
-
-Upstream-Status: Submitted
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- CMakeLists.txt | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6893e97..941b0ae 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -137,7 +137,10 @@ endif(NOT USE_PREBUILT_LLVM)
- set (COMPILE_OPTIONS_TD opencl_clang_options.td)
- set (COMPILE_OPTIONS_INC opencl_clang_options.inc)
-
--set(LLVM_TABLEGEN_EXE "llvm-tblgen")
-+if(NOT DEFINED LLVM_TABLEGEN_EXE)
-+ set(LLVM_TABLEGEN_EXE "llvm-tblgen")
-+endif()
-+
- set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD})
- if(USE_PREBUILT_LLVM)
- set(TABLEGEN_ADDITIONAL -I ${LLVM_INCLUDE_DIRS})
---
-2.25.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch
new file mode 100644
index 00000000..2f1814f8
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch
@@ -0,0 +1,60 @@
+From 43c806ef321b1f677a49d28c89fb7ffecf539c2d Mon Sep 17 00:00:00 2001
+From: Tim Creech <timothy.m.creech@intel.com>
+Date: Wed, 28 Jun 2023 03:45:51 -0400
+Subject: [PATCH 2/2] Request native clang only when cross-compiling (#464)
+
+* Request native clang only when cross-compiling
+
+LLVM_USE_HOST_TOOLS may be set if LLVM is configured with
+LLVM_OPTIMIZED_TABLEGEN, which does not necessarily indicate
+cross-compilation or that clang will only execute on the target.
+
+By checking that CMAKE_CROSSCOMPILING is set, we ensure that we only
+build/use clang again if necessary for host execution.
+
+* fixup: CMAKE_CROSSCOMPILING implies LLVM_USE_HOST_TOOLS
+
+Co-authored-by: Wenju He <wenju.he@intel.com>
+
+* fixup: also use CMAKE_CROSSCOMPILING in top-level CMakeLists.txt
+
+---------
+
+Co-authored-by: Wenju He <wenju.he@intel.com>
+
+Upstream-Status: Backport [https://github.com/intel/opencl-clang/commit/53843eee13cfb2357919ee02714a43bef1af0f86]
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ CMakeLists.txt | 2 +-
+ cl_headers/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e772de9..5864009 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,7 +35,7 @@ set(CMAKE_MODULE_PATH
+
+ include(CMakeFunctions)
+
+-if(LLVM_USE_HOST_TOOLS AND OPENCL_CLANG_BUILD_EXTERNAL)
++if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL)
+ include(CrossCompile)
+ llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release)
+ endif()
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 18296c2..16cabb7 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -4,7 +4,7 @@ if(USE_PREBUILT_LLVM)
+ else()
+ set(CLANG_COMMAND $<TARGET_FILE:clang>)
+ endif()
+-if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL)
++if(CMAKE_CROSSCOMPILING AND NOT OPENCL_CLANG_BUILD_EXTERNAL)
+ build_native_tool(clang CLANG_COMMAND)
+ endif()
+
+--
+2.37.3
+
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-make-sure-only-static-libraries-linked-for-native-bu.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-make-sure-only-static-libraries-linked-for-native-bu.patch
deleted file mode 100644
index 473f4d24..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-make-sure-only-static-libraries-linked-for-native-bu.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From b29e00e6fe428a031cf577dfb703cf13eff837f6 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 15 Apr 2020 18:05:14 +0800
-Subject: [PATCH 2/2] make sure only static libraries linked for native build
-
-LINK_COMPONENTS=all isn't working for static libs for out of tree builds. Use
-LLVM_AVAILABLE_LIBS instead. Reported:
-
-https://github.com/intel/opencl-clang/issues/114
-
-Upstream-Status: Pending
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- CMakeLists.txt | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8707487..ad2dbda 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -218,7 +218,7 @@ add_subdirectory(cl_headers)
-
- set(LLVM_REQUIRES_EH ON)
-
--if(USE_PREBUILT_LLVM OR CLANG_LINK_CLANG_DYLIB)
-+if(false)
- list(APPEND OPENCL_CLANG_LINK_LIBS clang-cpp)
- else()
- list(APPEND OPENCL_CLANG_LINK_LIBS
-@@ -266,6 +266,7 @@ add_llvm_library(${TARGET_NAME} SHARED
- all
- LINK_LIBS
- ${OPENCL_CLANG_LINK_LIBS}
-+ ${LLVM_AVAILABLE_LIBS}
- )
-
- # Configure resource file on Windows
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_11.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
index 0c5d0508..31a3fb21 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_11.0.0.bb
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
@@ -5,31 +5,30 @@ DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \
LICENSE = "NCSA"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
-SRC_URI = "git://github.com/intel/opencl-clang.git;branch=ocl-open-110;protocol=https \
- file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
+SRC_URI = "git://github.com/intel/opencl-clang.git;branch=${BRANCH};protocol=https \
+ file://0002-Request-native-clang-only-when-cross-compiling-464.patch \
+ file://0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch \
"
-SRC_URI_append_class-native = " file://0002-make-sure-only-static-libraries-linked-for-native-bu.patch"
-
-SRCREV = "c67648d41df00ea8ee9d701d17299b86f86f0321"
-
S = "${WORKDIR}/git"
inherit cmake
DEPENDS += "clang"
-DEPENDS_append_class-target = " opencl-clang-native"
+DEPENDS:append:class-target = " opencl-clang-native"
COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
+COMPATIBLE_HOST:libc-musl = "null"
+
+DEPENDS += " spirv-llvm-translator"
EXTRA_OECMAKE += "\
-DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
-DCMAKE_SKIP_RPATH=TRUE \
- -DPREFERRED_LLVM_VERSION="11.1.0" \
+ -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \
"
-do_install_append_class-native() {
+do_install:append:class-native() {
install -d ${D}${bindir}
- install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
+ install -m 0755 ${B}/bin/linux_resource_linker ${D}${bindir}/
}
BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
deleted file mode 100644
index c5ba96c1..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Common clang is a thin wrapper library around clang"
-DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \
- to compile OpenCL C kernels to SPIR-V modules."
-
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
-
-SRC_URI = "git://github.com/intel/opencl-clang.git;branch=ocl-open-100;protocol=https \
- file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
- file://0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch \
- "
-SRC_URI_append_class-native = " file://0002-make-sure-only-static-libraries-linked-for-native-bu.patch"
-
-SRCREV = "92f3f7f1a06f25fb13708f87c26b0fbf50924c96"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-DEPENDS += "clang"
-DEPENDS_append_class-target = " opencl-clang-native"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-EXTRA_OECMAKE += "\
- -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
- -DCMAKE_SKIP_RPATH=TRUE \
- "
-
-do_install_append_class-native() {
- install -d ${D}${bindir}
- install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
deleted file mode 100644
index 6df10912..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SUMMARY = "Common clang is a thin wrapper library around clang"
-DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \
- to compile OpenCL C kernels to SPIR-V modules."
-
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
-
-SRC_URI = "git://github.com/intel/opencl-clang.git;branch=ocl-open-120;protocol=https \
- file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
- "
-
-SRCREV = "cea544b04460a47848e585bfe75cd774c0324b45"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-DEPENDS += " clang spirv-llvm-translator"
-DEPENDS_append_class-target = " opencl-clang-native"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-EXTRA_OECMAKE += "\
- -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
- -DCMAKE_SKIP_RPATH=TRUE \
- -DPREFERRED_LLVM_VERSION="12.0.0" \
- "
-
-do_install_append_class-native() {
- install -d ${D}${bindir}
- install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb
new file mode 100644
index 00000000..7e56af75
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb
@@ -0,0 +1,5 @@
+require opencl-clang.inc
+
+SRCREV = "980f1691c5babcf824ee10375a04a0d0c5d7d44a"
+
+BRANCH = "ocl-open-140"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb
new file mode 100644
index 00000000..e946c31c
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb
@@ -0,0 +1,5 @@
+require opencl-clang.inc
+
+SRCREV = "60fd799cc58755c16d951f9ebfde6d0f9b8554dd"
+
+BRANCH = "ocl-open-150"
diff --git a/dynamic-layers/clang-layer/recipes-opencl/vc-intrinsics/vc-intrinsics_1.0.bb b/dynamic-layers/clang-layer/recipes-opencl/vc-intrinsics/vc-intrinsics_1.0.bb
deleted file mode 100644
index eca1cb4d..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/vc-intrinsics/vc-intrinsics_1.0.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "VC Intrinsics"
-DESCRIPTION = "VC Intrinsics project contains a set of new intrinsics on \
-top of core LLVM IR instructions that represent SIMD semantics of a program \
-targeting GPU"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://License.md;md5=c18ea6bb4786a26bf4eee88a7424a408"
-
-SRC_URI = "git://github.com/intel/vc-intrinsics.git;protocol=https; \
- "
-SRCREV = "77974f5a32e19475125531483bede9ee23935257"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-DEPENDS += " clang"
-
-EXTRA_OECMAKE = "-DLLVM_DIR=${STAGING_LIBDIR}"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2021.2.bb b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.0.0.bb
index 9d8c1e18..70177c28 100644
--- a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2021.2.bb
+++ b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.0.0.bb
@@ -5,29 +5,29 @@ environment, performs static model analysis, and adjusts deep \
learning models for optimal execution on end-point target devices."
HOMEPAGE = "https://01.org/openvinotoolkit"
-SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=releases/2021/2;lfs=0 \
+SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=releases/2024/0;lfs=0 \
"
-SRCREV = "4795391b73381660b69b4cd3986c7a0bf902e868"
+SRCREV = "34caeefd07800b59065345d651949efbe8ab6649"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
CVE_PRODUCT = "intel:openvino"
-
S = "${WORKDIR}/git"
-do_install() {
- mkdir -p ${D}${datadir}/openvino/model-optimizer
- cp -r model-optimizer ${D}${datadir}/openvino/
-}
+inherit setuptools3
-RDEPENDS_${PN} += " \
- python3-numpy \
- python3-protobuf \
+SETUPTOOLS_SETUP_PATH = "${WORKDIR}/git/tools/mo"
+
+RDEPENDS:${PN} += " \
python3-defusedxml \
+ python3-fastjsonschema \
python3-networkx \
- python3-test-generator \
+ python3-numpy \
+ python3-protobuf \
+ python3-requests \
+ python3-urllib3 \
bash \
"
-FILES_${PN} += "${datadir}/openvino"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$"
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2102.1.0.0.bb b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb
index c4cf8052..bdf32576 100644
--- a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2102.1.0.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb
@@ -8,13 +8,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2ee41112a44fe7014dce33e26468ba93"
COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
+COMPATIBLE_HOST:libc-musl = "null"
-inherit cmake systemd features_check
+inherit cmake systemd features_check python3native
-DEPENDS = "metee ace xerces-c libnl libxml2 glib-2.0 glib-2.0-native"
-
-EXTRA_OECMAKE += "-DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3"
+DEPENDS = "metee ace xerces-c libnl libxml2 glib-2.0 glib-2.0-native pkgconfig-native python3-packaging-native"
# Enable either connman or networkmanager or none but not both.
PACKAGECONFIG ??= "connman"
@@ -23,19 +21,24 @@ PACKAGECONFIG[networkmanager] = "-DNETWORK_NM=ON, -DNETWORK_NM=OFF, networkmanag
REQUIRED_DISTRO_FEATURES= "systemd"
-FILES_${PN} += "${datadir}/dbus-1/system-services/*.service"
+FILES:${PN} += "${datadir}/dbus-1/system-services/*.service"
S = "${WORKDIR}/git"
-SYSTEMD_SERVICE_${PN} = "lms.service"
+SYSTEMD_SERVICE:${PN} = "lms.service"
-SRC_URI = "git://github.com/intel/lms.git \
+SRC_URI = "git://github.com/intel/lms.git;branch=master;protocol=https \
"
-SRCREV = "2d400ec587470fc960dceecc84c123a38415d137"
+SRCREV = "388f115b2aeb3ea11499971c65f828daefd32c47"
-do_install_append() {
+do_install:append() {
+ install -d ${D}${sysconfdir}/lms
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${B}/UNS/lms.service ${D}${systemd_system_unitdir}
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${S}/UNS/linux_scripts/70-mei-wdt.rules ${D}${sysconfdir}/udev/rules.d/70-mei-wdt.rules
}
-RDEPENDS_${PN} += "ace"
+RDEPENDS:${PN} += "ace"
+
+CVE_STATUS[CVE-2018-1000535] = "cpe-incorrect: This CVE is for a different LMS - Lan Management System."
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch
new file mode 100644
index 00000000..270cc84d
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch
@@ -0,0 +1,39 @@
+From c4c049481d48f33319b1d04cad56d622c4eed65f Mon Sep 17 00:00:00 2001
+From: Yogesh Tyagi <yogesh.tyagi@intel.com>
+Date: Mon, 11 Mar 2024 13:13:32 +0800
+Subject: [PATCH] Makefile: Fix build Issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In case build directory is different from source, make sure make is able to find the correct input files.
+
+Fixes:
+| dbus-binding-tool --prefix=thd_dbus_interface --mode=glib-server --output=thd_dbus_interface.h ../git/src/thd_dbus_interface.xml
+| glib-compile-resources --generate-source thermald-resource.gresource.xml
+| Failed to open file “thermald-resource.gresource.xml”: No such file or directory
+
+
+Upstream-Status: Submitted
+https://github.com/intel/thermal_daemon/pull/436
+
+Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a0c051a..772e280 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -95,6 +95,6 @@ thd_dbus_interface.h: $(top_srcdir)/src/thd_dbus_interface.xml
+ $(AM_V_GEN) dbus-binding-tool --prefix=thd_dbus_interface --mode=glib-server --output=$@ $<
+
+ thermald-resource.c: $(top_srcdir)/thermald-resource.gresource.xml
+- $(AM_V_GEN) glib-compile-resources --generate-source thermald-resource.gresource.xml
++ $(AM_V_GEN) glib-compile-resources --generate-source --sourcedir=${top_srcdir} $<
+
+ CLEANFILES = $(BUILT_SOURCES)
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.4.3.bb b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.6.bb
index add00e3b..df242cdf 100644
--- a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.4.3.bb
+++ b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.6.bb
@@ -7,20 +7,23 @@ compensation using available cooling methods."
HOMEPAGE = "https://github.com/01org/thermal_daemon"
DEPENDS = "dbus dbus-glib dbus-glib-native libxml2 glib-2.0 glib-2.0-native upower libevdev"
-LICENSE = "GPLv2"
+DEPENDS += "autoconf-archive-native"
+
+LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848"
-SRC_URI = "git://github.com/intel/thermal_daemon/ \
+SRC_URI = "git://github.com/intel/thermal_daemon/;branch=master;protocol=https \
+ file://0001-Makefile-Fix-build-Issue.patch \
"
-SRCREV = "9e731de1bd7bccd2c7c2e7923f01fbc4287ed80a"
+SRCREV = "3990ce2391e5c07293758c056e09e4f2453691b4"
S = "${WORKDIR}/git"
inherit pkgconfig autotools systemd gtk-doc
# gtkdocsize runs before autotools do_configure and it copies gtk-doc.m4 and fails
# to copy becuase there is no m4 dir yet.
-do_configure_prepend () {
+do_configure:prepend () {
mkdir -p ${S}/m4
}
@@ -28,13 +31,13 @@ EXTRA_OECONF = " \
--with-systemdsystemunitdir=${systemd_system_unitdir} \
"
-FILES_${PN} += "${datadir}/dbus-1/system-services/*.service"
+FILES:${PN} += "${datadir}/dbus-1"
-SYSTEMD_SERVICE_${PN} = "thermald.service"
+SYSTEMD_SERVICE:${PN} = "thermald.service"
COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
-CONFFILES_${PN} = " \
+CONFFILES:${PN} = " \
${sysconfdir}/thermald/thermal-conf.xml \
${sysconfdir}/thermald/thermal-cpu-cdev-order.xml \
"
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch
new file mode 100644
index 00000000..4d583657
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch
@@ -0,0 +1,53 @@
+From deccc0c69c2c8759c52885be8bdda54d3cee481c Mon Sep 17 00:00:00 2001
+From: Yogesh Tyagi <yogesh.tyagi@intel.com>
+Date: Sun, 11 Dec 2022 22:34:15 +0800
+Subject: [PATCH] Add print function to print test run status in ptest format
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
+---
+ run_tests.py | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/run_tests.py b/run_tests.py
+index 1cd796dd..e3ffd1ab 100755
+--- a/run_tests.py
++++ b/run_tests.py
+@@ -327,6 +327,9 @@ def run_test(testname, host, target):
+ else:
+ ispc_exe_rel = add_prefix(host.ispc_cmd, host, target)
+
++ # to reslove the error '.rodata' can not be used when making a PIE object
++ ispc_exe_rel = ispc_exe_rel + " --pic"
++
+ # is this a test to make sure an error is issued?
+ want_error = (filename.find("tests_errors") != -1)
+ if want_error == True:
+@@ -795,6 +798,17 @@ def check_compiler_exists(compiler_exe):
+ return
+ error("missing the required compiler: %s \n" % compiler_exe, 1)
+
++def print_test_run_status(results):
++ for fstatus in results:
++ if (fstatus[1] == Status.Success):
++ print( "%s: %s" % ("PASS", fstatus[0]))
++ elif (fstatus[1] == Status.Compfail):
++ print( "%s: %s" % ("FAIL", fstatus[0]))
++ elif (fstatus[1] == Status.Runfail):
++ print( "%s: %s" % ("FAIL", fstatus[0]))
++ elif (fstatus[1] == Status.Skip):
++ print( "%s: %s" % ("SKIP", fstatus[0]))
++
+ def print_result(status, results, s, run_tests_log, csv):
+ title = StatusStr[status]
+ file_list = [fname for fname, fstatus in results if status == fstatus]
+@@ -938,6 +952,8 @@ def run_tests(options1, args, print_version):
+ pass_rate = -1
+ print_debug("PASSRATE (%d/%d) = %d%% \n\n" % (len(run_succeed_files), total_tests_executed, pass_rate), s, run_tests_log)
+
++ print_test_run_status(results)
++
+ for status in Status:
+ print_result(status, results, s, run_tests_log, options.csv)
+ fails = [status != Status.Compfail and status != Status.Runfail for _, status in results]
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch
new file mode 100644
index 00000000..b0a76ff9
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch
@@ -0,0 +1,36 @@
+From 7beff95c11071170eb27b6fa7d0cc77588caee8e Mon Sep 17 00:00:00 2001
+From: Yogesh Tyagi <yogesh.tyagi@intel.com>
+Date: Tue, 26 Jul 2022 15:25:10 +0800
+Subject: [PATCH] Fix QA Issues
+
+Stop ispc from inserting host file path in generated headers which leads to reproducibility problems.
+
+Upstream-Status: Inappropriate [OE build specific]
+
+Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
+---
+ src/module.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/module.cpp b/src/module.cpp
+index e2084d2e..e2626865 100644
+--- a/src/module.cpp
++++ b/src/module.cpp
+@@ -2555,7 +2555,7 @@ bool Module::writeHeader(const char *fn) {
+ perror("fopen");
+ return false;
+ }
+- fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", fn);
++ fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n");
+ fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n");
+
+ // Create a nice guard string from the filename, turning any
+@@ -2677,7 +2677,7 @@ bool Module::writeDispatchHeader(DispatchHeaderInfo *DHI) {
+ FILE *f = DHI->file;
+
+ if (DHI->EmitFrontMatter) {
+- fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", DHI->fn);
++ fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n");
+ fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n");
+ }
+ // Create a nice guard string from the filename, turning any
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch
new file mode 100644
index 00000000..f452dc50
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch
@@ -0,0 +1,52 @@
+From 16a2c22339287122d2c25d8bb33a5a51b4e6ee51 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <naveen.kumar.saini@intel.com>
+Date: Thu, 24 Feb 2022 20:01:11 +0530
+Subject: [PATCH] cmake: don't build for 32-bit targets
+
+Error log:
+| tmp/work/corei7-64-poky-linux/ispc/1.16.0-r0/recipe-sysroot/usr/include/bits/long-double.h:23:10: fatal error: 'bits/long-double-32.h' file not found
+| #include <bits/long-double-32.h>
+| ^~~~~~~~~~~~~~~~~~~~~~~
+| 1 error generated.
+
+Remove SYSTEM include search path and set -isysroot dir path
+for root dir for cross compilation.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ cmake/GenerateBuiltins.cmake | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake
+index f84494ed..d90cb1ec 100644
+--- a/cmake/GenerateBuiltins.cmake
++++ b/cmake/GenerateBuiltins.cmake
+@@ -253,7 +253,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi
+ # In this case headers will be installed in /usr/arm-linux-gnueabihf/include and will not be picked up
+ # by clang by default. So the following line adds such path explicitly. If this path doesn't exist and
+ # the headers can be found in other locations, this should not be a problem.
+- set(includePath -isystem/usr/${debian_triple}/include)
++ set(includePath -isysroot${SYSROOT_DIR})
+ endif()
+ endif()
+
+@@ -339,7 +339,7 @@ function (generate_target_builtins resultList)
+ set(regular_targets ${ARGN})
+ list(FILTER regular_targets EXCLUDE REGEX wasm)
+ foreach (ispc_target ${regular_targets})
+- foreach (bit 32 64)
++ foreach (bit 64)
+ foreach (os_name ${TARGET_OS_LIST_FOR_LL})
+ target_ll_to_cpp(target-${ispc_target} ${bit} ${os_name} output${os_name}${bit})
+ list(APPEND tmpList ${output${os_name}${bit}})
+@@ -405,7 +405,7 @@ function (generate_common_builtins resultList)
+ endif()
+
+ message (STATUS "ISPC will be built with support of ${supported_oses} for ${supported_archs}")
+- foreach (bit 32 64)
++ foreach (bit 64)
+ foreach (os_name "windows" "linux" "freebsd" "macos" "android" "ios" "ps4" "web")
+ foreach (arch "x86" "arm" "wasm")
+ builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch})
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest
new file mode 100644
index 00000000..77d13bb4
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+python3 run_tests.py
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb
new file mode 100644
index 00000000..ed8df859
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Intel(R) Implicit SPMD Program Compiler"
+DESCRIPTION = "ispc is a compiler for a variant of the C programming language, \
+with extensions for single program, multiple data programming."
+HOMEPAGE = "https://github.com/ispc/ispc"
+
+LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \
+ file://third-party-programs.txt;md5=2061218c7be521556719c8b504bf9ddd"
+
+inherit cmake python3native ptest
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \
+ file://0002-cmake-don-t-build-for-32-bit-targets.patch \
+ file://0001-Fix-QA-Issues.patch \
+ file://0001-Add-print-function-to-print-test-run-status-in-ptest.patch \
+ file://run-ptest \
+ "
+
+SRCREV = "bcb2cf896c00f9a802a11cbf291ef6e44b205416"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+
+DEPENDS += " clang-native bison-native flex-native"
+DEPENDS:append:class-target = " clang"
+RDEPENDS:${PN}-ptest += " python3-multiprocessing"
+
+PACKAGECONFIG ??= "tbb"
+PACKAGECONFIG[tbb] = "-DISPCRT_BUILD_TASK_MODEL=TBB, -DISPCRT_BUILD_TASK_MODEL=OpenMP, tbb"
+
+YFLAGS='-d -t -v -y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}'
+
+do_configure:prepend() {
+ sed -i -e 's#\${BISON_EXECUTABLE}.*#\${BISON_EXECUTABLE} ${YFLAGS} #g' ${S}/CMakeLists.txt
+ sed -i -e 's#\${FLEX_EXECUTABLE}.*#\${FLEX_EXECUTABLE} \-L #g' ${S}/CMakeLists.txt
+}
+
+do_install_ptest() {
+ cp -rf ${S}/run_tests.py ${D}${PTEST_PATH}
+ cp -rf ${S}/common.py ${D}${PTEST_PATH}
+ cp -rf ${S}/tests ${D}${PTEST_PATH}
+ cp -rf ${S}/test_static.isph ${D}${PTEST_PATH}
+ cp -rf ${S}/fail_db.txt ${D}${PTEST_PATH}
+ cp -rf ${S}/test_static.cpp ${D}${PTEST_PATH}
+}
+
+EXTRA_OECMAKE += " \
+ -DISPC_INCLUDE_TESTS=OFF \
+ -DISPC_INCLUDE_EXAMPLES=OFF \
+ -DARM_ENABLED=OFF \
+ -DISPC_CROSS=ON \
+ -DISPC_ANDROID_TARGET=OFF \
+ -DISPC_FREEBSD_TARGET=OFF \
+ -DISPC_WINDOWS_TARGET=OFF \
+ -DISPC_IOS_TARGET=OFF \
+ -DISPC_PS_TARGET=OFF \
+ -DSYSROOT_DIR=${STAGING_DIR} \
+ -DCLANG_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang \
+ -DCLANGPP_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang++ \
+ -DLLVM_AS_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-as \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.2.3.bb b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb
index 9ab0804f..8bade9f4 100644
--- a/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.2.3.bb
+++ b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb
@@ -1,10 +1,10 @@
SUMMARY = "oneAPI Level Zero Specification Headers and Loader"
HOMEPAGE = "https://github.com/oneapi-src/level-zero"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8956dfdba7f8169c4005d1e9753ffddc"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=97957beb2f7808ffa247e5d93e6442cc"
-SRC_URI = "git://github.com/oneapi-src/level-zero.git;protocol=https"
-SRCREV = "0d30b1fa712253c68bfdfa3863d380df4301b8a4"
+SRC_URI = "git://github.com/oneapi-src/level-zero.git;protocol=https;branch=master"
+SRCREV = "1685d01497428ca4d8b99200972b64685424d5c9"
S = "${WORKDIR}/git"
inherit cmake
@@ -14,7 +14,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$"
PACKAGES =+ "${PN}-headers ${PN}-samples ${PN}-loader"
-do_install_append () {
+do_install:append () {
install -d ${D}${bindir} ${D}${libdir}
install -m 755 ${B}/bin/zello* ${D}${bindir}
@@ -22,10 +22,12 @@ do_install_append () {
}
-FILES_${PN}-headers = "${includedir}"
-FILES_${PN}-samples = "${bindir} ${libdir}/libze_null* ${libdir}/libze_validation*"
-FILES_${PN}-loader = "${libdir}"
+FILES:${PN}-headers = "${includedir}"
+FILES:${PN}-samples = "${bindir} ${libdir}/libze_null* ${libdir}/libze_validation*"
+FILES:${PN}-loader = "${libdir}"
# PN-loader (non -dev/-dbg/nativesdk- package) contains symlink .so
-INSANE_SKIP_${PN}-loader = "dev-so"
-INSANE_SKIP_${PN}-samples = "dev-so"
+INSANE_SKIP:${PN}-loader = "dev-so"
+INSANE_SKIP:${PN}-samples = "dev-so"
+ALLOW_EMPTY:${PN} = "1"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb
new file mode 100644
index 00000000..cedbae1e
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Intel® oneAPI DPC++/C++ Compiler runtime files"
+DESCRIPTION = "The Intel® oneAPI DPC++/C++ Compiler provides optimizations \
+that help your applications run faster on Intel® 64 architectures with support \
+for the latest C, C++, and SYCL language standards. This compiler produces \
+optimized code that can run significantly faster by taking advantage of the \
+ever-increasing core count and vector register width in Intel® Xeon® processors \
+and compatible processors."
+
+HOMEPAGE = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html"
+
+LICENSE="EULA"
+
+COMPILERMAINVER = "2024.0"
+
+LIC_FILES_CHKSUM = " \
+ file://opt/intel/oneapi/licensing/${COMPILERMAINVER}/licensing/${COMPILERMAINVER}/license.htm;md5=5ff64c6ff3ef98089ed69360e7a84c39 \
+ "
+COMPILERDOTVER = "2024.0.0-49406"
+DEVUTILITVERSION = "2024.0-2024.0.0-49320"
+SRC_URI = " \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-dpcpp-cpp-runtime-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=dpcpp-runtime \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-dpcpp-cpp-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=dpcpp-common \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-runtime-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=compiler-shared-runtime \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-common-vars-${COMPILERDOTVER}_all.deb;subdir=${BPN};name=common-vars \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-openmp-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=openmp \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-openmp-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=openmp-common \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-common-licensing-${COMPILERMAINVER}-${COMPILERDOTVER}_all.deb;subdir=${BPN};name=license \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-dev-utilities-${DEVUTILITVERSION}_amd64.deb;subdir=${BPN};name=dev-utils \
+ "
+
+SRC_URI[dpcpp-runtime.sha256sum] = "e24f0ba69daf3f66ceaf23d5e632f183cdb90bac69f65407fdb4407fc9034f33"
+SRC_URI[dpcpp-common.sha256sum] = "f5a3db6a725598224edf1099260955aee3e36beadcaed2af5b8b453e873a82fa"
+SRC_URI[compiler-shared-runtime.sha256sum] = "bce010cbe076259ddd3feb8e69792869e22fccd5b4e2c9af9e815826f2c1a394"
+SRC_URI[common-vars.sha256sum] = "368553c99db1b52060b8225355336778be0b00e5991d0f769c42f891c6328750"
+SRC_URI[openmp.sha256sum] = "154ff1e81adfdc872ba1d47bd860de70d62188417c7128422435dfd0ceca62fe"
+SRC_URI[openmp-common.sha256sum] = "8217001d78311cbef97dd139e684c6767932b532309c3843ba57d7894d15c07d"
+SRC_URI[license.sha256sum] = "9f9c8a12fc0bc82ab5b71e118e66745eff23f42224eba304068225b366cd74b6"
+SRC_URI[dev-utils.sha256sum] = "c675d960a5abca361cead9217d6e74adee499ee0a095c4e44092bd710b304d50"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit bin_package
+
+RDEPENDS:${PN} += "virtual-opencl-icd zlib tbb level-zero-loader bash tcsh"
+SKIP_FILEDEPS:${PN} = '1'
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# doesn't have GNU_HASH (didn't pass LDFLAGS?)
+INSANE_SKIP:${PN} += "textrel dev-so dev-elf ldflags already-stripped staticdev rpaths arch useless-rpaths file-rdeps"
+
+FILES_SOLIBSDEV = ""
+BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb
new file mode 100644
index 00000000..90ada087
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Intel® oneAPI DPC++/C++ Compiler"
+DESCRIPTION = "The Intel® oneAPI DPC++/C++ Compiler provides optimizations \
+that help your applications run faster on Intel® 64 architectures with support \
+for the latest C, C++, and SYCL language standards. This compiler produces \
+optimized code that can run significantly faster by taking advantage of the \
+ever-increasing core count and vector register width in Intel® Xeon® processors \
+and compatible processors."
+
+HOMEPAGE = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html"
+
+LICENSE="EULA"
+
+COMPILERMAINVER = "2024.0"
+
+LIC_FILES_CHKSUM = " \
+ file://opt/intel/oneapi/compiler/${COMPILERMAINVER}/share/doc/compiler/credist.txt;md5=b41f55af9f479b9570fc35b955d5ba1a \
+ "
+
+SRC_URI = " \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-dpcpp-cpp-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=icx-compiler \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=compiler-linker \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=shared-common \
+ "
+
+SRC_URI[icx-compiler.sha256sum] = "0dcbac766d5a1519d4cf393f5a85e71d19024fef65f77638f3f849796b62cd82"
+SRC_URI[compiler-linker.sha256sum] = "e00faea6d797934d62143e4aa70b727ce30f80fdf30769d22122b3051140c236"
+SRC_URI[shared-common.sha256sum] = "cf490a4a790f349da79e618359598d3b32312ca3b2639e5d4c84e1cfa2745558"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit bin_package
+
+RDEPENDS:${PN} += "intel-oneapi-dpcpp-cpp-runtime"
+SKIP_FILEDEPS:${PN} = '1'
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# doesn't have GNU_HASH (didn't pass LDFLAGS?)
+INSANE_SKIP:${PN} += "textrel dev-so dev-elf ldflags already-stripped file-rdeps staticdev rpaths arch useless-rpaths"
+
+FILES_SOLIBSDEV = ""
+
+EXCLUDE_FROM_SHLIBS = "1"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb
new file mode 100644
index 00000000..fb341b01
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Collection of high-performance ray tracing kernels"
+DESCRIPTION = "A collection of high-performance ray tracing kernels \
+intended to graphics application engineers that want to improve the \
+performance of their application."
+HOMEPAGE = "https://github.com/embree/embree"
+
+LICENSE = "Apache-2.0 & syrah"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+ file://third-party-programs.txt;md5=f989f5b74cfff0d45d3ccf0e1366cbdc \
+ file://common/math/transcendental.h;beginline=6;endline=8;md5=73380bb2ab6613b30b8464f114bd0ca8"
+
+inherit pkgconfig cmake
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/embree/embree.git;protocol=https;branch=master"
+SRCREV = "daa8de0e714e18ad5e5c9841b67c1950d9c91c51"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+DEPENDS = "tbb jpeg libpng glfw ispc-native"
+
+EXTRA_OECMAKE += " \
+ -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF \
+ -DEMBREE_MAX_ISA=DEFAULT \
+ -DEMBREE_TUTORIALS=OFF \
+ -DEMBREE_ISPC_SUPPORT=ON \
+ -DEMBREE_ZIP_MODE=OFF \
+ "
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb
new file mode 100644
index 00000000..1841253e
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "Intel® Integrated Performance Primitives are production-ready \
+ building blocks for cross-platform performance. Develop high-performance vision, \
+ signal, security, and storage applications with this multithreaded software library."
+HOMEPAGE = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/ipp.html"
+
+LICENSE = "ISSL"
+
+MAXVER = "2021.10"
+
+LIC_FILES_CHKSUM = " \
+ file://opt/intel/oneapi/ipp/${MAXVER}/share/doc/ipp/licensing/license.txt;md5=d7cdc92ed6c4de1263da879599ddc3e2 \
+ file://opt/intel/oneapi/ipp/${MAXVER}/share/doc/ipp/licensing/third-party-programs.txt;md5=22bd13987911dcf790907041b43081f3 \
+ "
+SRC_URI = " \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-${MAXVER}-${PV}_amd64.deb;subdir=${BPN};name=ipp \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-common-devel-${MAXVER}-${PV}_all.deb;subdir=${BPN};name=headers \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-common-${MAXVER}-${PV}_all.deb;subdir=${BPN};name=env \
+ "
+
+SRC_URI[ipp.sha256sum] = "b51e45c6e691aa46c7136b0ab61f5abe346388433e017a30cf53fd23e92bea07"
+SRC_URI[headers.sha256sum] = "342f37ab2f82bc9f4498435f848ee660591c2488b44d988bf6ee96b2a71fd005"
+SRC_URI[env.sha256sum] = "731e8c28a3b8b757730cd874d0941de2eb744856128f24ade59d36c12b415bf6"
+
+S = "${WORKDIR}/${BPN}"
+
+COMPATIBLE_HOST:libc-musl = "null"
+
+inherit bin_package
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_DEFAULT_DEPS = ""
+
+RDEPENDS:${PN} += "tbb setup-intel-oneapi-env"
+INSANE_SKIP:${PN} += "ldflags dev-so"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb
new file mode 100644
index 00000000..e3e93028
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb
@@ -0,0 +1,74 @@
+SUMMARY = "Intel® oneAPI Math Kernel Library (oneMKL)"
+DESCRIPTION = "The Intel® oneAPI Math Kernel Library (oneMKL) is a computing \
+ math library of highly optimized and extensively parallelized routines \
+ for applications that require maximum performance. oneMKL contains \
+ the high-performance optimizations from the full Intel® Math Kernel Library \
+ for CPU architectures (with C/Fortran programming language interfaces)\
+ and adds to them a set of DPC++ programming language interfaces for \
+ achieving performance on various CPU architectures \
+ and Intel Graphics Technology for certain key functionalities."
+HOMEPAGE = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html"
+
+LICENSE = "ISSL"
+
+MKLMAINVER = "2024.0"
+
+LIC_FILES_CHKSUM = " \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/license.txt;md5=8510d21bf355a76e378c3216c3929ccd \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-benchmarks.txt;md5=cb98e1a1f14c05ea85a979ea8982e7a4 \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-ipp.txt;md5=a4b2bf15e38f5c1267cdafed18bc0b09 \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-openmp.txt;md5=6b3c1aa2a11393060074c0346ce21e49 \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-safestring.txt;md5=c3aeee91c6d35a0f0753aed6c2633b82 \
+ file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs.txt;md5=27de873e4084d62530fe828406b33ca9 \
+ "
+
+SRC_URI = " \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-${MKLMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=runtime \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-devel-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-devel \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-devel-${MKLMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=devel \
+ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-vars \
+ "
+
+SRC_URI[runtime.sha256sum] = "10a86e24051d6ef4a80fd839c570e629190638a3c0ac9bcca99ab855f534b959"
+SRC_URI[common-devel.sha256sum] = "adbf0ea946f63946d29b7f9c750c38a42ea7a65d8c81655b268aa2c7bb908192"
+SRC_URI[devel.sha256sum] = "fab2a6f15e18bfd9b4d425f2703e4e98928c57f52c4feebc9ed886f097062e84"
+SRC_URI[common-vars.sha256sum] = "ec2b67813739fa4a2895f63479a41acba2174afe2d0cb8a0c1c9119d1317d8ef"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit bin_package
+
+do_install:append () {
+ install -d ${D}${bindir}
+ (cd ${D}${bindir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/bin/* .)
+ install -d ${D}${libdir}
+ (cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.so* .)
+ (cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.a* .)
+ install -d ${D}${libdir}/pkgconfig
+ (cd ${D}${libdir}/pkgconfig ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/pkgconfig/* .)
+ install -d ${D}${libdir}/cmake
+ (cd ${D}${libdir}/cmake ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/cmake/* .)
+
+ install -d ${D}${includedir}
+ find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read srcdir; do
+ install -d ${D}${includedir}/$srcdir
+ (cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcdir/* ./$srcdir/)
+ done
+
+ find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type f -printf '%f\n' | while read srcfile; do
+ (cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcfile .)
+ done
+}
+
+AUTO_LIBNAME_PKGS = ""
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+RDEPENDS:${PN} += "bash tbb intel-oneapi-dpcpp-cpp-runtime setup-intel-oneapi-env virtual-opencl-icd"
+INSANE_SKIP:${PN} = "ldflags textrel dev-so staticdev arch already-stripped"
+
+FILES:${PN}-staticdev += "/opt/intel/oneapi/mkl/${MKLMAINVER}/lib/*.a*"
+
+SKIP_FILEDEPS:${PN} = '1'
+
+SYSROOT_DIRS += "/opt"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb
new file mode 100644
index 00000000..4ea6ffbe
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Intel® Open Image Denoise"
+DESCRIPTION = "Intel Open Image Denoise is an open source library of \
+high-performance, high-quality denoising filters for images \
+rendered with ray tracing. Intel Open Image Denoise is part \
+of the Intel® oneAPI Rendering Toolkit"
+HOMEPAGE = "https://www.openimagedenoise.org/"
+
+LICENSE = "Apache-2.0 & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+ file://external/mkl-dnn/LICENSE;md5=b48e3de3bfd47c27882a0d85b20823f5 \
+ file://external/mkl-dnn/src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \
+ file://external/mkl-dnn/src/common/ittnotify/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \
+ file://weights/LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI = "https://github.com/OpenImageDenoise/${BPN}/releases/download/v${PV}/${BP}.src.tar.gz\
+ "
+SRC_URI[sha256sum] = "ce144ba582ff36563d9442ee07fa2a4d249bc85aa93e5b25fc527ff4ee755ed6"
+
+inherit cmake
+
+DEPENDS += "tbb ispc-native"
+
+UPSTREAM_CHECK_URI = "https://github.com/OpenImageDenoise/oidn/releases"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb
new file mode 100644
index 00000000..a2d709a1
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Intel(R) Open Volume Kernel Library"
+DESCRIPTION = "Intel(R) Open Volume Kernel Library (Intel(R) Open VKL) is a \
+collection of high-performance volume computation kernels. The target users \
+of Open VKL are graphics application engineers who want to improve the \
+performance of their volume rendering applications by leveraging Open VKL’s \
+performance-optimized kernels, which include volume traversal and sampling \
+functionality for a variety of volumetric data formats. The kernels are optimized \
+for the latest Intel(R) processors with support for SSE, AVX, AVX2, and AVX-512 \
+instructions."
+HOMEPAGE = "https://www.openvkl.org/"
+
+LICENSE = "Apache-2.0 & BSD-3-Clause & MIT & Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+ file://third-party-programs.txt;md5=69ec7caf49616c471161b921f53d5ec0 \
+ file://testing/external/half.hpp;beginline=1;endline=17;md5=4b60058493630c3bd0ef145470f04a7b"
+
+inherit pkgconfig cmake
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/openvkl/openvkl.git;protocol=https;branch=master \
+ "
+SRCREV = "8c6ba526813b871a624cb9d73d4cbb689ac7f4ce"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+DEPENDS = "ispc ispc-native rkcommon embree"
+
+EXTRA_OECMAKE += " \
+ -DISPC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/ispc \
+ "
+EXTRA_OECMAKE:intel-corei7-64 += " \
+ -DOPENVKL_ISA_AVX=OFF \
+ -DOPENVKL_ISA_AVX2=OFF \
+ -DOPENVKL_ISA_AVX512SKX=OFF \
+ "
+
+PACKAGES =+ "${PN}-examples"
+FILES:${PN}-examples = "\
+ ${bindir} \
+ "
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch
new file mode 100644
index 00000000..c2136321
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch
@@ -0,0 +1,28 @@
+From 09e6b6615d9a16e9555eff9d569356e32bd26aa4 Mon Sep 17 00:00:00 2001
+From: benradel <86351445+benradel@users.noreply.github.com>
+Date: Wed, 23 Jun 2021 11:56:03 +0200
+Subject: [PATCH] Fix GCC11 Compile Error in benchmark_register.h
+
+Fix GCC11 compilation error due to missing header "limits" in benchmark_register.h
+
+Upstream-Status: Submitted [https://github.com/ospray/ospray/pull/484/files]
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ apps/common/external/benchmark/src/benchmark_register.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/apps/common/external/benchmark/src/benchmark_register.h b/apps/common/external/benchmark/src/benchmark_register.h
+index 61377d742..8f1bb7795 100644
+--- a/apps/common/external/benchmark/src/benchmark_register.h
++++ b/apps/common/external/benchmark/src/benchmark_register.h
+@@ -2,6 +2,7 @@
+ #define BENCHMARK_REGISTER_H
+
+ #include <vector>
++#include <limits>
+
+ #include "check.h"
+
+--
+2.32.0
+
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb
new file mode 100644
index 00000000..3e03dcc2
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Intel OSPray, Ray Tracing based Rendering Engine"
+DESCRIPTION = "Intel OSPRay is an open source, scalable, and portable ray \
+tracing engine for high-performance, high-fidelity visualization on \
+Intel Architecture CPUs."
+HOMEPAGE = "https://www.ospray.org/"
+
+LICENSE = "Apache-2.0 & BSD-3-Clause & MIT & Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=1dece7821bf3fd70fe1309eaa37d52a2 \
+ file://third-party-programs.txt;md5=e37b77e3bd997abccc359c710fb1f1db \
+ "
+
+inherit pkgconfig cmake
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/ospray/ospray.git;protocol=https;branch=master \
+ "
+SRCREV = "f2a61c2eb58ccd666e34abfdb0fd7049ea073194"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+DEPENDS = "rkcommon ispc ispc-native openvkl embree"
+
+EXTRA_OECMAKE += " \
+ -DISPC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/ispc \
+ -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF \
+ -DOSPRAY_ENABLE_APPS_TESTING=OFF \
+ -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF \
+ "
+
+PACKAGES =+ "${PN}-apps"
+FILES:${PN}-apps = "\
+ ${bindir} \
+ "
+
+UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb
new file mode 100644
index 00000000..fe6b23ea
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "rkcommon - C++/CMake infrastructure"
+DESCRIPTION = "A common set of C++ infrastructure and CMake utilities \
+used by various components of Intel® oneAPI Rendering Toolkit."
+HOMEPAGE = "https://github.com/ospray/rkcommon"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+inherit pkgconfig cmake
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/ospray/rkcommon.git;protocol=https;branch=master \
+ "
+SRCREV = "7ebfa0765ea590767202b328e7da38102c2f5a15"
+
+DEPENDS = "tbb"
+
+EXTRA_OECMAKE += " -DBUILD_TESTING=OFF"
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch
new file mode 100644
index 00000000..4474aa3c
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch
@@ -0,0 +1,38 @@
+From ef56be8e6bf2ea273cbeb960f3131164e7b517b6 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 18 May 2022 12:24:03 +0800
+Subject: [PATCH] CMakeLists: disable Werror
+
+gcc12 highlights minor warnings that cause the build to fail. Ignore
+those until they aren't fixed upstream.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 418483f7..c019fea0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -146,7 +146,7 @@ else()
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-strict-aliasing -D_FORTIFY_SOURCE=2")
+ if(LNX_BUILD)
+ #A few warnings yet to resolve under esx
+- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror")
++ #set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Werror")
+ endif()
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ggdb")
+@@ -791,4 +791,4 @@ if(ESX_BUILD)
+ include(CMake/esx.cmake)
+ endif()
+
+-add_subdirectory(src/os/nvm_api_sample)
+\ No newline at end of file
++add_subdirectory(src/os/nvm_api_sample)
+--
+2.35.3
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERT-and-NULL-definition-so-we-can-c.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch
index 4a3b26c7..11305e83 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERT-and-NULL-definition-so-we-can-c.patch
+++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch
@@ -1,56 +1,50 @@
-From cc0e412ad05574d22938586172c56863666eb2a5 Mon Sep 17 00:00:00 2001
-From: Nolan Hergert <nolan.hergert@intel.com>
-Date: Mon, 5 Apr 2021 11:15:09 +0800
-Subject: [PATCH] Ignore STATIC_ASSERT and NULL definition so we can compile in
- OS
-
-Upstream-Status: Backport [from ipmctl patches; https://github.com/intel/ipmctl/blob/development/src/os/patches/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch]
-
-Signed-off-by: Nolan Hergert <nolan.hergert@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+Subject: [PATCH] [PATCH]: ignore static asserts and null define for os and ut
+ builds
+Upstream-Status: Backport
+Signed-off-by: Teoh Suh Haw <suh.haw.teoh@intel.com>
---
- MdePkg/Include/Base.h | 13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
+ MdePkg/Include/Base.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
-index 8e4271f6ea..c39511a064 100644
+index d209e6de28..6e61b8f3d3 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
-@@ -318,7 +318,11 @@ struct _LIST_ENTRY {
- ///
- /// NULL pointer (VOID *)
- ///
+@@ -316,8 +316,12 @@ struct _LIST_ENTRY {
+ #define NULL __null
+ #endif
+ #else
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
#define NULL ((VOID *) 0)
+ #endif
+#endif
+#endif
-
+
//
// Null character
-@@ -809,7 +813,8 @@ typedef UINTN *BASE_LIST;
- // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
+@@ -779,6 +783,8 @@ typedef UINTN *BASE_LIST;
// Section 2.3.1 of the UEFI 2.3 Specification.
//
--
+
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
STATIC_ASSERT (sizeof (BOOLEAN) == 1, "sizeof (BOOLEAN) does not meet UEFI Specification Data Type requirements");
STATIC_ASSERT (sizeof (INT8) == 1, "sizeof (INT8) does not meet UEFI Specification Data Type requirements");
STATIC_ASSERT (sizeof (UINT8) == 1, "sizeof (UINT8) does not meet UEFI Specification Data Type requirements");
-@@ -821,6 +826,8 @@ STATIC_ASSERT (sizeof (INT64) == 8, "sizeof (INT64) does not meet UEFI Specifi
- STATIC_ASSERT (sizeof (UINT64) == 8, "sizeof (UINT64) does not meet UEFI Specification Data Type requirements");
- STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements");
+@@ -792,6 +798,8 @@ STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specifi
STATIC_ASSERT (sizeof (CHAR16) == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements");
+ STATIC_ASSERT (sizeof (L'A') == 2, "sizeof (L'A') does not meet UEFI Specification Data Type requirements");
+ STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specification Data Type requirements");
+#endif
+#endif
-
+
//
// The following three enum types are used to verify that the compiler
-@@ -841,9 +848,13 @@ typedef enum {
+@@ -812,9 +820,13 @@ typedef enum {
__VerifyUint32EnumValue = 0xffffffff
} __VERIFY_UINT32_ENUM_SIZE;
-
+
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
@@ -58,9 +52,8 @@ index 8e4271f6ea..c39511a064 100644
STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
+#endif
+#endif
-
+
/**
Macro that returns a pointer to the data structure that contains a specified field of
---
-2.17.1
-
+--
+2.37.3
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0302.bb b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb
index 688ad108..c4743d1c 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0302.bb
+++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb
@@ -13,27 +13,35 @@ BUGTRACKER = "https://github.com/intel/ipmctl/issues"
LICENSE = "BSD-3-Clause | BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=72b9da60da6219d612ce30b746a0fe71 \
- file://../edk2/License.txt;md5=2b415520383f7964e96700ae12b4570a"
+ file://edk2/License.txt;md5=6123e5bf044a66db96c4ce88a36b2d08"
-SRC_URI = "git://github.com/intel/ipmctl.git;protocol=https;branch=development;name=ipmctl; \
- git://github.com/tianocore/edk2.git;protocol=https;name=edk2;destsuffix=edk2; \
- file://0001-Ignore-STATIC_ASSERT-and-NULL-definition-so-we-can-c.patch;patchdir=../edk2 \
+SRC_URI = "git://github.com/intel/ipmctl.git;protocol=https;branch=master;name=ipmctl; \
+ git://github.com/tianocore/edk2.git;protocol=https;name=edk2;destsuffix=git/edk2;branch=master \
+ file://0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch;patchdir=edk2 \
+ file://0001-CMakeLists-disable-Werror.patch \
"
-SRCREV_ipmctl = "4579c7ec127d6c678ce25136f928b66c7ba51097"
-#tag: edk2-stable202102
-SRCREV_edk2 = "ef91b07388e1c0a50c604e5350eeda98428ccea6"
+SRCREV_ipmctl = "c75bd840ea7820c8f93a5488fcff75d08beedd51"
+#tag edk2-stable202302
+SRCREV_edk2 = "f80f052277c88a67c55e107b550f504eeea947d3"
+SRCREV_FORMAT = "ipmctl_edk2"
S = "${WORKDIR}/git"
-inherit cmake
+inherit cmake dos2unix
-DEPENDS = "ndctl"
+DEPENDS = "ndctl pkgconfig-native"
EXTRA_OECMAKE = "-DRELEASE=ON"
-do_configure_prepend() {
+do_configure:prepend() {
for dir in BaseTools MdeModulePkg MdePkg ShellPkg ; do
- ln -sf ../edk2/${dir} ${S}
+ ln -sf edk2/${dir} ${S}
done
}
+
+do_install:append() {
+ # Remove /var/log/ipmctl as anything created in /var/log will not be
+ # available when tmpfs is mounted at /var/volatile/log.
+ rm -rf ${D}${localstatedir}/log
+}
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-CPU-Solving-the-build-failure-caused-by-setting-the-.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-CPU-Solving-the-build-failure-caused-by-setting-the-.patch
new file mode 100644
index 00000000..d1851406
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-CPU-Solving-the-build-failure-caused-by-setting-the-.patch
@@ -0,0 +1,43 @@
+From b8c3bae71e6d3417ade5cb537cb1785fd75a75c8 Mon Sep 17 00:00:00 2001
+From: Razvan Apetroaie <117895604+razvanapetroaie@users.noreply.github.com>
+Date: Tue, 20 Feb 2024 02:28:14 +0200
+Subject: [PATCH] [CPU] Solving the build failure caused by setting the
+ "ENABLE_OV_ONNX_FRONTEND" option to "OFF" (#22934)
+
+### Details:
+See the [ticket
+description](https://jira.devtools.intel.com/browse/CVS-132119). The
+solution was checked only on a local setup on Ubuntu, if there's a way
+to check that using the CI please let me know (or if you could run the
+job and paste the link in the comments I would be grateful).
+
+Disclaimer: I'm not a CPU plugin developer, so I can't tell for sure if
+this is the ideal fix and no side effects are introduced. Please take
+that into account when reviewing/merging.
+
+### Tickets:
+ - [CVS-132119](https://jira.devtools.intel.com/browse/CVS-132119)
+
+Upstream-Status: Backport [https://github.com/openvinotoolkit/openvino/commit/b8c3bae71e6d3417ade5cb537cb1785fd75a75c8]
+
+Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
+---
+ src/plugins/intel_cpu/tests/functional/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/intel_cpu/tests/functional/CMakeLists.txt b/src/plugins/intel_cpu/tests/functional/CMakeLists.txt
+index db5ae8d01c..6941cb528d 100644
+--- a/src/plugins/intel_cpu/tests/functional/CMakeLists.txt
++++ b/src/plugins/intel_cpu/tests/functional/CMakeLists.txt
+@@ -16,7 +16,7 @@ set(LINK_LIBRARIES funcSharedTests cpuSpecificRtInfo openvino::snippets ov_snipp
+ if(ENABLE_OV_ONNX_FRONTEND)
+ list(APPEND DEFINES TEST_MODELS="${TEST_MODEL_ZOO}")
+ else()
+- set(EXCLUDED_SOURCE_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/extension ${CMAKE_CURRENT_SOURCE_DIR}/shared_tests_instances/onnx)
++ set(EXCLUDED_SOURCE_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/custom/extension ${CMAKE_CURRENT_SOURCE_DIR}/shared_tests_instances/onnx)
+ endif()
+
+ if(NOT (ARM OR AARCH64))
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-fix-build-when-using-sysroot.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-fix-build-when-using-sysroot.patch
new file mode 100644
index 00000000..d251f21b
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-fix-build-when-using-sysroot.patch
@@ -0,0 +1,32 @@
+From b5dfcf8bc1245e804c847745c237068eb6f19931 Mon Sep 17 00:00:00 2001
+From: Yogesh Tyagi <yogesh.tyagi@intel.com>
+Date: Fri, 15 Mar 2024 16:28:41 +0800
+Subject: [PATCH] cmake: fix build when using sysroot
+
+When cross-compiling against a sysroot, system headers will not be at a place
+that starts with /usr. Update conditional check to exclude directories
+which have "/usr/include" in them to not add <sysroot>/usr/include as well.
+
+Upstream-Status: Submitted [https://github.com/openvinotoolkit/openvino/pull/23486]
+
+Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
+---
+ src/cmake/ov_parallel.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cmake/ov_parallel.cmake b/src/cmake/ov_parallel.cmake
+index 3793db98e30..819d3410531 100644
+--- a/src/cmake/ov_parallel.cmake
++++ b/src/cmake/ov_parallel.cmake
+@@ -296,7 +296,7 @@ function(ov_set_threading_interface_for TARGET_NAME)
+ if(include_directories)
+ foreach(include_directory IN LISTS include_directories)
+ # cannot include /usr/include headers as SYSTEM
+- if(NOT "${include_directory}" MATCHES "^/usr.*$")
++ if(NOT "${include_directory}" MATCHES ".*/usr/include.*$")
+ target_include_directories(${TARGET_NAME} SYSTEM
+ ${LINK_TYPE} $<BUILD_INTERFACE:${include_directory}>)
+ else()
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch
new file mode 100644
index 00000000..7ab31309
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch
@@ -0,0 +1,90 @@
+From bfcf5ae581ca4e7266cf7dc65b1c71754cd78cc0 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 29 Nov 2023 12:42:57 +0530
+Subject: [PATCH 1/4] cmake: yocto specific tweaks to the build process
+
+* Dont try to detect glibc version as that doesn't work when cross compiling.
+* Install sample binaries as well.
+* Dont strip binaries.
+* Dont try to write triggers for CPack. We package ourselves.
+* Fix the installation path for Python modules when baselib = lib64.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ cmake/developer_package/packaging/rpm/rpm.cmake | 2 +-
+ cmake/developer_package/target_flags.cmake | 2 +-
+ samples/cpp/CMakeLists.txt | 6 +++---
+ src/bindings/python/CMakeLists.txt | 2 +-
+ src/bindings/python/wheel/setup.py | 1 -
+ 5 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/cmake/developer_package/packaging/rpm/rpm.cmake b/cmake/developer_package/packaging/rpm/rpm.cmake
+index a7c0ec2cf61..40448e8a962 100644
+--- a/cmake/developer_package/packaging/rpm/rpm.cmake
++++ b/cmake/developer_package/packaging/rpm/rpm.cmake
+@@ -154,7 +154,7 @@ ov_rpm_specific_settings()
+ # needed to add triggers for packages with libraries
+ set(def_triggers "${OpenVINO_BINARY_DIR}/_CPack_Packages/triggers")
+ set(triggers_content "# /bin/sh -p\n/sbin/ldconfig\n")
+-file(WRITE "${def_triggers}" "${triggers_content}")
++#file(WRITE "${def_triggers}" "${triggers_content}")
+
+ #
+ # Functions helpful for packaging your modules with RPM cpack
+diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake
+index 29f23e713e1..942dd445b19 100644
+--- a/cmake/developer_package/target_flags.cmake
++++ b/cmake/developer_package/target_flags.cmake
+@@ -145,4 +145,4 @@ function(ov_glibc_version)
+ endif()
+ endfunction()
+
+-ov_glibc_version()
++#ov_glibc_version()
+diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt
+index c814cc37e2c..431e7bd2ed3 100644
+--- a/samples/cpp/CMakeLists.txt
++++ b/samples/cpp/CMakeLists.txt
+@@ -206,9 +206,9 @@ macro(ov_add_sample)
+ target_link_libraries(${SAMPLE_NAME} PRIVATE ${ov_link_libraries} Threads::Threads ${SAMPLE_DEPENDENCIES})
+
+ install(TARGETS ${SAMPLE_NAME}
+- RUNTIME DESTINATION samples_bin/
+- COMPONENT samples_bin
+- EXCLUDE_FROM_ALL)
++ DESTINATION ${CMAKE_INSTALL_BINDIR}
++ COMPONENT samples_bin)
++
+
+ # create global target with all samples / demo apps
+ if(NOT TARGET ov_samples)
+diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt
+index 58ff9b74302..4763994ba56 100644
+--- a/src/bindings/python/CMakeLists.txt
++++ b/src/bindings/python/CMakeLists.txt
+@@ -356,7 +356,7 @@ if(ENABLE_PYTHON_PACKAGING)
+ endif()
+
+ set(python_package_prefix "${CMAKE_CURRENT_BINARY_DIR}/install_${pyversion}")
+- set(install_lib "${python_package_prefix}/lib/${python_versioned_folder}/${ov_site_packages}")
++ set(install_lib "${python_package_prefix}/${CMAKE_INSTALL_LIBDIR}/${python_versioned_folder}/${ov_site_packages}")
+ set(meta_info_subdir "openvino-${OpenVINO_VERSION}-py${python_xy}.egg-info")
+ set(meta_info_file "${install_lib}/${meta_info_subdir}/PKG-INFO")
+
+diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py
+index 4b056912212..5f05d891310 100644
+--- a/src/bindings/python/wheel/setup.py
++++ b/src/bindings/python/wheel/setup.py
+@@ -270,7 +270,6 @@ class CustomBuild(build):
+ self.spawn(["cmake", "--install", binary_dir,
+ "--prefix", prefix,
+ "--config", CONFIG,
+- "--strip",
+ "--component", cpack_comp_name])
+
+ def run(self):
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-dont-install-licenses-and-version-file.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-dont-install-licenses-and-version-file.patch
deleted file mode 100644
index 2a2c8b87..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-dont-install-licenses-and-version-file.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From a60710c910e6c995aef9dd36757bf040bf24acf5 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Tue, 9 Jun 2020 11:35:59 +0800
-Subject: [PATCH] don't install licenses and version
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- ngraph/CMakeLists.txt | 6 ++----
- ngraph/test/runtime/CMakeLists.txt | 2 ++
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt
-index 99f32a6181..b90aa382b9 100644
---- a/ngraph/CMakeLists.txt
-+++ b/ngraph/CMakeLists.txt
-@@ -490,7 +490,7 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE)
- install(EXPORT ngraphTargets
- FILE ngraphTargets.cmake
- NAMESPACE ngraph::
-- DESTINATION ${NGRAPH_COMPONENT_PREFIX}cmake
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph
- COMPONENT ngraph)
-
- configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/share/ngraphConfig.cmake.in
-@@ -503,7 +503,7 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE)
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake
-- DESTINATION ${NGRAPH_COMPONENT_PREFIX}cmake
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph
- COMPONENT ngraph)
- endif()
-
-@@ -518,5 +518,3 @@ add_subdirectory(test)
- if (NGRAPH_PYTHON_BUILD_ENABLE)
- add_subdirectory(python)
- endif()
--
--install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION "${NGRAPH_COMPONENT_PREFIX}." COMPONENT ngraph)
-diff --git a/ngraph/test/runtime/CMakeLists.txt b/ngraph/test/runtime/CMakeLists.txt
-index d27ea8090c..17a3843f7d 100644
---- a/ngraph/test/runtime/CMakeLists.txt
-+++ b/ngraph/test/runtime/CMakeLists.txt
-@@ -80,3 +80,5 @@ target_include_directories(ngraph_backend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-
- add_subdirectory(interpreter)
- add_subdirectory(ie)
-+
-+install(TARGETS ngraph_backend DESTINATION ${NGRAPH_INSTALL_LIB})
---
-2.29.2
-
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch
deleted file mode 100644
index 1f64ce21..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From a8b6a2e251c42a393218174c6737208760d2e1c1 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Wed, 10 Jun 2020 09:43:55 +0800
-Subject: [PATCH] inference-engine: use system installed packages
-
-Use installed versions of ade, protobuf and tbb.
-
-Upstream-Status: Pending
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- cmake/dependencies.cmake | 18 ------------------
- inference-engine/CMakeLists.txt | 2 +-
- inference-engine/cmake/ie_parallel.cmake | 7 +------
- .../src/inference_engine/CMakeLists.txt | 19 -------------------
- .../common_test_utils/CMakeLists.txt | 4 +---
- .../unit_test_utils/CMakeLists.txt | 3 +--
- inference-engine/thirdparty/CMakeLists.txt | 5 ++---
- 7 files changed, 6 insertions(+), 52 deletions(-)
-
-diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
-index 6a44c8769e..a128eb63a1 100644
---- a/cmake/dependencies.cmake
-+++ b/cmake/dependencies.cmake
-@@ -13,25 +13,7 @@ if(CMAKE_CROSSCOMPILING AND NGRAPH_ONNX_IMPORT_ENABLE)
-
- set(protoc_version "3.7.1")
- if(CMAKE_HOST_SYSTEM_NAME MATCHES Linux)
-- RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
-- ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
-- TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64")
-- debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
- else()
- message(FATAL_ERROR "Unsupported host system (${CMAKE_HOST_SYSTEM_NAME}) and arch (${CMAKE_HOST_SYSTEM_PROCESSOR}) for cross-compilation")
- endif()
--
-- reset_deps_cache(SYSTEM_PROTOC)
--
-- message("${SYSTEM_PROTOC_ROOT}/bin")
-- find_program(
-- SYSTEM_PROTOC
-- NAMES protoc
-- PATHS "${SYSTEM_PROTOC_ROOT}/bin"
-- NO_DEFAULT_PATH)
-- if(NOT SYSTEM_PROTOC)
-- message(FATAL_ERROR "[ONNX IMPORTER] Missing host protoc binary")
-- endif()
--
-- update_deps_cache(SYSTEM_PROTOC "${SYSTEM_PROTOC}" "Path to host protoc for ONNX Importer")
- endif()
-diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt
-index a3e4f74c40..76b09683dd 100644
---- a/inference-engine/CMakeLists.txt
-+++ b/inference-engine/CMakeLists.txt
-@@ -56,7 +56,7 @@ function(ie_developer_export)
- APPEND FILE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
-
- # Custom target to build only Inference Engine Developer Package targets
-- add_custom_target(ie_dev_targets ALL DEPENDS ${OpenVINODeveloperPackageTargets} ${IEDeveloperPackageTargets} gflags
-+ add_custom_target(ie_dev_targets ALL DEPENDS ${OpenVINODeveloperPackageTargets} ${IEDeveloperPackageTargets}
- inference_engine_ir_reader inference_engine_ir_v7_reader)
- endfunction()
-
-diff --git a/inference-engine/cmake/ie_parallel.cmake b/inference-engine/cmake/ie_parallel.cmake
-index f8988aa105..28e79417f4 100644
---- a/inference-engine/cmake/ie_parallel.cmake
-+++ b/inference-engine/cmake/ie_parallel.cmake
-@@ -67,13 +67,8 @@ function(set_ie_threading_interface_for TARGET_NAME)
- set(IE_THREAD_DEFINE "IE_THREAD_SEQ")
-
- if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
-- if (TBB_FOUND)
- set(IE_THREAD_DEFINE "IE_THREAD_TBB")
-- ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${TBB_IMPORTED_TARGETS})
-- else ()
-- ext_message(WARNING "TBB was not found by the configured TBB_DIR path.\
-- SEQ method will be used for ${TARGET_NAME}")
-- endif ()
-+ target_link_libraries(${TARGET_NAME} INTERFACE tbb tbbmalloc)
- elseif (THREADING STREQUAL "OMP")
- if (WIN32)
- set(omp_lib_name libiomp5md)
-diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
-index f012a038a2..3bba22215e 100644
---- a/inference-engine/src/inference_engine/CMakeLists.txt
-+++ b/inference-engine/src/inference_engine/CMakeLists.txt
-@@ -216,25 +216,6 @@ list(APPEND core_components ngraph)
- if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBBROOT MATCHES ${TEMP})
- ie_cpack_add_component(tbb REQUIRED)
- list(APPEND core_components tbb)
--
-- install(DIRECTORY "${TBB}/include"
-- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
-- COMPONENT tbb)
-- install(DIRECTORY "${TBB}/lib"
-- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
-- COMPONENT tbb)
-- if(EXISTS "${TBB}/bin")
-- install(DIRECTORY "${TBB}/bin"
-- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
-- COMPONENT tbb)
-- endif()
-- install(FILES "${TBB}/LICENSE"
-- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
-- COMPONENT tbb)
-- install(FILES "${TBB}/cmake/TBBConfig.cmake"
-- "${TBB}/cmake/TBBConfigVersion.cmake"
-- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb/cmake
-- COMPONENT tbb)
- endif()
-
- ie_cpack_add_component(core REQUIRED DEPENDS ${core_components})
-diff --git a/inference-engine/tests/ie_test_utils/common_test_utils/CMakeLists.txt b/inference-engine/tests/ie_test_utils/common_test_utils/CMakeLists.txt
-index ca58264bd5..11df150845 100644
---- a/inference-engine/tests/ie_test_utils/common_test_utils/CMakeLists.txt
-+++ b/inference-engine/tests/ie_test_utils/common_test_utils/CMakeLists.txt
-@@ -26,7 +26,7 @@ function(add_gtest_libraries)
- PROPERTIES FOLDER thirdparty)
- endfunction()
-
--add_gtest_libraries()
-+#add_gtest_libraries()
-
- if (MSVC)
- set(PUGI pugixml_mt)
-@@ -37,8 +37,6 @@ endif ()
- list(APPEND EXPORT_DEPENDENCIES
- ${PUGI}
- ${NGRAPH_LIBRARIES}
-- gtest
-- gtest_main
- )
-
- set(TARGET_NAME commonTestUtils)
-diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/CMakeLists.txt b/inference-engine/tests/ie_test_utils/unit_test_utils/CMakeLists.txt
-index 5413d13895..3f2803750f 100644
---- a/inference-engine/tests/ie_test_utils/unit_test_utils/CMakeLists.txt
-+++ b/inference-engine/tests/ie_test_utils/unit_test_utils/CMakeLists.txt
-@@ -8,8 +8,7 @@ add_subdirectory(mocks/mock_engine)
-
- list(APPEND EXPORT_DEPENDENCIES
- commonTestUtils_s
-- inference_engine_s
-- gmock)
-+ inference_engine_s)
-
- addIeTarget(
- NAME ${TARGET_NAME}
-diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt
-index fa2a4d02d8..67d3b7ad05 100644
---- a/inference-engine/thirdparty/CMakeLists.txt
-+++ b/inference-engine/thirdparty/CMakeLists.txt
-@@ -62,14 +62,13 @@ else()
- endif()
-
- add_subdirectory(stb_lib)
--add_subdirectory(ade)
- add_subdirectory(fluid/modules/gapi)
-
--set_target_properties(ade fluid stb_image PROPERTIES FOLDER thirdparty)
-+set_target_properties(fluid stb_image PROPERTIES FOLDER thirdparty)
-
- # developer package
-
--ie_developer_export_targets(ade fluid)
-+ie_developer_export_targets(fluid)
-
- if (NOT USE_SYSTEM_PUGIXML)
- set_target_properties(pugixml PROPERTIES FOLDER thirdparty)
---
-2.29.2
-
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cldNN-disable-Werror.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cldNN-disable-Werror.patch
deleted file mode 100644
index a4e58b8e..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cldNN-disable-Werror.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 65014a2703a6a3892fdebc86fe1c5a3a589dbf56 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Wed, 10 Jun 2020 09:45:48 +0800
-Subject: [PATCH 2/5] cldNN: disable Werror
-
-Don't treat warnings as errors. This just leads to failures every time
-we upgrade the compiler.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- inference-engine/thirdparty/clDNN/CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/inference-engine/thirdparty/clDNN/CMakeLists.txt b/inference-engine/thirdparty/clDNN/CMakeLists.txt
-index 4b444eca..8610b9b8 100644
---- a/inference-engine/thirdparty/clDNN/CMakeLists.txt
-+++ b/inference-engine/thirdparty/clDNN/CMakeLists.txt
-@@ -770,7 +770,6 @@ foreach(__CLDNN_CompilerFlagName IN ITEMS "CMAKE_CXX_FLAGS" "CMAKE_C_FLAGS")
- MultiProcessorCompilation
- DeadCodeEliminate
- ExtensionsEnabled
-- TreatWarnAsErrorEnabled
- WarnLevel4
- NoFastMath
- StackProtector
---
-2.25.4
-
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-cmake-Fix-overloaded-virtual-error.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-cmake-Fix-overloaded-virtual-error.patch
new file mode 100644
index 00000000..e0967d55
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-cmake-Fix-overloaded-virtual-error.patch
@@ -0,0 +1,33 @@
+From 900eeeb2953095e651270c0f42ccd8b26fd7885c Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 29 Nov 2023 12:49:35 +0530
+Subject: [PATCH 3/4] cmake: Fix overloaded-virtual error
+
+* Remove -Werror for:
+|git/src/plugins/intel_gpu/src/kernel_selector/jitter.h:129:28: error: 'virtual kernel_selector::JitDefinitions kernel_selector::JitConstant::GetDefinitions() const' was hidden [-Werror=overloaded-virtual=]
+| 129 | virtual JitDefinitions GetDefinitions() const = 0;
+| |
+
+Upstream-Status: Pending
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ src/plugins/intel_gpu/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt
+index b0c66a435d6..a3037147cc2 100644
+--- a/src/plugins/intel_gpu/CMakeLists.txt
++++ b/src/plugins/intel_gpu/CMakeLists.txt
+@@ -38,7 +38,7 @@ add_subdirectory(thirdparty)
+ include(thirdparty/cmake/rapidjson.cmake)
+
+ if(CMAKE_COMPILER_IS_GNUCXX)
+- ov_add_compiler_flags(-Werror)
++ #ov_add_compiler_flags(-Werror)
+ endif()
+
+ add_subdirectory(src/runtime)
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-inference-engine-installation-fixes.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-inference-engine-installation-fixes.patch
deleted file mode 100644
index 52049eb0..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-inference-engine-installation-fixes.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-From cb9a755218ff033c8c42e9dc46a845310a3331fa Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Thu, 11 Jun 2020 14:24:04 +0800
-Subject: [PATCH] cmake installation fixes
-
-Make sure that libraries/samples/binaries are installed correctly.
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- CMakeLists.txt | 14 --------------
- cmake/developer_package.cmake | 10 ++++++----
- .../samples/common/opencv_c_wraper/CMakeLists.txt | 2 ++
- inference-engine/samples/CMakeLists.txt | 9 +++------
- .../samples/common/format_reader/CMakeLists.txt | 2 ++
- .../src/inference_engine/CMakeLists.txt | 4 ++--
- .../src/vpu/myriad_plugin/CMakeLists.txt | 2 +-
- inference-engine/tests/unit/cpu/CMakeLists.txt | 2 ++
- .../tests/unit/inference_engine/CMakeLists.txt | 2 ++
- inference-engine/tests/unit/vpu/CMakeLists.txt | 2 ++
- inference-engine/tools/compile_tool/CMakeLists.txt | 2 +-
- 11 files changed, 23 insertions(+), 28 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5c3585a3e9..2b8c99f862 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -176,12 +176,8 @@ ie_shellcheck_process(DIRECTORY "${OpenVINO_MAIN_SOURCE_DIR}"
-
- # install setupvars
-
--ie_cpack_add_component(setupvars REQUIRED)
-
- if(UNIX)
-- install(PROGRAMS scripts/setupvars/setupvars.sh
-- DESTINATION bin
-- COMPONENT setupvars)
- elseif(WIN32)
- install(PROGRAMS scripts/setupvars/setupvars.bat
- DESTINATION bin
-@@ -191,22 +187,12 @@ endif()
- # install install_dependencies
-
- if(UNIX)
-- ie_cpack_add_component(install_dependencies REQUIRED)
-- install(DIRECTORY scripts/install_dependencies/
-- DESTINATION install_dependencies
-- COMPONENT install_dependencies)
- endif()
-
- # install files for demo
-
--ie_cpack_add_component(demo_scripts REQUIRED DEPENDS core)
-
- if(UNIX)
-- install(DIRECTORY scripts/demo/
-- DESTINATION deployment_tools/demo
-- COMPONENT demo_scripts
-- USE_SOURCE_PERMISSIONS
-- PATTERN *.bat EXCLUDE)
- elseif(WIN32)
- install(DIRECTORY scripts/demo/
- DESTINATION deployment_tools/demo
-diff --git a/cmake/developer_package.cmake b/cmake/developer_package.cmake
-index cda7afd294..ec51636e96 100644
---- a/cmake/developer_package.cmake
-+++ b/cmake/developer_package.cmake
-@@ -29,7 +29,9 @@ list(APPEND CMAKE_MODULE_PATH
- include(CPackComponent)
- unset(IE_CPACK_COMPONENTS_ALL CACHE)
-
--set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
-+if (NOT DEFINED IE_CPACK_IE_DIR)
-+ set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
-+endif()
-
- # Search packages for the host system instead of packages for the target system
- # in case of cross compilation these macros should be defined by the toolchain file
-@@ -55,8 +57,8 @@ function(ie_cpack_set_library_dir)
- set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/bin/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
- set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
- else()
-- set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
-- set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
-+ set(IE_CPACK_LIBRARY_PATH ${CMAKE_INSTALL_LIBDIR} PARENT_SCOPE)
-+ set(IE_CPACK_RUNTIME_PATH ${CMAKE_INSTALL_BINDIR} PARENT_SCOPE)
- set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
- endif()
- endfunction()
-@@ -151,7 +153,7 @@ endif()
-
- # allow to override default OUTPUT_ROOT root
- if(NOT DEFINED OUTPUT_ROOT)
-- set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
-+ set(OUTPUT_ROOT ${CMAKE_CURRENT_BINARY_DIR})
- endif()
-
- # Enable postfixes for Debug/Release builds
-diff --git a/inference-engine/ie_bridges/c/samples/common/opencv_c_wraper/CMakeLists.txt b/inference-engine/ie_bridges/c/samples/common/opencv_c_wraper/CMakeLists.txt
-index b8d5ddf622..d086478f6d 100644
---- a/inference-engine/ie_bridges/c/samples/common/opencv_c_wraper/CMakeLists.txt
-+++ b/inference-engine/ie_bridges/c/samples/common/opencv_c_wraper/CMakeLists.txt
-@@ -29,3 +29,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER c_samples)
- if(COMMAND add_cpplint_target)
- add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
- endif()
-+
-+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
-diff --git a/inference-engine/samples/CMakeLists.txt b/inference-engine/samples/CMakeLists.txt
-index 236c17e6af..22f410d1fd 100644
---- a/inference-engine/samples/CMakeLists.txt
-+++ b/inference-engine/samples/CMakeLists.txt
-@@ -34,7 +34,7 @@ endif()
-
- if(IE_MAIN_SOURCE_DIR)
- # in case if samples are built from IE repo
-- set(IE_MAIN_SAMPLES_DIR ${OpenVINO_MAIN_SOURCE_DIR})
-+ set(IE_MAIN_SAMPLES_DIR ${CMAKE_BINARY_DIR})
- # hint for find_package(InferenceEngine in the samples folder)
- set(InferenceEngine_DIR "${CMAKE_BINARY_DIR}")
- # hint for find_package(ngraph in the samples folder)
-@@ -118,11 +118,6 @@ set (HAVE_INTTYPES_H 1)
- set (INTTYPES_FORMAT C99)
- set (BUILD_TESTING OFF)
-
--if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags")
-- add_subdirectory(thirdparty/gflags)
-- set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty)
--endif()
--
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
- endif()
-@@ -245,6 +240,8 @@ macro(ie_add_sample)
- add_cpplint_target(${IE_SAMPLE_NAME}_cpplint FOR_TARGETS ${IE_SAMPLE_NAME}
- CUSTOM_FILTERS ${custom_filters})
- endif()
-+
-+ install(TARGETS ${IE_SAMPLE_NAME} DESTINATION bin)
- endmacro()
-
- # collect all samples subdirectories
-diff --git a/inference-engine/samples/common/format_reader/CMakeLists.txt b/inference-engine/samples/common/format_reader/CMakeLists.txt
-index 48dbed9f2b..76532fd047 100644
---- a/inference-engine/samples/common/format_reader/CMakeLists.txt
-+++ b/inference-engine/samples/common/format_reader/CMakeLists.txt
-@@ -41,3 +41,5 @@ target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
-
- set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}
- FOLDER cpp_samples)
-+
-+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
-diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
-index 3bba22215e..b6f6b7b203 100644
---- a/inference-engine/src/inference_engine/CMakeLists.txt
-+++ b/inference-engine/src/inference_engine/CMakeLists.txt
-@@ -229,8 +229,8 @@ install(TARGETS ${TARGET_NAME}
- install(FILES "${OpenVINO_BINARY_DIR}/share/ie_parallel.cmake"
- "${OpenVINO_BINARY_DIR}/share/InferenceEngineConfig.cmake"
- "${OpenVINO_BINARY_DIR}/share/InferenceEngineConfig-version.cmake"
-- DESTINATION ${IE_CPACK_IE_DIR}/share
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/InferenceEngine
- COMPONENT core)
- install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
-- DESTINATION ${IE_CPACK_RUNTIME_PATH}
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
- COMPONENT core)
-diff --git a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-index 889f2e6e66..67de9c3a32 100644
---- a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-+++ b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-@@ -50,5 +50,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_REL
- # install
-
- install(FILES ${IE_MAIN_SOURCE_DIR}/thirdparty/movidius/mvnc/src/97-myriad-usbboot.rules
-- DESTINATION ${IE_CPACK_IE_DIR}/external
-+ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/udev/rules.d
- COMPONENT myriad)
-diff --git a/inference-engine/tests/unit/cpu/CMakeLists.txt b/inference-engine/tests/unit/cpu/CMakeLists.txt
-index c9a92b4857..2b4fcc4d01 100644
---- a/inference-engine/tests/unit/cpu/CMakeLists.txt
-+++ b/inference-engine/tests/unit/cpu/CMakeLists.txt
-@@ -25,3 +25,5 @@ addIeTargetTest(
- ie_faster_build(${TARGET_NAME}
- UNITY
- )
-+
-+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
-diff --git a/inference-engine/tests/unit/inference_engine/CMakeLists.txt b/inference-engine/tests/unit/inference_engine/CMakeLists.txt
-index 76cc67cca1..04ff11cc05 100644
---- a/inference-engine/tests/unit/inference_engine/CMakeLists.txt
-+++ b/inference-engine/tests/unit/inference_engine/CMakeLists.txt
-@@ -26,3 +26,5 @@ addIeTargetTest(
- LABELS
- IE
- )
-+
-+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
-diff --git a/inference-engine/tests/unit/vpu/CMakeLists.txt b/inference-engine/tests/unit/vpu/CMakeLists.txt
-index 215562f2af..215ec9f4fb 100644
---- a/inference-engine/tests/unit/vpu/CMakeLists.txt
-+++ b/inference-engine/tests/unit/vpu/CMakeLists.txt
-@@ -35,3 +35,5 @@ addIeTargetTest(
- VPU
- MYRIAD
- )
-+
-+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
-diff --git a/inference-engine/tools/compile_tool/CMakeLists.txt b/inference-engine/tools/compile_tool/CMakeLists.txt
-index 58614d3ced..9dfa068e4d 100644
---- a/inference-engine/tools/compile_tool/CMakeLists.txt
-+++ b/inference-engine/tools/compile_tool/CMakeLists.txt
-@@ -49,7 +49,7 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
- # install
-
- install(TARGETS compile_tool
-- RUNTIME DESTINATION deployment_tools/tools/compile_tool
-+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- COMPONENT core)
-
- install(FILES README.md
---
-2.29.2
-
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0004-protobuf-allow-target-protoc-to-be-built.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0004-protobuf-allow-target-protoc-to-be-built.patch
new file mode 100644
index 00000000..59095133
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0004-protobuf-allow-target-protoc-to-be-built.patch
@@ -0,0 +1,45 @@
+From 3e288ed876c6bcb6aa3174e52446b479255ddf22 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 29 Nov 2023 12:55:19 +0530
+Subject: [PATCH 4/4] protobuf: allow target protoc to be built
+
+We can run target binaries using a qemu wrapper so allow these to be
+built and run.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ cmake/developer_package/frontends/frontends.cmake | 2 +-
+ thirdparty/protobuf/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
+index 49c5b881030..2a1ea8562bc 100644
+--- a/cmake/developer_package/frontends/frontends.cmake
++++ b/cmake/developer_package/frontends/frontends.cmake
+@@ -143,7 +143,7 @@ macro(ov_add_frontend)
+ set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${relative_path}/${FILE_WE}.pb.h)
+ add_custom_command(
+ OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}"
+- COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file}
++ COMMAND protoc ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file}
+ DEPENDS ${PROTOC_DEPENDENCY} ${proto_file}
+ COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${proto_file_relative}"
+ VERBATIM
+diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt
+index 4b6d6da87f3..409e492a5b3 100644
+--- a/thirdparty/protobuf/CMakeLists.txt
++++ b/thirdparty/protobuf/CMakeLists.txt
+@@ -28,7 +28,7 @@ set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Abseil protogate CXX standard to depen
+ if(CMAKE_CROSSCOMPILING OR
+ (APPLE AND (HOST_X86_64 AND AARCH64)) OR
+ (MSVC AND (HOST_X86_64 AND (AARCH64 OR ARM))))
+- set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protoc binaries" FORCE)
++ set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE)
+ else()
+ set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE)
+ endif()
+--
+2.34.1
+
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0005-cldnn-fix-inclusion-of-headers.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0005-cldnn-fix-inclusion-of-headers.patch
deleted file mode 100644
index d4819077..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0005-cldnn-fix-inclusion-of-headers.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From aa515686548d74a68456b9ba7a295b6ae4be343a Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Wed, 10 Jun 2020 09:50:19 +0800
-Subject: [PATCH] cldnn: fix inclusion of headers
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-
----
- inference-engine/include/gpu/gpu_ocl_wrapper.hpp | 2 +-
- inference-engine/src/cldnn_engine/CMakeLists.txt | 1 +
- .../thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp | 2 +-
- 3 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
-index 68ccf3217..c5b0ce6be 100644
---- a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
-+++ b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
-@@ -39,7 +39,7 @@
- # pragma GCC system_header
- #endif
-
--#include <CL/cl2.hpp>
-+#include <cl2.hpp>
-
- #ifdef __GNUC__
- # pragma GCC diagnostic pop
-diff --git a/inference-engine/src/cldnn_engine/CMakeLists.txt b/inference-engine/src/cldnn_engine/CMakeLists.txt
-index 7e15abbed..46d43e0e5 100644
---- a/inference-engine/src/cldnn_engine/CMakeLists.txt
-+++ b/inference-engine/src/cldnn_engine/CMakeLists.txt
-@@ -31,6 +31,7 @@ target_include_directories(${TARGET_NAME} PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>
- ${CLDNN__IOCL_ICD_INCDIRS}
-+ ${CLDNN_TOP_FOLDER}/common/khronos_ocl_clhpp
- ${CLDNN_TOP_FOLDER})
-
- set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
-diff --git a/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp b/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
-index 97608c30a..3a04096c0 100644
---- a/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
-+++ b/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
-@@ -29,7 +29,7 @@ typedef cl_d3d11_device_set_khr cl_device_set_intel;
- typedef cl_va_api_device_source_intel cl_device_source_intel;
- typedef cl_va_api_device_set_intel cl_device_set_intel;
- #endif
--#include <CL/cl_intel_planar_yuv.h>
-+#include <CL/cl_ext_intel.h>
- #include "cl_intel_usm_defs.h"
-
- #include <memory>
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch
index 864c735e..816a98a3 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch
@@ -1,33 +1,27 @@
-From 56078933a8397b7fae146156743408319eac1ae0 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Mon, 19 Oct 2020 23:29:23 +0800
+From 804b08023b3f8e72b8e3eb09e464d6775c11d966 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <naveen.kumar.saini@intel.com>
+Date: Fri, 21 Oct 2022 11:38:23 +0800
Subject: [PATCH] demos: use gflags from meta-oe
Upstream-Status: Inappropriate
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+
---
- demos/CMakeLists.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ demos/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
-index e5f17231..08d4e4e6 100644
+index 51767051c..fb7e3d22f 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
-@@ -90,11 +90,11 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
- endif()
- ####################################
-
--set (GFLAGS_IS_SUBPROJECT TRUE)
-+set (GFLAGS_IS_SUBPROJECT FALSE)
- set (HAVE_SYS_STAT_H 1)
- set (HAVE_INTTYPES_H 1)
+@@ -141,7 +141,7 @@ endmacro()
+ find_package(OpenCV REQUIRED COMPONENTS core highgui videoio imgproc imgcodecs)
+ find_package(OpenVINO REQUIRED COMPONENTS Runtime)
-add_subdirectory(thirdparty/gflags)
+#add_subdirectory(thirdparty/gflags)
+ add_subdirectory(common/cpp)
- if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
---
-2.26.2
-
+ find_package(OpenCV QUIET COMPONENTS gapi)
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.2.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.2.bb
deleted file mode 100644
index 6784d0d8..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.2.bb
+++ /dev/null
@@ -1,63 +0,0 @@
-SUMMARY = "OpenVINO(TM) Toolkit - Open Model Zoo repository"
-HOMEPAGE = "https://github.com/opencv/open_model_zoo"
-DESCRIPTION = "This repository includes optimized deep learning \
-models and a set of demos to expedite development of high-performance \
-deep learning inference applications."
-
-SRC_URI = "git://github.com/opencv/open_model_zoo.git;protocol=git;branch=master \
- file://0001-use-oe-gflags.patch;striplevel=2 \
- "
-
-SRCREV = "338630987b403a6981d03ab6d04c2d5ad367793a"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://../LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
-"
-
-inherit cmake
-
-S = "${WORKDIR}/git/demos"
-
-DEPENDS += "openvino-inference-engine opencv gflags"
-
-RDEPENDS_${PN} += " \
- python3-decorator \
- python3-defusedxml \
- python3-networkx \
- python3-protobuf \
- python3-test-generator \
- python3-requests \
- python3-pyyaml \
-"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-
-EXTRA_OECMAKE += " \
- -DIE_MAIN_SOURCE_DIR=${B} \
- -DENABLE_SAMPLES=ON \
- -DIE_INCLUDE_DIR=${STAGING_EXECPREFIXDIR} \
- -DIE_RELEASE_LIBRARY=${STAGING_LIBDIR}/libinference_engine.so \
- -DIE_C_API_RELEASE_LIBRARY=${STAGING_LIBDIR}/libinference_engine_c_api.so \
- -DIE_LEGACY_RELEASE_LIBRARY=${STAGING_LIBDIR}/libinference_engine_legacy.so \
- -DIE_NN_BUILDER_RELEASE_LIBRARY=${STAGING_LIBDIR}/libinference_engine_nn_builder.so \
- -DIE_ROOT_DIR=${WORKDIR}/InferenceEngine \
-"
-
-do_configure_prepend(){
- mkdir -p ${WORKDIR}/InferenceEngine/share
- cp ${STAGING_LIBDIR}/cmake/InferenceEngine/* ${WORKDIR}/InferenceEngine/share/
-}
-
-do_install(){
- install -d ${D}${libdir}
- install -d ${D}${bindir}
- install -d ${D}${datadir}/openvino/open-model-zoo/tools
- install -d ${D}${datadir}/openvino/open-model-zoo/demos/python_demos
- cp -rf ${WORKDIR}/build/intel64/Release/lib/*.a ${D}${libdir}
- cp -rf ${WORKDIR}/build/intel64/Release/*_demo* ${D}${bindir}
- cp -rf ${WORKDIR}/git/models ${D}${datadir}/openvino/open-model-zoo
- cp -rf ${WORKDIR}/git/tools/downloader ${D}${datadir}/openvino/open-model-zoo/tools
- cp -rf ${WORKDIR}/git/demos/python_demos ${D}${datadir}/openvino/open-model-zoo/demos
-}
-
-FILES_${PN} += "${datadir}/openvino"
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.0.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.0.0.bb
new file mode 100644
index 00000000..495a4786
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.0.0.bb
@@ -0,0 +1,54 @@
+SUMMARY = "OpenVINO(TM) Toolkit - Open Model Zoo repository"
+HOMEPAGE = "https://github.com/opencv/open_model_zoo"
+DESCRIPTION = "This repository includes optimized deep learning \
+models and a set of demos to expedite development of high-performance \
+deep learning inference applications."
+
+SRC_URI = "git://github.com/opencv/open_model_zoo.git;protocol=https;branch=master \
+ file://0001-use-oe-gflags.patch \
+ "
+
+SRCREV = "37f60eb7fe1dcdedc552b2fb184d646723ed5e80"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
+"
+
+inherit cmake
+
+S = "${WORKDIR}/git"
+OECMAKE_SOURCEPATH = "${S}/demos"
+
+DEPENDS += "openvino-inference-engine opencv gflags"
+
+RDEPENDS:${PN} += " \
+ python3-decorator \
+ python3-defusedxml \
+ python3-networkx \
+ python3-protobuf \
+ python3-requests \
+ python3-pyyaml \
+ python3-numpy \
+ bash \
+"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+EXTRA_OECMAKE += " \
+ -DENABLE_SAMPLES=ON \
+ "
+
+do_install(){
+ install -d ${D}${libdir}
+ install -d ${D}${bindir}
+ install -d ${D}${datadir}/openvino/open-model-zoo/tools
+ install -d ${D}${datadir}/openvino/open-model-zoo/demos
+ cp -rf ${WORKDIR}/build/intel64/Release/*.a ${D}${libdir}
+ cp -rf ${WORKDIR}/build/intel64/Release/*_demo* ${D}${bindir}
+ cp -rf ${WORKDIR}/git/models ${D}${datadir}/openvino/open-model-zoo
+ cp -rf ${WORKDIR}/git/demos ${D}${datadir}/openvino/open-model-zoo
+ cp -rf ${WORKDIR}/git/tools/model_tools ${D}${datadir}/openvino/open-model-zoo/tools
+}
+
+FILES:${PN} += "${datadir}/openvino"
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.2.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.2.bb
deleted file mode 100644
index 22194467..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.2.bb
+++ /dev/null
@@ -1,123 +0,0 @@
-SUMMARY = "OpenVINO(TM) Toolkit - Deep Learning Deployment Toolkit"
-HOMEPAGE = "https://github.com/opencv/dldt"
-DESCRIPTION = "This toolkit allows developers to deploy pre-trained \
-deep learning models through a high-level C++ Inference Engine API \
-integrated with application logic."
-
-SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=git;branch=releases/2021/2;lfs=0 \
- https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/usb-ma2x8x/firmware_usb-ma2x8x_1522.zip;name=usb_ma2x8x \
- https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/pcie-ma2x8x/firmware_pcie-ma2x8x_1522.zip;name=pcie_ma2x8x \
- git://github.com/openvinotoolkit/oneDNN.git;protocol=https;destsuffix=git/inference-engine/thirdparty/mkl-dnn;name=mkl;nobranch=1 \
- file://0001-inference-engine-use-system-installed-packages.patch \
- file://0002-cldNN-disable-Werror.patch \
- file://0003-inference-engine-installation-fixes.patch \
- file://0005-cldnn-fix-inclusion-of-headers.patch \
- file://0001-dont-install-licenses-and-version-file.patch \
- "
-
-SRCREV = "4795391b73381660b69b4cd3986c7a0bf902e868"
-SRCREV_mkl = "5ef085d5af65e8966e03cdfcbaa65761d61a5c9a"
-
-SRC_URI[usb_ma2x8x.sha256sum] = "95a93144f0bbfe6e35d3830e93e6b63e1e109f849a6a7c307cae9030e3a662aa"
-SRC_URI[pcie_ma2x8x.sha256sum] = "6d061d21d90f1919ef375138066ba7a20ceb663901d2729d9cb1b639169df5da"
-
-LICENSE = "Apache-2.0 & ISSL & MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
- file://inference-engine/thirdparty/mkl-dnn/LICENSE;md5=afa44a3d001cc203032135324f9636b7 \
- file://inference-engine/thirdparty/mkl-dnn/src/cpu/xbyak/COPYRIGHT;md5=03532861dad9003cc2c17f14fc7a4efa \
- file://inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/LICENSE.txt;md5=88b295a48d2b3244ba65d3c055472c8a \
-"
-LICENSE_${PN}-vpu-firmware = "ISSL"
-
-inherit cmake python3native
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECMAKE += " \
- -DENABLE_OPENCV=0 \
- -DENABLE_PLUGIN_RPATH=0 \
- -DENABLE_GNA=0 \
- -DPYTHON_EXECUTABLE=${PYTHON} \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DTHREADING=TBB -DTBB_DIR=${STAGING_LIBDIR} \
- -DENABLE_SAMPLES=1 \
- -DIE_CPACK_IE_DIR=${prefix} \
- -DNGRAPH_UNIT_TEST_ENABLE=FALSE \
- -DNGRAPH_TEST_UTIL_ENABLE=FALSE \
- -DNGRAPH_ONNX_IMPORT_ENABLE=OFF \
- -DNGRAPH_JSON_ENABLE=FALSE \
- -DTREAT_WARNING_AS_ERROR=FALSE \
- -DENABLE_SPEECH_DEMO=FALSE \
- -DENABLE_DATA=FALSE \
- -DUSE_SYSTEM_PUGIXML=TRUE \
- "
-
-DEPENDS += "libusb1 \
- ade \
- opencv \
- pugixml \
- protobuf-native \
- tbb \
- onednn \
- "
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-PACKAGECONFIG ?= "vpu opencl"
-PACKAGECONFIG[opencl] = "-DENABLE_CLDNN=1 -DCLDNN__IOCL_ICD_INCDIRS=${STAGING_INCDIR} -DCLDNN__IOCL_ICD_STLDIRS=${STAGING_LIBDIR} -DCLDNN__IOCL_ICD_SHLDIRS=${STAGING_LIBDIR}, -DENABLE_CLDNN=0, ocl-icd opencl-headers libva, intel-compute-runtime"
-PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}, -DENABLE_PYTHON=OFF, python3-cython-native, python3 python3-numpy python3-opencv python3-progress python3-cython"
-PACKAGECONFIG[vpu] = "-DENABLE_VPU=ON -DVPU_FIRMWARE_USB-MA2X8X_FILE=../mvnc/usb-ma2x8x.mvcmd -DVPU_FIRMWARE_PCIE-MA2X8X_FILE=../mvnc/pcie-ma2x8x.mvcmd,-DENABLE_VPU=OFF,,${PN}-vpu-firmware"
-PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0"
-
-do_install_append() {
- if ${@bb.utils.contains('PACKAGECONFIG', 'vpu', 'true', 'false', d)}; then
- install -m0644 ${WORKDIR}/mvnc/usb-ma2x8x.mvcmd ${D}${libdir}/
- install -m0644 ${WORKDIR}/mvnc/pcie-ma2x8x.mvcmd ${D}${libdir}/
- fi
-
- if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
- install -d ${D}${datadir}/inference_engine
- mv ${D}/usr/samples/python ${D}${datadir}/inference_engine/
-
- install -d ${D}${PYTHON_SITEPACKAGES_DIR}
- mv ${D}${prefix}/python/${PYTHON_DIR}/openvino ${D}${PYTHON_SITEPACKAGES_DIR}/
- mv ${D}${prefix}/deployment_tools/tools/benchmark_tool ${D}${PYTHON_SITEPACKAGES_DIR}/openvino/
- mv ${D}${prefix}/deployment_tools/tools/cross_check_tool ${D}${PYTHON_SITEPACKAGES_DIR}/openvino/
-
- rm -rf ${D}${prefix}/python
- fi
-
- rm -rf ${D}${prefix}/deployment_tools
-
- # Remove the samples source directory. We install the built samples.
- rm -rf ${D}/usr/samples
-}
-
-# Otherwise e.g. ros-openvino-toolkit-dynamic-vino-sample when using dldt-inference-engine uses dldt-inference-engine WORKDIR
-# instead of RSS
-SSTATE_SCAN_FILES_append = " *.cmake"
-
-FILES_${PN}-dev = "${includedir} \
- ${libdir}/cmake \
- "
-
-FILES_${PN} += "${libdir}/lib*${SOLIBSDEV} \
- ${datadir}/openvino \
- ${libdir}/custom_kernels \
- ${libdir}/plugins.xml \
- ${libdir}/cache.json \
- "
-
-# Move inference engine samples into a separate package
-PACKAGES =+ "${PN}-samples ${PN}-vpu-firmware"
-
-FILES_${PN}-samples = "${datadir}/inference_engine \
- ${bindir} \
- "
-FILES_${PN}-vpu-firmware += "${libdir}/*.mvcmd"
-
-# Package for inference engine python API
-PACKAGES =+ "${PN}-${PYTHON_PN}"
-
-FILES_${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}/openvino"
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.0.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.0.0.bb
new file mode 100644
index 00000000..94edd1b8
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.0.0.bb
@@ -0,0 +1,143 @@
+SUMMARY = "OpenVINO(TM) Toolkit - Deep Learning Deployment Toolkit"
+HOMEPAGE = "https://github.com/opencv/dldt"
+DESCRIPTION = "This toolkit allows developers to deploy pre-trained \
+deep learning models through a high-level C++ Inference Engine API \
+integrated with application logic."
+
+SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;name=openvino;branch=releases/2024/0;lfs=0 \
+ git://github.com/openvinotoolkit/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/onednn;name=mkl;nobranch=1 \
+ git://github.com/oneapi-src/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_gpu/thirdparty/onednn_gpu;name=onednn;nobranch=1 \
+ git://github.com/herumi/xbyak.git;protocol=https;destsuffix=git/thirdparty/xbyak;name=xbyak;branch=master \
+ git://github.com/nlohmann/json.git;protocol=https;destsuffix=git/thirdparty/json/nlohmann_json;name=json;branch=develop \
+ git://github.com/opencv/ade.git;protocol=https;destsuffix=git/thirdparty/ade;name=ade;nobranch=1 \
+ git://github.com/protocolbuffers/protobuf.git;protocol=https;destsuffix=git/thirdparty/protobuf/protobuf;name=protobuf;branch=3.20.x \
+ git://github.com/gflags/gflags.git;protocol=https;destsuffix=git/thirdparty/gflags/gflags;name=gflags;nobranch=1 \
+ git://github.com/madler/zlib.git;protocol=https;destsuffix=git/thirdparty/zlib/zlib;name=zlib;nobranch=1 \
+ git://github.com/openvinotoolkit/mlas.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/mlas;name=mlas;nobranch=1 \
+ git://github.com/nodejs/node-api-headers.git;protocol=https;destsuffix=git/node-api-headers-src;name=node-api-headers;nobranch=1 \
+ git://github.com/nodejs/node-addon-api.git;protocol=https;destsuffix=git/node-addon-api-src;name=node-addon-api;nobranch=1 \
+ file://0001-cmake-yocto-specific-tweaks-to-the-build-process.patch \
+ file://0003-cmake-Fix-overloaded-virtual-error.patch \
+ file://0004-protobuf-allow-target-protoc-to-be-built.patch \
+ file://0001-cmake-fix-build-when-using-sysroot.patch \
+ file://0001-CPU-Solving-the-build-failure-caused-by-setting-the-.patch \
+ "
+
+SRCREV_openvino = "34caeefd07800b59065345d651949efbe8ab6649"
+SRCREV_mkl = "f82148befdbdc9576ec721c9d500155ee4de8060"
+SRCREV_onednn = "494af5f9921bdae98f1a0e2955fa7d76ff386c4f"
+SRCREV_xbyak = "740dff2e866f3ae1a70dd42d6e8836847ed95cc2"
+SRCREV_json = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03"
+SRCREV_ade = "0e8a2ccdd34f29dba55894f5f3c5179809888b9e"
+SRCREV_protobuf = "fe271ab76f2ad2b2b28c10443865d2af21e27e0e"
+SRCREV_gflags = "e171aa2d15ed9eb17054558e0b3a6a413bb01067"
+SRCREV_zlib = "09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851"
+SRCREV_mlas = "d1bc25ec4660cddd87804fcf03b2411b5dfb2e94"
+SRCREV_node-api-headers = "186e04b5e40e54d7fd1655bc67081cc483f12488"
+SRCREV_node-addon-api = "39a25bf27788ff7a7ea5c64978c4dcd1e7b9d80d"
+SRCREV_FORMAT = "openvino_mkl_onednn_xbyak_json_ade_protobuf_gflags_zlib_node-api-headers_node-addon-api_mlas"
+
+LICENSE = "Apache-2.0 & MIT & BSD-3-Clause & Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
+ file://thirdparty/xbyak/COPYRIGHT;md5=3c98edfaa50a86eeaef4c6109e803f16 \
+ file://thirdparty/cnpy/LICENSE;md5=689f10b06d1ca2d4b1057e67b16cd580 \
+ file://thirdparty/json/nlohmann_json/LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588 \
+ file://thirdparty/ade/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+ file://thirdparty/gflags/gflags/COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df \
+ file://thirdparty/zlib/zlib/LICENSE;md5=b51a40671bc46e961c0498897742c0b8 \
+ file://src/plugins/intel_cpu/thirdparty/mlas/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
+ file://src/plugins/intel_cpu/thirdparty/onednn/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \
+ file://src/plugins/intel_gpu/thirdparty/onednn_gpu/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \
+ file://node-api-headers-src/LICENSE;md5=6adb2909701d4605b4b2ae1a9b25d8bd \
+ file://node-addon-api-src/LICENSE.md;md5=0492ef29a9d558a3e9660e7accc9ca6a \
+"
+
+inherit cmake python3native pkgconfig qemu
+
+S = "${WORKDIR}/git"
+EXTRA_OECMAKE += " \
+ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \
+ -DENABLE_OPENCV=OFF \
+ -DENABLE_INTEL_GNA=OFF \
+ -DENABLE_SYSTEM_TBB=ON \
+ -DPYTHON_EXECUTABLE=${PYTHON} \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DTHREADING=TBB -DTBB_DIR="${STAGING_LIBDIR}/cmake/TBB" \
+ -DTREAT_WARNING_AS_ERROR=FALSE \
+ -DENABLE_DATA=FALSE \
+ -DENABLE_SYSTEM_PUGIXML=TRUE \
+ -DENABLE_OV_ONNX_FRONTEND=FALSE \
+ -DUSE_BUILD_TYPE_SUBFOLDER=OFF \
+ -DENABLE_FUZZING=OFF \
+ -DENABLE_TBBBIND_2_5=OFF \
+ -DCPACK_GENERATOR=RPM \
+ -DENABLE_SYSTEM_FLATBUFFERS=ON \
+ -DENABLE_SYSTEM_SNAPPY=ON \
+ -DFETCHCONTENT_BASE_DIR="${S}" \
+ "
+
+DEPENDS += "\
+ flatbuffers-native \
+ pugixml \
+ python3-pybind11 \
+ python3-pybind11-native \
+ qemu-native \
+ snappy \
+ tbb \
+ "
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+PACKAGECONFIG ?= "opencl samples"
+PACKAGECONFIG[opencl] = "-DENABLE_INTEL_GPU=TRUE, -DENABLE_INTEL_GPU=FALSE, virtual/opencl-icd opencl-headers opencl-clhpp,"
+PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DENABLE_PYTHON_PACKAGING=ON, -DENABLE_PYTHON=OFF, patchelf-native, python3 python3-numpy python3-progress"
+PACKAGECONFIG[samples] = "-DENABLE_SAMPLES=ON -DENABLE_COMPILE_TOOL=ON, -DENABLE_SAMPLES=OFF -DENABLE_COMPILE_TOOL=OFF, opencv"
+PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0"
+
+do_configure:prepend() {
+ # Dont set PROJECT_ROOT_DIR
+ sed -i -e 's:\${OpenVINO_SOURCE_DIR}::;' ${S}/src/CMakeLists.txt
+
+ # qemu wrapper that can be used by cmake to run target binaries.
+ qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
+ cat > ${WORKDIR}/qemuwrapper << EOF
+#!/bin/sh
+$qemu_binary "\$@"
+EOF
+ chmod +x ${WORKDIR}/qemuwrapper
+}
+
+do_install:append() {
+ rm -rf ${D}${prefix}/install_dependencies
+ rm -rf ${D}${prefix}/setupvars.sh
+
+ find ${B}/src/plugins/intel_cpu/cross-compiled/ -type f -name *_disp.cpp -exec sed -i -e 's%'"${S}"'%'"${TARGET_DBGSRC_DIR}"'%g' {} +
+}
+
+# Otherwise e.g. ros-openvino-toolkit-dynamic-vino-sample when using dldt-inference-engine uses dldt-inference-engine WORKDIR
+# instead of RSS
+SSTATE_SCAN_FILES:append = " *.cmake"
+
+FILES:${PN} += "\
+ ${libdir}/openvino-${PV}/lib*${SOLIBSDEV} \
+ ${libdir}/openvino-${PV}/plugins.xml \
+ ${libdir}/openvino-${PV}/cache.json \
+ "
+
+# Move inference engine samples into a separate package
+PACKAGES =+ "${PN}-samples"
+
+FILES:${PN}-samples = "${datadir}/openvino \
+ ${bindir} \
+ ${libdir}/libformat_reader.a \
+ ${libdir}/libopencv_c_wrapper.a \
+ "
+RDEPENDS:${PN}-samples += "python3-core"
+
+# Package for inference engine python API
+PACKAGES =+ "${PN}-python3"
+
+FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$"
diff --git a/lib/oeqa/runtime/cases/jhi.py b/lib/oeqa/runtime/cases/jhi.py
deleted file mode 100644
index 7a24b6da..00000000
--- a/lib/oeqa/runtime/cases/jhi.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import os
-from oeqa.runtime.decorator.package import OEHasPackage
-from oeqa.runtime.case import OERuntimeTestCase
-from oeqa.core.decorator.depends import OETestDepends
-
-class JhiTest(OERuntimeTestCase):
-
- @classmethod
- def tearDownClass(cls):
- _, output = cls.tc.target.run('pidof jhid')
- cls.tc.target.run('kill %s' % output)
-
- @OEHasPackage(['openssh-sshd'])
- @OEHasPackage(['jhi'])
- def test_jhi_mei_driver(self):
- command = 'ls /dev/mei*'
- (status, output) = self.target.run(command)
- self.assertEqual(status, 0, msg="Error messages: %s" % output)
-
- @OETestDepends(['jhi.JhiTest.test_jhi_mei_driver'])
- def test_jhi_daemon_version(self):
- command = 'jhid -v'
- (status, output) = self.target.run(command)
- self.assertEqual(status, 0, msg="Error messages: %s" % output)
-
- @OETestDepends(['jhi.JhiTest.test_jhi_mei_driver'])
- def test_jhi_daemon_can_initialized(self):
- command = 'jhid -d'
- (status, output) = self.target.run(command)
- self.assertEqual(status, 0, msg="Error messages: %s" % output)
-
- @OEHasPackage(['jhi-test'])
- @OETestDepends(['jhi.JhiTest.test_jhi_daemon_can_initialized'])
- def test_jhi_bist(self):
- (status, output) = self.target.run('uname -m')
- self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
- if 'x86_64' not in output:
- self.skipTest("Skipped jhi bist test if not x86_64 machine (current machine: %s)." % output)
- command = 'bist'
- (status, output) = self.target.run(command)
- self.assertEqual(status, 0, msg="Error messages: %s" % output)
diff --git a/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt b/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt
new file mode 100644
index 00000000..84ce8168
--- /dev/null
+++ b/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt
@@ -0,0 +1,9 @@
+# These should be reviewed to see if they are still needed
+ACPI: No _BQC method, cannot determine initial brightness
+[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
+(EE) Failed to load module "psb"
+(EE) Failed to load module "psbdrv"
+(EE) open /dev/fb0: No such file or directory
+(EE) AIGLX: reverting to software rendering
+dmi: Firmware registration failed.
+ioremap error for 0x78
diff --git a/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt b/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt
new file mode 100644
index 00000000..5c9b4bc7
--- /dev/null
+++ b/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt
@@ -0,0 +1,14 @@
+# These should be reviewed to see if they are still needed
+can't set Max Payload Size to 256
+intel_punit_ipc: can't request region for resource
+[drm] parse error at position 4 in video mode 'efifb'
+ACPI Error: Could not enable RealTimeClock event
+ACPI Warning: Could not enable fixed event - RealTimeClock
+hci_intel INT33E1:00: Unable to retrieve gpio
+hci_intel: probe of INT33E1:00 failed
+can't derive routing for PCI INT A
+failed to read out thermal zone
+Bluetooth: hci0: Setting Intel event mask failed
+ttyS2 - failed to request DMA
+Bluetooth: hci0: Failed to send firmware data (-38)
+atkbd serio0: Failed to enable keyboard on isa0060/serio0
diff --git a/recipes-bsp/formfactor/formfactor_0.0.bbappend b/recipes-bsp/formfactor/formfactor_0.0.bbappend
index 6dd422ae..d21c3bee 100644
--- a/recipes-bsp/formfactor/formfactor_0.0.bbappend
+++ b/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/${PN}:"
+FILESEXTRAPATHS:prepend:intel-x86-common := "${THISDIR}/${PN}:"
diff --git a/recipes-bsp/intel-cmt-cat/intel-cmt-cat_23.11.1.bb b/recipes-bsp/intel-cmt-cat/intel-cmt-cat_23.11.1.bb
new file mode 100644
index 00000000..60d0dfd2
--- /dev/null
+++ b/recipes-bsp/intel-cmt-cat/intel-cmt-cat_23.11.1.bb
@@ -0,0 +1,29 @@
+SUMMARY = "intel-cmt-cat"
+DESCRIPTION = "Software package which provides basic support for Intel(R) \
+Resource Director Technology (Intel(R) RDT)"
+HOMEPAGE = "https://github.com/intel/intel-cmt-cat"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4b63c65942e1c16fd897f8cd20abebf8"
+
+SRC_URI = "git://github.com/intel/intel-cmt-cat;protocol=https;branch=master"
+SRCREV = "b26b31b0ae6980c5939a421cefe0316cae884626"
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
+
+do_install() {
+ oe_runmake install PREFIX=${D}${prefix} NOLDCONFIG=y
+}
+
+FILES:${PN} += "${nonarch_libdir}/libpqos*"
+FILES:${PN}-doc = "/usr/man*"
+
+INSANE_SKIP:${PN} += "ldflags"
+INSANE_SKIP:${PN} += "dev-so"
+INSANE_SKIP:${PN} += "libdir"
+INSANE_SKIP:${PN} += "already-stripped"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
diff --git a/recipes-bsp/metee/metee_3.0.0.bb b/recipes-bsp/metee/metee_3.2.4.bb
index 0f970a87..da8220b9 100644
--- a/recipes-bsp/metee/metee_3.0.0.bb
+++ b/recipes-bsp/metee/metee_3.2.4.bb
@@ -10,8 +10,9 @@ COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
inherit cmake
-SRC_URI = "git://github.com/intel/metee.git"
-SRCREV = "92e1597181d7faec3196847a4bf35ea1f881383f"
+SRC_URI = "git://github.com/intel/metee.git;branch=master;protocol=https \
+"
+SRCREV = "db45e37e146fd9c06907a15ade55eba06ad1f951"
S = "${WORKDIR}/git"
diff --git a/recipes-core/images/core-image-minimal-initramfs.bbappend b/recipes-core/images/core-image-minimal-initramfs.bbappend
index 132f15b5..90ac28fd 100644
--- a/recipes-core/images/core-image-minimal-initramfs.bbappend
+++ b/recipes-core/images/core-image-minimal-initramfs.bbappend
@@ -1,2 +1,2 @@
# Add i915 graphics firmware
-PACKAGE_INSTALL_append_intel-x86-common = " linux-firmware-i915"
+PACKAGE_INSTALL:append:intel-x86-common = " linux-firmware-i915"
diff --git a/recipes-core/images/core-image-tiny.bb b/recipes-core/images/core-image-tiny.bb
index 6b09b0c2..f521f668 100644
--- a/recipes-core/images/core-image-tiny.bb
+++ b/recipes-core/images/core-image-tiny.bb
@@ -32,5 +32,5 @@ python() {
d.appendVarFlag('do_image', 'depends', ' %s:do_image_complete' % initrd_i)
}
-WKS_FILE_intel-corei7-64 = "core-image-tiny.wks.in"
-WKS_FILE_intel-core2-32 = "core-image-tiny.wks.in"
+WKS_FILE:intel-corei7-64 = "core-image-tiny.wks.in"
+WKS_FILE:intel-core2-32 = "core-image-tiny.wks.in"
diff --git a/recipes-core/libxcam/libxcam/0001-fake_v4l2_device.h-fix-narrowing-warning.patch b/recipes-core/libxcam/libxcam/0001-fake_v4l2_device.h-fix-narrowing-warning.patch
new file mode 100644
index 00000000..f15d5cc7
--- /dev/null
+++ b/recipes-core/libxcam/libxcam/0001-fake_v4l2_device.h-fix-narrowing-warning.patch
@@ -0,0 +1,94 @@
+From d4c97b50b577ea16b9ff6d9a352ab474a119310e Mon Sep 17 00:00:00 2001
+From: Naveen Saini <naveen.kumar.saini@intel.com>
+Date: Wed, 18 May 2022 15:41:24 +0800
+Subject: [PATCH] fake_v4l2_device.h: fix narrowing warning
+
+Use uint32_t instead of int for IOCTLs commands.
+
+Warning log:
+| ../../../git/xcore/fake_v4l2_device.h: In member function 'virtual int XCam::FakeV4l2Device::io_control(int, void*)':
+| ../../../git/xcore/fake_v4l2_device.h:42:14: error: narrowing conversion of '3225441794' from 'long unsigned int' to 'int' [-Wnarrowing]
+| 42 | case VIDIOC_ENUM_FMT:
+| | ^~~~~~~~~~~~~~~
+| make[4]: *** [Makefile:685: libgstxcamsrc_la-gstxcamsrc.lo] Error 1
+
+Issue: https://github.com/intel/libxcam/issues/801
+Upstream-Status: Submitted [https://github.com/intel/libxcam/pull/802]
+
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ xcore/base/xcam_common.h | 2 +-
+ xcore/fake_v4l2_device.h | 2 +-
+ xcore/v4l2_device.cpp | 2 +-
+ xcore/v4l2_device.h | 2 +-
+ xcore/xcam_common.cpp | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/xcore/base/xcam_common.h b/xcore/base/xcam_common.h
+index 1f16e1e..4aa6cb9 100644
+--- a/xcore/base/xcam_common.h
++++ b/xcore/base/xcam_common.h
+@@ -75,7 +75,7 @@ void xcam_free (void *ptr);
+ * return, 0 successfully
+ * else, check errno
+ */
+-int xcam_device_ioctl (int fd, int cmd, void *arg);
++int xcam_device_ioctl (int fd, uint32_t cmd, void *arg);
+ const char *xcam_fourcc_to_string (uint32_t fourcc);
+
+ void xcam_set_log (const char* file_name);
+diff --git a/xcore/fake_v4l2_device.h b/xcore/fake_v4l2_device.h
+index f679c19..e29787d 100644
+--- a/xcore/fake_v4l2_device.h
++++ b/xcore/fake_v4l2_device.h
+@@ -33,7 +33,7 @@ public:
+ : V4l2Device ("/dev/null")
+ {}
+
+- int io_control (int cmd, void *arg)
++ int io_control (uint32_t cmd, void *arg)
+ {
+ XCAM_UNUSED (arg);
+
+diff --git a/xcore/v4l2_device.cpp b/xcore/v4l2_device.cpp
+index 395461e..66a8ac6 100644
+--- a/xcore/v4l2_device.cpp
++++ b/xcore/v4l2_device.cpp
+@@ -185,7 +185,7 @@ V4l2Device::close ()
+ }
+
+ int
+-V4l2Device::io_control (int cmd, void *arg)
++V4l2Device::io_control (uint32_t cmd, void *arg)
+
+ {
+ if (_fd <= 0)
+diff --git a/xcore/v4l2_device.h b/xcore/v4l2_device.h
+index b4ad7ad..2551a92 100644
+--- a/xcore/v4l2_device.h
++++ b/xcore/v4l2_device.h
+@@ -104,7 +104,7 @@ public:
+ XCamReturn queue_buffer (SmartPtr<V4l2Buffer> &buf);
+
+ // use as less as possible
+- virtual int io_control (int cmd, void *arg);
++ virtual int io_control (uint32_t cmd, void *arg);
+
+ protected:
+
+diff --git a/xcore/xcam_common.cpp b/xcore/xcam_common.cpp
+index 848884d..d4d5093 100644
+--- a/xcore/xcam_common.cpp
++++ b/xcore/xcam_common.cpp
+@@ -53,7 +53,7 @@ void xcam_free(void *ptr)
+ free (ptr);
+ }
+
+-int xcam_device_ioctl (int fd, int cmd, void *arg)
++int xcam_device_ioctl (int fd, uint32_t cmd, void *arg)
+ {
+ int ret = 0;
+ int tried_time = 0;
+--
+2.25.1
+
diff --git a/recipes-core/libxcam/libxcam_1.5.0.bb b/recipes-core/libxcam/libxcam_1.5.0.bb
index fcd14bd4..31e9344b 100644
--- a/recipes-core/libxcam/libxcam_1.5.0.bb
+++ b/recipes-core/libxcam/libxcam_1.5.0.bb
@@ -8,10 +8,11 @@ inherit autotools pkgconfig
S = "${WORKDIR}/git"
SRCREV = "231a1d5243cd45c7a6b511b667f1ec52178fdda8"
-SRC_URI = "git://github.com/intel/libxcam.git;branch=1.5.0; \
+SRC_URI = "git://github.com/intel/libxcam.git;branch=1.5.0;protocol=https \
+ file://0001-fake_v4l2_device.h-fix-narrowing-warning.patch \
"
-COMPATIBLE_HOST_libc-musl = "null"
+COMPATIBLE_HOST:libc-musl = "null"
PACKAGECONFIG ??= " gst \
${@bb.utils.contains("DISTRO_FEATURES", "opengl", "gles", "", d)} \
@@ -27,12 +28,12 @@ PACKAGECONFIG[gles] = "--enable-gles, --disable-gles, virtual/mesa"
PACKAGECONFIG[vulkan] = "--enable-vulkan, --disable-vulkan, vulkan-loader virtual/mesa"
PACKAGECONFIG[dnn] = "--enable-dnn, --disable-dnn,"
-do_install_append () {
+do_install:append () {
install -d ${D}${bindir}/libxcam
cp -r ${WORKDIR}/build/tests/.libs/* ${D}${bindir}/libxcam/
}
-FILES_${PN} += "${libdir}/gstreamer-*/*.so"
-FILES_${PN}-test = "${bindir}/libxcam/*"
+FILES:${PN} += "${libdir}/gstreamer-*/*.so"
+FILES:${PN}-test = "${bindir}/libxcam/*"
PACKAGES =+ "${PN}-test"
-RDEPENDS_${PN}-test =+ "bash"
+RDEPENDS:${PN}-test =+ "bash"
diff --git a/recipes-core/meta/icx-environment.inc b/recipes-core/meta/icx-environment.inc
new file mode 100644
index 00000000..65322a91
--- /dev/null
+++ b/recipes-core/meta/icx-environment.inc
@@ -0,0 +1,15 @@
+export ICX_LDFLAGS_OPTION = " -Wl,-dynamic-linker,/lib/ld-linux-x86-64.so.2"
+export ICXSDK_PREFIX_OPTION = "-B ${TARGET_PREFIX}"
+export ICXQSDK_PREFIX_OPTION = "-qgnu-prefix=${TARGET_PREFIX}"
+
+create_sdk_files:append() {
+ script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+ if ${@bb.utils.contains('ICXSDK', '1', 'true', 'false', d)}; then
+ echo 'export ICX="icx ${ICXSDK_PREFIX_OPTION} --target=${TARGET_SYS} ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT ${ICX_LDFLAGS_OPTION}"' >> $script
+ echo 'export ICXCXX="icpx ${ICXSDK_PREFIX_OPTION} --target=${TARGET_SYS} ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT ${ICX_LDFLAGS_OPTION}"' >> $script
+ echo 'export ICXCPP="icx ${ICXSDK_PREFIX_OPTION} -E --target=${TARGET_SYS} ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT ${ICX_LDFLAGS_OPTION}"' >> $script
+ echo 'export ICXLD="xild --sysroot=$SDKTARGETSYSROOT "' >> $script
+ echo 'export ICXCCLD="icx ${ICXSDK_PREFIX_OPTION} --sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export ICXAR="xiar ${ICXQSDK_PREFIX_OPTION}"' >> $script
+ fi
+}
diff --git a/recipes-core/meta/meta-environment-extsdk.bbappend b/recipes-core/meta/meta-environment-extsdk.bbappend
new file mode 100644
index 00000000..2cff6fc4
--- /dev/null
+++ b/recipes-core/meta/meta-environment-extsdk.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+require ${@bb.utils.contains('ICXSDK', '1', 'icx-environment.inc', '', d)}
diff --git a/recipes-core/meta/meta-environment.bbappend b/recipes-core/meta/meta-environment.bbappend
new file mode 100644
index 00000000..2cff6fc4
--- /dev/null
+++ b/recipes-core/meta/meta-environment.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+require ${@bb.utils.contains('ICXSDK', '1', 'icx-environment.inc', '', d)}
diff --git a/recipes-core/microcode/intel-microcode_20210216.bb b/recipes-core/microcode/intel-microcode_20240312.bb
index 69c8f08c..00b18231 100644
--- a/recipes-core/microcode/intel-microcode_20210216.bb
+++ b/recipes-core/microcode/intel-microcode_20240312.bb
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://license;md5=d8405101ec6e90c1d84b082b0c40c721"
SRC_URI = "git://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git;protocol=https;branch=main \
"
-SRCREV = "4c5f3fdcc7f5d2b6c1bcc11001ed58923db481ab"
+SRCREV = "41af34500598418150aa298bb04e7edacc547897"
DEPENDS = "iucode-tool-native"
S = "${WORKDIR}/git"
@@ -34,12 +34,6 @@ do_compile() {
${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
${UCODE_FILTER_PARAMETERS} \
--overwrite \
- --write-to=${WORKDIR}/microcode_${PV}.bin \
- ${S}/intel-ucode/* ${S}/intel-ucode-with-caveats/*
-
- ${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
- ${UCODE_FILTER_PARAMETERS} \
- --overwrite \
--write-earlyfw=${WORKDIR}/microcode_${PV}.cpio \
${S}/intel-ucode/* ${S}/intel-ucode-with-caveats/*
}
@@ -47,6 +41,7 @@ do_compile() {
do_install() {
install -d ${D}${nonarch_base_libdir}/firmware/intel-ucode/
${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
+ ${UCODE_FILTER_PARAMETERS} \
--write-firmware=${D}${nonarch_base_libdir}/firmware/intel-ucode \
${S}/intel-ucode/* ${S}/intel-ucode-with-caveats/*
}
@@ -63,6 +58,6 @@ addtask deploy before do_build after do_compile
PACKAGES = "${PN}"
-FILES_${PN} = "${nonarch_base_libdir}"
+FILES:${PN} = "${nonarch_base_libdir}"
UPSTREAM_CHECK_GITTAGREGEX = "^microcode-(?P<pver>(\d+)[a-z]*)$"
diff --git a/recipes-core/microcode/iucode-tool_2.3.1.bb b/recipes-core/microcode/iucode-tool_2.3.1.bb
index df74a8e9..19417b7c 100644
--- a/recipes-core/microcode/iucode-tool_2.3.1.bb
+++ b/recipes-core/microcode/iucode-tool_2.3.1.bb
@@ -12,14 +12,14 @@ DESCRIPTION = "iucode_tool is a program to manipulate Intel i686 and X86-64\
HOMEPAGE = "https://gitlab.com/iucode-tool/"
BUGTRACKER = "https://bugs.debian.org/cgi-bin/pkgreport.cgi?ordering=normal;archive=0;src=iucode-tool;repeatmerged=0"
-LICENSE = "GPLv2+"
+LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://iucode_tool.c;beginline=1;endline=15;md5=71eeab3190360ff0267101b570874756"
-DEPENDS_append_libc-musl = " argp-standalone"
+DEPENDS:append:libc-musl = " argp-standalone"
SRC_URI = "https://gitlab.com/iucode-tool/releases/raw/master/iucode-tool_${PV}.tar.xz"
-SRC_URI_append_libc-musl = " file://0001-Makefile.am-Add-arg-parse-library-for-MUSL-support.patch"
+SRC_URI:append:libc-musl = " file://0001-Makefile.am-Add-arg-parse-library-for-MUSL-support.patch"
SRC_URI[md5sum] = "63b33cc0ea1f8c73b443412abbf39d6f"
SRC_URI[sha256sum] = "12b88efa4d0d95af08db05a50b3dcb217c0eb2bfc67b483779e33d498ddb2f95"
diff --git a/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch b/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
index c13363d2..7eb3bc69 100644
--- a/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
+++ b/recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
@@ -1,6 +1,6 @@
-From 149b34de80e7f9f5331c285b862776cdd4b02ee3 Mon Sep 17 00:00:00 2001
+From b2099e7184d48a6d05c8713b6fd5dac0e2e70963 Mon Sep 17 00:00:00 2001
From: Mikko Ylinen <mikko.ylinen@linux.intel.com>
-Date: Fri, 7 Apr 2017 12:06:14 +0300
+Date: Wed, 2 Mar 2022 10:55:35 +0800
Subject: [PATCH] ovmf: RefkitTestCA: TEST UEFI SecureBoot
This patch adds refkit-db.cer (via xxd -i) in OVMF's db
@@ -9,25 +9,23 @@ application. It's used for testing purposes only.
Images signed with refkit-db keys are allowed to boot.
-Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
-
-[ Change location of key to AuthData.c ]
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+Upstream-Status: Inappropriate
-%% original patch: 0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch
+Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
- OvmfPkg/EnrollDefaultKeys/AuthData.c | 68 +++++++++++++++++++
- OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 1 +
+ OvmfPkg/EnrollDefaultKeys/AuthData.c | 69 +++++++++++++++++++
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 3 +
OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h | 2 +
- 3 files changed, 71 insertions(+)
+ 3 files changed, 74 insertions(+)
diff --git a/OvmfPkg/EnrollDefaultKeys/AuthData.c b/OvmfPkg/EnrollDefaultKeys/AuthData.c
-index 3b4856a01f..7109766296 100644
+index 53ee7f7003..127131cd05 100644
--- a/OvmfPkg/EnrollDefaultKeys/AuthData.c
+++ b/OvmfPkg/EnrollDefaultKeys/AuthData.c
-@@ -398,6 +398,74 @@ CONST UINT8 mMicrosoftUefiCa[] = {
+@@ -395,6 +395,75 @@ CONST UINT8 mMicrosoftUefiCa[] = {
- CONST UINTN mSizeOfMicrosoftUefiCa = sizeof mMicrosoftUefiCa;
+ CONST UINTN mSizeOfMicrosoftUefiCa = sizeof mMicrosoftUefiCa;
+CONST UINT8 mRefkitTestCA[] = {
+ 0x30, 0x82, 0x02, 0xfb, 0x30, 0x82, 0x01, 0xe3, 0xa0, 0x03, 0x02, 0x01,
@@ -97,32 +95,35 @@ index 3b4856a01f..7109766296 100644
+};
+
+CONST UINTN mSizeOfRefkitTestCA = sizeof mRefkitTestCA;
-
++
//
// The Microsoft.UefiSecureBootLogo.Tests.OutOfBoxConfirmDBXisPresent test case
+ // of the Secure Boot Logo Test in the Microsoft Hardware Certification Kit
diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
-index f45cb799f7..fb1252e768 100644
+index 094e4c821b..0a7eef54dc 100644
--- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
-@@ -615,6 +615,7 @@ ShellAppMain (
- &gEfiCertX509Guid,
- mMicrosoftPca, mSizeOfMicrosoftPca, &gMicrosoftVendorGuid,
- mMicrosoftUefiCa, mSizeOfMicrosoftUefiCa, &gMicrosoftVendorGuid,
-+ mRefkitTestCA, mSizeOfRefkitTestCA, &gEfiCallerIdGuid,
- NULL);
+@@ -702,6 +702,9 @@ ShellAppMain (
+ mMicrosoftUefiCa,
+ mSizeOfMicrosoftUefiCa,
+ &gMicrosoftVendorGuid,
++ mRefkitTestCA,
++ mSizeOfRefkitTestCA,
++ &gEfiCallerIdGuid,
+ NULL
+ );
}
- if (EFI_ERROR (Status)) {
diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h
-index 8e61f0a77b..e3fa046f95 100644
+index 56da9c71d6..8de1dfe4e0 100644
--- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h
+++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h
-@@ -135,4 +135,6 @@ extern CONST UINTN mSizeOfMicrosoftUefiCa;
- extern CONST UINT8 mSha256OfDevNull[];
- extern CONST UINTN mSizeOfSha256OfDevNull;
+@@ -133,4 +133,6 @@ extern CONST UINTN mSizeOfMicrosoftUefiCa;
+ extern CONST UINT8 mSha256OfDevNull[];
+ extern CONST UINTN mSizeOfSha256OfDevNull;
+extern CONST UINT8 mRefkitTestCA[];
+extern CONST UINTN mSizeOfRefkitTestCA;
#endif /* ENROLL_DEFAULT_KEYS_H_ */
--
-2.21.0
+2.17.1
diff --git a/recipes-core/ovmf/ovmf-shell-image-enrollkeys.bb b/recipes-core/ovmf/ovmf-shell-image-enrollkeys.bb
index b20f6e58..ca3cfc15 100644
--- a/recipes-core/ovmf/ovmf-shell-image-enrollkeys.bb
+++ b/recipes-core/ovmf/ovmf-shell-image-enrollkeys.bb
@@ -1,10 +1,10 @@
require recipes-core/ovmf/ovmf-shell-image.bb
-WKS_SEARCH_PATH_append = ":${COREBASE}/meta/recipes-core/ovmf"
+WKS_SEARCH_PATH:append = ":${COREBASE}/meta/recipes-core/ovmf"
QB_DRIVE_TYPE = "/dev/vd"
-do_image_append() {
+do_image:append() {
cat > ${IMAGE_ROOTFS}/startup.nsh << EOF
EnrollDefaultKeys
reset
diff --git a/recipes-core/ovmf/ovmf_%.bbappend b/recipes-core/ovmf/ovmf_%.bbappend
index bbf5fa32..34a9dd1b 100644
--- a/recipes-core/ovmf/ovmf_%.bbappend
+++ b/recipes-core/ovmf/ovmf_%.bbappend
@@ -1,6 +1,6 @@
-FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:"
+FILESEXTRAPATHS:prepend:intel-x86-common := "${THISDIR}/files:"
-SRC_URI_append_intel-x86-common = " \
+SRC_URI:append:intel-x86-common = " \
file://0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch \
"
-PACKAGECONFIG_append_intel-x86-common = " secureboot"
+PACKAGECONFIG:append:intel-x86-common = " secureboot"
diff --git a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
new file mode 100644
index 00000000..b5a5fdd4
--- /dev/null
+++ b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
@@ -0,0 +1 @@
+RDEPENDS:${PN} += "${@bb.utils.contains('ICXSDK', '1', ' intel-oneapi-dpcpp-cpp intel-oneapi-dpcpp-cpp-dev intel-oneapi-dpcpp-cpp-runtime intel-oneapi-dpcpp-cpp-runtime-dev ', '', d)}"
diff --git a/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend
new file mode 100644
index 00000000..608ea3d3
--- /dev/null
+++ b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend
@@ -0,0 +1 @@
+RRECOMMENDS:${PN}:append:intel-x86-common = "${@bb.utils.contains('ICXSDK', '1', ' intel-oneapi-dpcpp-cpp intel-oneapi-dpcpp-cpp-dev intel-oneapi-dpcpp-cpp-runtime intel-oneapi-dpcpp-cpp-runtime-dev ', '', d)}"
diff --git a/recipes-core/zlib/zlib-intel_1.2.11.1.jtkv6.3.bb b/recipes-core/zlib/zlib-intel_1.2.11.1.jtkv6.3.bb
deleted file mode 100644
index 65303bff..00000000
--- a/recipes-core/zlib/zlib-intel_1.2.11.1.jtkv6.3.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require recipes-core/zlib/zlib_1.2.11.bb
-
-FILESEXTRAPATHS_append = ":${COREBASE}/meta/recipes-core/zlib/zlib"
-
-SUMMARY = "Zlib Compression Library (Intel-tuned)"
-
-PROVIDES = "zlib"
-
-SRC_URI_remove = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz"
-SRC_URI_prepend = "git://github.com/jtkukunas/zlib.git;protocol=git "
-
-SRCREV = "a43a247bfa16ec5368747b5b64f11ea5ca033010"
-S = "${WORKDIR}/git"
-
-RPROVIDES_${PN} += "zlib"
-RPROVIDES_${PN}-ptest += "zlib-ptest"
-
-UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+)_jtkv(\d+(\.\d+)+))$"
diff --git a/recipes-devtools/slimboot/slimboot-tools_git.bb b/recipes-devtools/slimboot/slimboot-tools_git.bb
index 7d8b66be..b65b182d 100644
--- a/recipes-devtools/slimboot/slimboot-tools_git.bb
+++ b/recipes-devtools/slimboot/slimboot-tools_git.bb
@@ -4,11 +4,11 @@ binary file format understood by Slim Bootloader to load and initialize\
Operating Systems or Hypervisors."
HOMEPAGE = "https://slimbootloader.github.io/tools/index.html"
-SRC_URI = "git://github.com/slimbootloader/slimbootloader;protocol=https"
-SRCREV = "9f146afd47e0ca204521826a583d55388850b216"
+SRC_URI = "git://github.com/slimbootloader/slimbootloader;protocol=https;branch=master"
+SRCREV = "df5bd0bc2a522afcb8945a6797592b04838db753"
PV = "0.0.0+git${SRCPV}"
LICENSE = "BSD-2-Clause-Patent"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d1ed89007e7aa232a4dc1c59b6c9efc4"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef7fba7be2819ac13aaf5d0f842ce5d9"
S = "${WORKDIR}/git"
inherit python3native
diff --git a/recipes-graphics/gmmlib/files/0001-Add-new-DG2-device-IDs-194.patch b/recipes-graphics/gmmlib/files/0001-Add-new-DG2-device-IDs-194.patch
new file mode 100644
index 00000000..21cffe24
--- /dev/null
+++ b/recipes-graphics/gmmlib/files/0001-Add-new-DG2-device-IDs-194.patch
@@ -0,0 +1,38 @@
+From 8729d66800995a9b7e693bd78249932bd12383e1 Mon Sep 17 00:00:00 2001
+From: John Machado <john.machado@intel.com>
+Date: Mon, 25 Mar 2024 11:13:27 +0530
+Subject: [PATCH] Add new DG2 device IDs (#194)
+
+Upstream-status: Backport
+https://github.com/intel/gmmlib/commit/dcc4b85ea3728c848b62fbb164c00f43b519b6fb
+
+Signed-off-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com>
+---
+ Source/inc/common/igfxfmid.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Source/inc/common/igfxfmid.h b/Source/inc/common/igfxfmid.h
+index 7969779..8e2c955 100644
+--- a/Source/inc/common/igfxfmid.h
++++ b/Source/inc/common/igfxfmid.h
+@@ -1932,6 +1932,8 @@ typedef enum __NATIVEGTTYPE
+ #define DEV_ID_56BB 0x56BB
+ #define DEV_ID_56BC 0x56BC
+ #define DEV_ID_56BD 0x56BD
++#define DEV_ID_56BE 0x56BE
++#define DEV_ID_56BF 0x56BF
+ #define DEV_ID_56C0 0x56C0
+ #define DEV_ID_56C1 0x56C1
+
+@@ -1992,6 +1994,8 @@ typedef enum __NATIVEGTTYPE
+ ( d == DEV_ID_5690 ) || \
+ ( d == DEV_ID_5691 ) || \
+ ( d == DEV_ID_5692 ) || \
++ ( d == DEV_ID_56BE ) || \
++ ( d == DEV_ID_56BF ) || \
+ ( d == DEV_ID_56C0 ) || \
+ ( d == DEV_ID_4F80 ) || \
+ ( d == DEV_ID_4F81 ) || \
+--
+2.34.1
+
diff --git a/recipes-graphics/gmmlib/files/0001-Introduce-ARL-H-support-172.patch b/recipes-graphics/gmmlib/files/0001-Introduce-ARL-H-support-172.patch
new file mode 100644
index 00000000..ab4cb178
--- /dev/null
+++ b/recipes-graphics/gmmlib/files/0001-Introduce-ARL-H-support-172.patch
@@ -0,0 +1,42 @@
+From 2b267b72d6aaa922861b120da9c1543161797046 Mon Sep 17 00:00:00 2001
+From: John Machado <john.machado@intel.com>
+Date: Fri, 9 Feb 2024 13:10:18 +0530
+Subject: [PATCH] Introduce ARL-H support (#172)
+
+Upstream-Status: Backport [https://github.com/intel/gmmlib/commit/544a8be6f66631e085c86c453aafd78b0e7f5179]
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ Source/inc/common/igfxfmid.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/Source/inc/common/igfxfmid.h b/Source/inc/common/igfxfmid.h
+index 99fc624..19aa505 100644
+--- a/Source/inc/common/igfxfmid.h
++++ b/Source/inc/common/igfxfmid.h
+@@ -1966,6 +1966,11 @@ typedef enum __NATIVEGTTYPE
+ // ARL-S
+ #define DEV_ID_7D67 0x7D67
+
++// ARL-H
++#define DEV_ID_7D41 0x7D41
++#define DEV_ID_7D51 0x7D51
++#define DEV_ID_7DD1 0x7DD1
++
+ #define MGM_HAS 0
+
+ //#define SDG_HAS 1 //Reserve place for Springdale-G HAS
+@@ -2012,6 +2017,11 @@ typedef enum __NATIVEGTTYPE
+ // Macro to identify ARL-S Device ID
+ #define GFX_IS_ARL_S(d) ( ( d == DEV_ID_7D67 ) )
+
++// Macro to identify ARL-H Device ID
++#define GFX_IS_ARL_H(d) ( ( d == DEV_ID_7D41 ) || \
++ ( d == DEV_ID_7D51 ) || \
++ ( d == DEV_ID_7DD1 ))
++
+ //we define the highest cap and lower cap of stepping IDs
+ #define SI_REV_ID(lo,hi) (lo | hi<<16)
+
+--
+2.40.1
+
diff --git a/recipes-graphics/gmmlib/gmmlib_21.1.1.bb b/recipes-graphics/gmmlib/gmmlib_22.3.15.bb
index f5de0ef5..875fbaf5 100644
--- a/recipes-graphics/gmmlib/gmmlib_21.1.1.bb
+++ b/recipes-graphics/gmmlib/gmmlib_22.3.15.bb
@@ -4,17 +4,19 @@ device specific and buffer management for the Intel(R) Graphics \
Compute Runtime for OpenCL(TM) and the Intel(R) Media Driver for VAAPI."
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.md;md5=d9a6e772cd4c362ee4c8ef87c5aad843"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=465fe90caea3edd6a2cecb3f0c28a654"
SRC_URI = " \
- git://github.com/intel/gmmlib.git;protocol=https \
+ git://github.com/intel/gmmlib.git;protocol=https;branch=master \
+ file://0001-Introduce-ARL-H-support-172.patch \
+ file://0001-Add-new-DG2-device-IDs-194.patch \
"
-SRCREV = "60a77187c43ff23a0888b2f297ae5c93cc50a666"
+SRCREV = "5fb4180e22695ad4e3c155cf680119913c9f44bc"
S = "${WORKDIR}/git"
-COMPATIBLE_HOST_x86-x32 = "null"
+COMPATIBLE_HOST:x86-x32 = "null"
UPSTREAM_CHECK_GITTAGREGEX = "^intel-gmmlib-(?P<pver>(\d+(\.\d+)+))$"
diff --git a/recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch b/recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch
index f07d466f..6d32da43 100644
--- a/recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch
+++ b/recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch
@@ -9,7 +9,7 @@ exits, which causing hdcpd service failure.
Added wait function to block parent process
until child process exits.
-Upstream-Status: Submitted[https://github.com/intel/hdcp/pull/17]
+Upstream-Status: Submitted [https://github.com/intel/hdcp/pull/17]
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
diff --git a/recipes-graphics/hdcp/hdcp_20.4.0.bb b/recipes-graphics/hdcp/hdcp_21.2.0.bb
index 016e8e0a..8529b5ab 100644
--- a/recipes-graphics/hdcp/hdcp_20.4.0.bb
+++ b/recipes-graphics/hdcp/hdcp_21.2.0.bb
@@ -9,7 +9,7 @@ SECTION = "lib"
inherit pkgconfig cmake useradd systemd features_check
-SRC_URI = "git://github.com/intel/hdcp.git \
+SRC_URI = "git://github.com/intel/hdcp.git;branch=master;protocol=https \
file://0001-main-fix-hdcpd-service-failure.patch \
"
SRCREV = "cacc352159c5bdaf1c21846cecdd1eb7b031e1d3"
@@ -20,7 +20,7 @@ REQUIRED_DISTRO_FEATURES = "systemd"
DEPENDS = "libdrm virtual/mesa systemd"
USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --gid nogroup media"
+USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false --gid nogroup media"
-SYSTEMD_SERVICE_${PN} = "hdcpd.service"
+SYSTEMD_SERVICE:${PN} = "hdcpd.service"
SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/recipes-graphics/libva/libva-intel-utils_2.11.1.bb b/recipes-graphics/libva/libva-intel-utils_2.20.1.bb
index f9bea364..9c26f009 100644
--- a/recipes-graphics/libva/libva-intel-utils_2.11.1.bb
+++ b/recipes-graphics/libva/libva-intel-utils_2.20.1.bb
@@ -14,8 +14,8 @@ SECTION = "x11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=b148fc8adf19dc9aec17cf9cd29a9a5e"
-SRC_URI = "git://github.com/intel/libva-utils.git;branch=v2.11-branch"
-SRCREV = "959b2f20cf99d4611eab66164af3d7e4a84f674b"
+SRC_URI = "git://github.com/intel/libva-utils.git;branch=v2.20-branch;protocol=https"
+SRCREV = "2ad888bb463dc9bfb3deb512ec9faf78f1d3bfa8"
S = "${WORKDIR}/git"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
@@ -32,4 +32,4 @@ PACKAGECONFIG[x11] = "-Dx11=true, -Dx11=false,virtual/libx11 libxext libxfixes"
PACKAGECONFIG[wayland] = "-Dwayland=true, -Dwayland=false,wayland-native wayland"
PROVIDES = "libva-utils"
-RPROVIDES_${PN} += "libva-utils"
+RPROVIDES:${PN} += "libva-utils"
diff --git a/recipes-graphics/libva/libva-intel_2.11.0.bb b/recipes-graphics/libva/libva-intel_2.20.0.bb
index 406f6f68..c81ed65c 100644
--- a/recipes-graphics/libva/libva-intel_2.11.0.bb
+++ b/recipes-graphics/libva/libva-intel_2.20.0.bb
@@ -17,8 +17,9 @@ SECTION = "x11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=2e48940f94acb0af582e5ef03537800f"
-SRC_URI = "https://github.com/intel/libva/releases/download/${PV}/libva-${PV}.tar.bz2"
-SRC_URI[sha256sum] = "6e361117038b571ad4741d38c9280db8c140b17e76e8c01fc7a4d608d3ed7d5d"
+SRC_URI = "https://github.com/intel/libva/releases/download/${PV}/libva-${PV}.tar.bz2 \
+ "
+SRC_URI[sha256sum] = "f72bdb4f48dfe71ad01f1cbefe069672a2c949a6abd51cf3c4d4784210badc49"
S = "${WORKDIR}/libva-${PV}"
@@ -40,15 +41,15 @@ PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wa
PACKAGES =+ "${PN}-x11 ${PN}-glx ${PN}-wayland"
-RDEPENDS_${PN}-x11 =+ "${PN}"
-RDEPENDS_${PN}-glx =+ "${PN}-x11"
+RDEPENDS:${PN}-x11 =+ "${PN}"
+RDEPENDS:${PN}-glx =+ "${PN}-x11"
-FILES_${PN}-x11 =+ "${libdir}/libva-x11*${SOLIBS}"
-FILES_${PN}-glx =+ "${libdir}/libva-glx*${SOLIBS}"
-FILES_${PN}-wayland =+ "${libdir}/libva-wayland*${SOLIBS}"
+FILES:${PN}-x11 =+ "${libdir}/libva-x11*${SOLIBS}"
+FILES:${PN}-glx =+ "${libdir}/libva-glx*${SOLIBS}"
+FILES:${PN}-wayland =+ "${libdir}/libva-wayland*${SOLIBS}"
PROVIDES += "libva"
-RPROVIDES_${PN} += "libva"
-RPROVIDES_${PN}-x11 += "libva-x11"
-RPROVIDES_${PN}-glx += "libva-glx"
-RPROVIDES_${PN}-wayland += "libva-wayland"
+RPROVIDES:${PN} += "libva"
+RPROVIDES:${PN}-x11 += "libva-x11"
+RPROVIDES:${PN}-glx += "libva-glx"
+RPROVIDES:${PN}-wayland += "libva-wayland"
diff --git a/recipes-graphics/metrics-discovery/metrics-discovery/0001-md_internal.h-Replace-string.h-with-string-C-header-.patch b/recipes-graphics/metrics-discovery/metrics-discovery/0001-md_internal.h-Replace-string.h-with-string-C-header-.patch
deleted file mode 100644
index d97c6543..00000000
--- a/recipes-graphics/metrics-discovery/metrics-discovery/0001-md_internal.h-Replace-string.h-with-string-C-header-.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 8c11096a0e5cf980309692ae3e272108da5f2b4e Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 9 Oct 2019 11:36:56 -0700
-Subject: [PATCH] md_internal.h: Replace string.h with <string> C++ header API
-
-This helps in compiling with libc++/Clang
-Fixes
-usr/include/c++/v1/type_traits:1561:38: error: implicit instantiation of undefined template 'std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
-: public integral_constant<bool, __is_empty(_Tp)> {};
-^
-
-Upstream-Status: Submitted [https://github.com/intel/metrics-discovery/pull/14]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- instrumentation/metrics_discovery/common/md_internal.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/instrumentation/metrics_discovery/common/md_internal.cpp b/instrumentation/metrics_discovery/common/md_internal.cpp
-index f9571ac..0767e81 100644
---- a/instrumentation/metrics_discovery/common/md_internal.cpp
-+++ b/instrumentation/metrics_discovery/common/md_internal.cpp
-@@ -27,8 +27,8 @@
- \*****************************************************************************/
- #include "md_internal.h"
-
--#include <string.h>
- #include <stdlib.h>
-+#include <string>
- #include <new>
- #include <unordered_map>
-
---
-2.23.0
-
diff --git a/recipes-graphics/metrics-discovery/metrics-discovery_1.5.108.bb b/recipes-graphics/metrics-discovery/metrics-discovery_1.12.170.bb
index da7cb652..3ed1c9bd 100644
--- a/recipes-graphics/metrics-discovery/metrics-discovery_1.5.108.bb
+++ b/recipes-graphics/metrics-discovery/metrics-discovery_1.12.170.bb
@@ -8,9 +8,8 @@ SECTION = "lib"
inherit pkgconfig cmake
S = "${WORKDIR}/git"
-SRCREV = "a495db4682b7318bc82b1cccfb17fafdf2e3a2ff"
-SRC_URI = "git://github.com/intel/metrics-discovery.git \
- file://0001-md_internal.h-Replace-string.h-with-string-C-header-.patch \
+SRCREV = "75b292eb1309e4ea10dce403065ee8ca5bf29ecc"
+SRC_URI = "git://github.com/intel/metrics-discovery.git;branch=master;protocol=https \
"
EXTRA_OECMAKE += "-DMD_PLATFORM=linux"
diff --git a/recipes-graphics/xorg-driver/xf86-video-ast_1.1.5.bb b/recipes-graphics/xorg-driver/xf86-video-ast_1.1.6.bb
index 090efd62..d7e4eab4 100644
--- a/recipes-graphics/xorg-driver/xf86-video-ast_1.1.5.bb
+++ b/recipes-graphics/xorg-driver/xf86-video-ast_1.1.6.bb
@@ -7,6 +7,6 @@ DESCRIPTION = "ast is an Xorg driver for ASpeed Technologies video cards"
LIC_FILES_CHKSUM = "file://COPYING;md5=0b8c242f0218eea5caa949b7910a774b"
DEPENDS += "libpciaccess"
+XORG_DRIVER_COMPRESSOR = ".tar.gz"
-SRC_URI[md5sum] = "4f85febe48d51e53624550a96fc9e9ee"
-SRC_URI[sha256sum] = "1edbbc55d47d3fd71dec99b15c2483e22738c642623a0fb86ef4a81a9067a2de"
+SRC_URI[sha256sum] = "eeff52178ce2916a0e07b531bb23c8b105826b6e6e6c5f7c90e33f757827a7c7"
diff --git a/recipes-kernel/intel-ethernet/ixgbe_5.11.3.bb b/recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb
index 73b13c9b..7ef38650 100644
--- a/recipes-kernel/intel-ethernet/ixgbe_5.11.3.bb
+++ b/recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb
@@ -4,13 +4,13 @@ PCI Express* 10 Gigabit Network Connections."
HOMEPAGE = "https://sourceforge.net/projects/e1000/"
SECTION = "kernel/network"
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417"
SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/${PV}/${BP}.tar.gz \
"
-SRC_URI[sha256sum] = "b7e5de734c406d28ea146366a5cc3b58bb3b6be039977863e4e1b217a8185ae2"
+SRC_URI[sha256sum] = "a844f1fea8064e30b276792455c3b286c1d7af26731e8f865d4a4e9ed1dcf4ab"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbe%20stable/"
UPSTREAM_CHECK_REGEX = "ixgbe%20stable/(?P<pver>\d+(\.\d+)+)/"
@@ -19,14 +19,14 @@ CVE_PRODUCT = "linux:linux_kernel_ixgbe"
S = "${WORKDIR}/${BP}/src"
-EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"'
+EXTRA_OEMAKE=' KSRC="${STAGING_KERNEL_DIR}" KOBJ="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"'
-KERNEL_MODULE_AUTOLOAD_append_intel-core2-32 = " ixgbe"
-KERNEL_MODULE_AUTOLOAD_append_intel-corei7-64 = " ixgbe"
+KERNEL_MODULE_AUTOLOAD:append:intel-core2-32 = " ixgbe"
+KERNEL_MODULE_AUTOLOAD:append:intel-corei7-64 = " ixgbe"
inherit module
-do_install_append () {
+do_install:append () {
# Install scripts/set_irq_affinity
install -d ${D}${sysconfdir}/network
install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network
@@ -36,6 +36,8 @@ do_install_append () {
PACKAGES += "${PN}-script"
-FILES_${PN}-script += "${sysconfdir}/network/set_irq_affinity"
+FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity"
EXCLUDE_FROM_WORLD = "1"
+
+CVE_STATUS[CVE-2015-1142857] = "fixed-version: Fixed from version 4.4-rc1"
diff --git a/recipes-kernel/intel-ethernet/ixgbevf_4.11.1.bb b/recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb
index d1c5f299..b21796c6 100644
--- a/recipes-kernel/intel-ethernet/ixgbevf_4.11.1.bb
+++ b/recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb
@@ -7,13 +7,13 @@ The guest OS loading this driver must support MSI-X interrupts."
HOMEPAGE = "https://sourceforge.net/projects/e1000/"
SECTION = "kernel/network"
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${WORKDIR}/${BP}/COPYING;md5=a216b4192dc6b777b6f0db560e9a8417"
SRC_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/${PV}/${BP}.tar.gz \
"
-SRC_URI[sha256sum] = "0031d09a54af9ecf1216c185e4641e38527643afa09e78d1bd95752e49fe8985"
+SRC_URI[sha256sum] = "90f6cd614008839b6fc748ae0f4ad3503435f8b788318d4f40cfc83c7029025e"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/"
UPSTREAM_CHECK_REGEX = "ixgbevf%20stable/(?P<pver>\d+(\.\d+)+)/"
@@ -22,14 +22,14 @@ CVE_PRODUCT = "linux:linux_kernel_ixgbe"
S = "${WORKDIR}/${BP}/src"
-EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"'
+EXTRA_OEMAKE='KSRC="${STAGING_KERNEL_DIR}" KOBJ="${STAGING_KERNEL_BUILDDIR}" KVER="${KERNEL_VERSION}" INSTALL_MOD_PATH="${D}"'
-KERNEL_MODULE_AUTOLOAD_append_intel-core2-32 = " ixgbevf"
-KERNEL_MODULE_AUTOLOAD_append_intel-corei7-64 = " ixgbevf"
+KERNEL_MODULE_AUTOLOAD:append:intel-core2-32 = " ixgbevf"
+KERNEL_MODULE_AUTOLOAD:append:intel-corei7-64 = " ixgbevf"
inherit module
-do_install_append () {
+do_install:append () {
# Install scripts/set_irq_affinity
install -d ${D}${sysconfdir}/network
install -m 0755 ${S}/../scripts/set_irq_affinity ${D}${sysconfdir}/network
@@ -39,4 +39,8 @@ do_install_append () {
PACKAGES += "${PN}-script"
-FILES_${PN}-script += "${sysconfdir}/network/set_irq_affinity"
+FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity"
+
+CVE_STATUS[CVE-2015-1142857] = "fixed-version: Fixed from version 4.4-rc1"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb b/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb
index 9eb0a45d..ea36cfc3 100644
--- a/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb
+++ b/recipes-kernel/iwlwifi/backport-iwlwifi_git.bb
@@ -1,13 +1,13 @@
SUMMARY = "Intel Wireless LinuxCore kernel driver"
DESCRIPTION = "Intel Wireless LinuxCore kernel driver"
SECTION = "kernel"
-LICENSE = "GPL-2.0"
+LICENSE = "GPL-2.0-only"
REQUIRED_DISTRO_FEATURES = "wifi"
-LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
-inherit module
+inherit module features_check
# For some iwfwifi LinuxCore supported wireless chips, the best/latest
# firmware blobs are found in the iwlwifi's linux-firmware.git fork.
@@ -17,8 +17,8 @@ inherit module
# When updating this recipe, ensure that the proper firmware is included from
# either the linux-firmware or iwlwifi-firmware repos.
-PV = "45"
-SRCREV = "a75c1de6b3fa87885556c67619429cfa87cc048f"
+PV = "79"
+SRCREV = "574631d89d736fd2c76b0e2ea489270c50903e52"
SRC_URI = " \
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi;branch=release/core${PV} \
@@ -36,16 +36,18 @@ do_configure() {
MODULES_INSTALL_TARGET="install"
-do_install_append() {
+do_install:append() {
## install configs and service scripts
install -d ${D}${sysconfdir}/modprobe.d
install -m 0644 ${WORKDIR}/iwlwifi.conf ${D}${sysconfdir}/modprobe.d
}
-RDEPENDS_${PN} = "linux-firmware-iwlwifi"
+RDEPENDS:${PN} = "linux-firmware-iwlwifi"
-KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " iwlwifi"
-KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " iwlwifi"
+FILES:${PN} += "${sysconfdir}/modprobe.d/iwlwifi.conf"
+
+KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " iwlwifi"
+KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " iwlwifi"
KERNEL_MODULE_PACKAGE_PREFIX = "backport-iwlwifi"
diff --git a/recipes-kernel/linux/linux-intel-dev.bb b/recipes-kernel/linux/linux-intel-dev.bb
deleted file mode 100644
index f99b1f19..00000000
--- a/recipes-kernel/linux/linux-intel-dev.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-require recipes-kernel/linux/linux-yocto.inc
-require recipes-kernel/linux/meta-intel-compat-kernel.inc
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-intel:"
-
-SRC_URI = " \
- git://github.com/intel/mainline-tracking.git;protocol=https;name=machine;nobranch=1; \
- git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${KMETA_BRANCH};destsuffix=${KMETA} \
- file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
- "
-SRC_URI_append_core2-32-intel-common = " file://disable_skylake_sound.cfg"
-
-KMETA = "kernel-meta"
-KCONF_BSP_AUDIT_LEVEL = "2"
-
-KMETA_BRANCH = "master"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.11-rc6"
-SRCREV_machine ?= "1048ba83fb1c00cd24172e23e8263972f6b5d9ac"
-SRCREV_meta ?= "3356fb62fb5eadec1f5c3c4248f1f8dbab968aa1"
-
-LINUX_VERSION_EXTENSION ?= "-mainline-tracking-${LINUX_KERNEL_TYPE}"
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-COMPATIBLE_MACHINE ?= "(intel-corei7-64|intel-core2-32)"
-
-# Functionality flags
-KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
-KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
-KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
diff --git a/recipes-kernel/linux/linux-intel-rt_5.4.bb b/recipes-kernel/linux/linux-intel-rt_5.4.bb
deleted file mode 100644
index 6b61e168..00000000
--- a/recipes-kernel/linux/linux-intel-rt_5.4.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-require linux-intel.inc
-
-# Skip processing of this recipe if it is not explicitly specified as the
-# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
-# to build multiple virtual/kernel providers, e.g. as dependency of
-# core-image-rt-sdk, core-image-rt.
-python () {
- if d.getVar("KERNEL_PACKAGE_NAME", True) == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt":
- raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it")
-}
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
-"
-
-KBRANCH = "5.4/preempt-rt"
-KMETA_BRANCH = "yocto-5.4"
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.4.102"
-SRCREV_machine ?= "7bbaa89ee7f0cb8e912e52b17247d0c0a7b2db15"
-SRCREV_meta ?= "19738ca97b999a3b150e2d34232bb44b6537348f"
-
-LINUX_KERNEL_TYPE = "preempt-rt"
-
-# Kernel config 'CONFIG_GPIO_LYNXPOINT' goes by a different name 'CONFIG_PINCTRL_LYNXPOINT' in
-# linux-intel 5.4 specifically. This cause annoying warning during kernel config audit. So suppress the
-# harmless warning for now.
-KCONF_BSP_AUDIT_LEVEL = "0"
diff --git a/recipes-kernel/linux/linux-intel-rt_5.10.bb b/recipes-kernel/linux/linux-intel-rt_6.6.bb
index 7d67fb0a..23e79a43 100644
--- a/recipes-kernel/linux/linux-intel-rt_5.10.bb
+++ b/recipes-kernel/linux/linux-intel-rt_6.6.bb
@@ -1,5 +1,8 @@
require linux-intel.inc
+SRC_URI:prepend = "git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \
+ "
+
# Skip processing of this recipe if it is not explicitly specified as the
# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
# to build multiple virtual/kernel providers, e.g. as dependency of
@@ -9,17 +12,22 @@ python () {
raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it")
}
-LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
-SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
- "
+KBRANCH = "6.6/preempt-rt"
+KMETA_BRANCH = "yocto-6.6"
-KBRANCH = "5.10/preempt-rt"
-KMETA_BRANCH = "yocto-5.10"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
DEPENDS += "elfutils-native openssl-native util-linux-native"
-LINUX_VERSION ?= "5.10.21"
-SRCREV_machine ?= "774cd893ee3f4044305e0a7bf5090e32b72578b3"
-SRCREV_meta ?= "eb09284047fec2f09d62068c338ae320c6681bd1"
+LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}"
+
+LINUX_VERSION ?= "6.6.23"
+SRCREV_machine ?= "73113409624a0a68494db7b1c1d535d1c8b96689"
+SRCREV_meta ?= "eb283ea577df80542d48f0c498365960b4c4ecd9"
LINUX_KERNEL_TYPE = "preempt-rt"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
+
+UPSTREAM_CHECK_GITTAGREGEX = "^lts-(?P<pver>v6.6.(\d+)-rt(\d)-preempt-rt-(\d+)T(\d+)Z)$"
diff --git a/recipes-kernel/linux/linux-intel.inc b/recipes-kernel/linux/linux-intel.inc
index c6163973..f78f5205 100644
--- a/recipes-kernel/linux/linux-intel.inc
+++ b/recipes-kernel/linux/linux-intel.inc
@@ -1,26 +1,24 @@
require recipes-kernel/linux/linux-yocto.inc
require recipes-kernel/linux/meta-intel-compat-kernel.inc
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-intel:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-intel:"
KERNEL_CONFIG_URI ?= "git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${KMETA_BRANCH};destsuffix=${KMETA}"
SRC_URI = " \
- git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \
${KERNEL_CONFIG_URI} \
+ file://0001-vt-conmakehash-improve-reproducibility.patch \
+ file://0001-lib-build_OID_registry-fix-reproducibility-issues.patch \
+ file://fix-perf-reproducibility.patch \
+ file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
+ file://0002-mconf-fix-output-of-cflags-and-libraries.patch \
"
-SRC_URI_append = " file://enable_lynxpoint_gpio.cfg"
-SRC_URI_append_core2-32-intel-common = " file://disable_skylake_sound.cfg"
-
-LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}"
-
PV = "${LINUX_VERSION}+git${SRCPV}"
KMETA = "kernel-meta"
-KCONF_BSP_AUDIT_LEVEL = "2"
+KCONF_BSP_AUDIT_LEVEL = "0"
-COMPATIBLE_MACHINE ?= "(intel-corei7-64|intel-core2-32)"
+COMPATIBLE_MACHINE ?= "(intel-corei7-64)"
-KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
-KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
+KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
diff --git a/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch b/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
new file mode 100644
index 00000000..d41c3f0b
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
@@ -0,0 +1,48 @@
+From 2fca0fd719812ea2ff67630b01355aa80481623e Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Sun, 10 Jul 2022 22:56:53 -0400
+Subject: [PATCH] lib/build_OID_registry: fix reproducibility issues
+
+The script build_OID_registry captures the full path of itself
+in the generated data. This causes reproduciblity issues as the
+path is captured and packaged.
+
+We use the basename of the script instead, and that allows us
+to be reprodicible, with slightly less information captured in
+the output data (but the generating script can still easily
+be found).
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+Upstream-Status: Inappropriate
+
+Taken from linux-yocto, v5.15/standard/base.
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ lib/build_OID_registry | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/build_OID_registry b/lib/build_OID_registry
+index d7fc32ea8ac2..f6de0a7f7457 100755
+--- a/lib/build_OID_registry
++++ b/lib/build_OID_registry
+@@ -8,6 +8,7 @@
+ #
+
+ use strict;
++use File::Basename;
+
+ my @names = ();
+ my @oids = ();
+@@ -35,7 +36,7 @@ close IN_FILE || die;
+ #
+ open C_FILE, ">$ARGV[1]" or die;
+ print C_FILE "/*\n";
+-print C_FILE " * Automatically generated by ", $0, ". Do not edit\n";
++print C_FILE " * Automatically generated by ", basename $0, ". Do not edit\n";
+ print C_FILE " */\n";
+
+ #
+--
+2.36.1
+
diff --git a/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch b/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch
index 3dc71ff2..a601e783 100644
--- a/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch
+++ b/recipes-kernel/linux/linux-intel/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch
@@ -1,7 +1,8 @@
-From bebd63730a433ba62549a80114a9851328aa8897 Mon Sep 17 00:00:00 2001
+From 1811da09f42ca5e82282970e8ad014707bc94c82 Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@windriver.com>
Date: Mon, 2 Jul 2018 23:10:28 -0400
-Subject: [PATCH] menuconfig,mconf-cfg: Allow specification of ncurses location
+Subject: [PATCH 1/2] menuconfig,mconf-cfg: Allow specification of ncurses
+ location
In some cross build environments such as the Yocto Project build
environment it provides an ncurses library that is compiled
@@ -16,33 +17,36 @@ check-lxdialog.sh for environments such as the Yocto Project. Adding
a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
compiling and linking against the right headers and libraries.
+Upstream-Status: Submitted
+
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
cc: Michal Marek <mmarek@suse.cz>
cc: linux-kbuild@vger.kernel.org
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
scripts/kconfig/mconf-cfg.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
-index c812872d7f9d..42d20819025c 100755
+index 1e61f50a5905..38cf8304bb31 100755
--- a/scripts/kconfig/mconf-cfg.sh
+++ b/scripts/kconfig/mconf-cfg.sh
-@@ -4,6 +4,14 @@
+@@ -7,6 +7,14 @@ libs=$2
PKG="ncursesw"
PKG2="ncurses"
+if [ "$CROSS_CURSES_LIB" != "" ]; then
-+ echo libs=\'$CROSS_CURSES_LIB\'
-+ if [ x"$CROSS_CURSES_INC" != x ]; then
-+ echo cflags=\'$CROSS_CURSES_INC\'
-+ fi
-+ exit 0
++ echo libs=\'$CROSS_CURSES_LIB\'
++ if [ x"$CROSS_CURSES_INC" != x ]; then
++ echo cflags=\'$CROSS_CURSES_INC\'
++ fi
++ exit 0
+fi
+
- if [ -n "$(command -v pkg-config)" ]; then
- if pkg-config --exists $PKG; then
- echo cflags=\"$(pkg-config --cflags $PKG)\"
+ if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
+ if ${HOSTPKG_CONFIG} --exists $PKG; then
+ ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags}
--
-2.17.1
+2.34.1
diff --git a/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch b/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch
new file mode 100644
index 00000000..33280063
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel/0001-vt-conmakehash-improve-reproducibility.patch
@@ -0,0 +1,58 @@
+From 0f586f4ee8adacac79b64d1f3d47799a5eb7fbea Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Sun, 10 Jul 2022 21:37:07 -0400
+Subject: [PATCH] vt/conmakehash: improve reproducibility
+
+The file generated by conmakehash capture the application
+path used to generate the file. While that can be informative,
+it varies based on where the kernel was built, as the full
+path is captured.
+
+We tweak the application to use a second input as the "capture
+name", and then modify the Makefile to pass the basename of
+the source, making it reproducible.
+
+This could be improved by using some sort of path mapping,
+or the application manipualing argv[1] itself, but for now
+this solves the reprodicibility issue.
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+
+Upstream-Status: Inappropriate
+
+Taken from linux-yocto, v5.15/standard/base
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ drivers/tty/vt/Makefile | 2 +-
+ drivers/tty/vt/conmakehash.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile
+index fe30ce512819..cb51c21b58f9 100644
+--- a/drivers/tty/vt/Makefile
++++ b/drivers/tty/vt/Makefile
+@@ -15,7 +15,7 @@ clean-files := consolemap_deftbl.c defkeymap.c
+ hostprogs += conmakehash
+
+ quiet_cmd_conmk = CONMK $@
+- cmd_conmk = $(obj)/conmakehash $< > $@
++ cmd_conmk = $(obj)/conmakehash $< $(shell basename $<) > $@
+
+ $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/conmakehash
+ $(call cmd,conmk)
+diff --git a/drivers/tty/vt/conmakehash.c b/drivers/tty/vt/conmakehash.c
+index cddd789fe46e..d62510b280e9 100644
+--- a/drivers/tty/vt/conmakehash.c
++++ b/drivers/tty/vt/conmakehash.c
+@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
+ #include <linux/types.h>\n\
+ \n\
+ u8 dfont_unicount[%d] = \n\
+-{\n\t", argv[1], fontlen);
++{\n\t", argv[2], fontlen);
+
+ for ( i = 0 ; i < fontlen ; i++ )
+ {
+--
+2.36.1
+
diff --git a/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch b/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch
new file mode 100644
index 00000000..a96b68d9
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel/0002-mconf-fix-output-of-cflags-and-libraries.patch
@@ -0,0 +1,40 @@
+From 1b53d82a8152843afcddd7f16b0c43b6b4f22895 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Mon, 17 Jul 2023 17:17:55 -0400
+Subject: [PATCH 2/2] mconf: fix output of cflags and libraries
+
+commit 3122c84409d578a5df8bcb1 [kconfig: refactor Makefile to reduce
+process forks] changes the way that flags are detected. They are
+no longer just echo'd and captured, they are written to a file and
+later read.
+
+We adjust our CROSS ncurses patch accordingly.
+
+We'll eventually be able to drop this patch, but not quite yet.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ scripts/kconfig/mconf-cfg.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
+index 38cf8304bb31..a5ae56e08b07 100755
+--- a/scripts/kconfig/mconf-cfg.sh
++++ b/scripts/kconfig/mconf-cfg.sh
+@@ -8,9 +8,9 @@ PKG="ncursesw"
+ PKG2="ncurses"
+
+ if [ "$CROSS_CURSES_LIB" != "" ]; then
+- echo libs=\'$CROSS_CURSES_LIB\'
++ echo $CROSS_CURSES_LIB > ${libs}
+ if [ x"$CROSS_CURSES_INC" != x ]; then
+- echo cflags=\'$CROSS_CURSES_INC\'
++ echo $CROSS_CURSES_INC > ${cflags}
+ fi
+ exit 0
+ fi
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg b/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg
deleted file mode 100644
index 312bcb1a..00000000
--- a/recipes-kernel/linux/linux-intel/disable_skylake_sound.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-# CONFIG_SND_SOC_INTEL_SKYLAKE is not set
-# CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set
-# CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set
-# CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set
-# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set
-# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set
-# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set
diff --git a/recipes-kernel/linux/linux-intel/enable_lynxpoint_gpio.cfg b/recipes-kernel/linux/linux-intel/enable_lynxpoint_gpio.cfg
deleted file mode 100644
index 49e70e67..00000000
--- a/recipes-kernel/linux/linux-intel/enable_lynxpoint_gpio.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_PINCTRL_LYNXPOINT=m
diff --git a/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch b/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch
new file mode 100644
index 00000000..1a98b1db
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel/fix-perf-reproducibility.patch
@@ -0,0 +1,39 @@
+From b8cd0e429bf75b673c438a8277d4bc74327df992 Mon Sep 17 00:00:00 2001
+From: Tom Zanussi <tom.zanussi@intel.com>
+Date: Tue, 3 Jul 2012 13:07:23 -0500
+Subject: perf: change --root to --prefix for python install
+
+Otherwise we get the sysroot path appended to the build path, not what
+we want.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Upstream-Status: Inappropriate
+
+Taken from linux-yocto, v5.15/standard/base
+https://git.yoctoproject.org/linux-yocto/commit?id=b8cd0e429bf75b673c438a8277d4bc74327df992&h=v5.15%2Fstandard%2Fbase
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ tools/perf/Makefile.perf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+(limited to 'tools/perf/Makefile.perf')
+
+diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
+index 8f738e11356d..ee945d8e3996 100644
+--- a/tools/perf/Makefile.perf
++++ b/tools/perf/Makefile.perf
+@@ -1022,7 +1022,7 @@ install-bin: install-tools install-tests install-traceevent-plugins
+ install: install-bin try-install-man
+
+ install-python_ext:
+- $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
++ $(PYTHON_WORD) util/setup.py --quiet install --prefix='$(DESTDIR_SQ)/usr'
+
+ # 'make install-doc' should call 'make -C Documentation install'
+ $(INSTALL_DOC_TARGETS):
+--
+cgit
+
+
diff --git a/recipes-kernel/linux/linux-intel_5.10.bb b/recipes-kernel/linux/linux-intel_5.10.bb
deleted file mode 100644
index 399ab014..00000000
--- a/recipes-kernel/linux/linux-intel_5.10.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-require linux-intel.inc
-
-KBRANCH = "5.10/yocto"
-KMETA_BRANCH = "yocto-5.10"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
-
-SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
- "
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.10.25"
-SRCREV_machine ?= "7c8f517558810be0c9470f78a06f9c8b909157b4"
-SRCREV_meta ?= "eb09284047fec2f09d62068c338ae320c6681bd1"
-
-# For Crystalforest and Romley
-KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio"
-KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio"
-
-# Functionality flags
-KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
diff --git a/recipes-kernel/linux/linux-intel_5.4.bb b/recipes-kernel/linux/linux-intel_5.4.bb
deleted file mode 100644
index 5b8a4457..00000000
--- a/recipes-kernel/linux/linux-intel_5.4.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require linux-intel.inc
-
-KBRANCH = "5.4/yocto"
-KMETA_BRANCH = "yocto-5.4"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-
-SRC_URI_append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch"
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.4.106"
-SRCREV_machine ?= "4dbe3697c9b89500917d5b6ff3a42b7af769de00"
-SRCREV_meta ?= "19738ca97b999a3b150e2d34232bb44b6537348f"
-
-# For Crystalforest and Romley
-KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio"
-KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio"
-
-# Functionality flags
-KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
-
-# Kernel config 'CONFIG_GPIO_LYNXPOINT' goes by a different name 'CONFIG_PINCTRL_LYNXPOINT' in
-# linux-intel 5.4 specifically. This cause warning during kernel config audit. So suppress the
-# harmless warning for now.
-KCONF_BSP_AUDIT_LEVEL = "0"
diff --git a/recipes-kernel/linux/linux-intel_6.6.bb b/recipes-kernel/linux/linux-intel_6.6.bb
new file mode 100644
index 00000000..0d914b73
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel_6.6.bb
@@ -0,0 +1,21 @@
+require linux-intel.inc
+
+SRC_URI:prepend = "git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH}; \
+ "
+KBRANCH = "6.6/linux"
+KMETA_BRANCH = "yocto-6.6"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+
+DEPENDS += "elfutils-native openssl-native util-linux-native"
+
+LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}"
+
+LINUX_VERSION ?= "6.6.23"
+SRCREV_machine ?= "lts-v6.6.23-linux-240407T055600Z"
+SRCREV_meta ?= "eb283ea577df80542d48f0c498365960b4c4ecd9"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
+
+UPSTREAM_CHECK_GITTAGREGEX = "^lts-(?P<pver>v6.6.(\d+)-linux-(\d+)T(\d+)Z)$"
diff --git a/recipes-kernel/linux/linux-intel_6.8.bb b/recipes-kernel/linux/linux-intel_6.8.bb
new file mode 100644
index 00000000..036879db
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel_6.8.bb
@@ -0,0 +1,20 @@
+require linux-intel.inc
+
+SRC_URI:prepend = "git://github.com/intel/mainline-tracking.git;protocol=https;name=machine;nobranch=1; \
+ "
+KMETA_BRANCH = "master"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+
+DEPENDS += "elfutils-native openssl-native util-linux-native"
+
+LINUX_VERSION_EXTENSION ??= "-mainline-tracking-${LINUX_KERNEL_TYPE}"
+
+LINUX_VERSION ?= "6.8"
+SRCREV_machine ?= "efbae83db36abbbbdb946d4f7bbdfda174107cd2"
+SRCREV_meta ?= "27907f391a4fc508da21358b13419c6e86926c34"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/security/security.scc"
+
+UPSTREAM_CHECK_GITTAGREGEX = "^mainline-tracking-v6.7-rc3-linux-(?P<pver>(\d+)T(\d+)Z)$"
diff --git a/recipes-kernel/linux/linux-yocto-dev.bbappend b/recipes-kernel/linux/linux-yocto-dev.bbappend
index 6173148c..deb19940 100644
--- a/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -1,21 +1,21 @@
-FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/${PN}:"
+FILESEXTRAPATHS:prepend:intel-x86-common := "${THISDIR}/${PN}:"
-COMPATIBLE_MACHINE_core2-32-intel-common = "${MACHINE}"
-KMACHINE_core2-32-intel-common = "intel-core2-32"
-KERNEL_FEATURES_append_core2-32-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}"
+COMPATIBLE_MACHINE:core2-32-intel-common = "${MACHINE}"
+KMACHINE:core2-32-intel-common = "intel-core2-32"
+KERNEL_FEATURES:append:core2-32-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}"
-COMPATIBLE_MACHINE_corei7-64-intel-common = "${MACHINE}"
-KMACHINE_corei7-64-intel-common = "intel-corei7-64"
-KERNEL_FEATURES_append_corei7-64-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}"
+COMPATIBLE_MACHINE:corei7-64-intel-common = "${MACHINE}"
+KMACHINE:corei7-64-intel-common = "intel-corei7-64"
+KERNEL_FEATURES:append:corei7-64-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}"
# NOTE: We do not set SRCREVs here as -dev is intended to be built with AUTOREV
# and setting them here breaks the default mechanism to use AUTOREV if the
# default SRCREV is set and linux-yocto-dev is the preferred provider.
# For Crystalforest and Romley
-KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio"
-KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " uio"
+KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " uio"
+KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " uio"
# For FRI2, NUC
-KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " iwlwifi"
-KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " iwlwifi"
+KERNEL_MODULE_AUTOLOAD:append:core2-32-intel-common = " iwlwifi"
+KERNEL_MODULE_AUTOLOAD:append:corei7-64-intel-common = " iwlwifi"
diff --git a/recipes-kernel/linux/linux-yocto-rt_5.%.bbappend b/recipes-kernel/linux/linux-yocto-rt_%.bbappend
index daa7dd6b..daa7dd6b 100644
--- a/recipes-kernel/linux/linux-yocto-rt_5.%.bbappend
+++ b/recipes-kernel/linux/linux-yocto-rt_%.bbappend
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel/linux/linux-yocto_%.bbappend
index 7c29be14..9f3d43e3 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -1,4 +1,6 @@
+require meta-intel-compat-kernel.inc
+
# The kernel build is 64-bit regardless, so include both common overrides.
# Without this, the kernel will be missing vars that make it buildable for the
# intel-corei7-64 machine.
-MACHINEOVERRIDES_prepend_corei7-64-x32-intel-common = "corei7-64-intel-common:"
+MACHINEOVERRIDES:prepend:corei7-64-x32-intel-common = "corei7-64-intel-common:"
diff --git a/recipes-kernel/linux/linux-yocto_5.%.bbappend b/recipes-kernel/linux/linux-yocto_5.%.bbappend
deleted file mode 100644
index daa7dd6b..00000000
--- a/recipes-kernel/linux/linux-yocto_5.%.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require meta-intel-compat-kernel.inc
diff --git a/recipes-kernel/linux/meta-intel-compat-kernel.inc b/recipes-kernel/linux/meta-intel-compat-kernel.inc
index a985925f..0c861e13 100644
--- a/recipes-kernel/linux/meta-intel-compat-kernel.inc
+++ b/recipes-kernel/linux/meta-intel-compat-kernel.inc
@@ -3,12 +3,12 @@
KERNEL_FEATURES_INTEL_COMMON ?= ""
-COMPATIBLE_MACHINE_intel-x86-common = "${MACHINE}"
-KERNEL_FEATURES_intel-x86-common = "${KERNEL_FEATURES_INTEL_COMMON}"
+COMPATIBLE_MACHINE:intel-x86-common = "${MACHINE}"
+KERNEL_FEATURES:intel-x86-common = "${KERNEL_FEATURES_INTEL_COMMON}"
-KMACHINE_corei7-64-intel-common = "intel-corei7-64"
-KMACHINE_core2-32-intel-common = "intel-core2-32"
-KMACHINE_skylake-64-intel-common = "intel-corei7-64"
+KMACHINE:corei7-64-intel-common = "intel-corei7-64"
+KMACHINE:core2-32-intel-common = "intel-core2-32"
+KMACHINE:x86-64-v3-intel-common = "intel-corei7-64"
INTEL_COMMON_AUTOLOAD ?= " uio iwlwifi i915"
-KERNEL_MODULE_AUTOLOAD_intel-x86-common = " ${INTEL_COMMON_AUTOLOAD}"
+KERNEL_MODULE_AUTOLOAD:intel-x86-common = " ${INTEL_COMMON_AUTOLOAD}"
diff --git a/recipes-multimedia/itt/itt_3.18.10.bb b/recipes-multimedia/itt/itt_3.24.6.bb
index c410977b..1c4759f9 100644
--- a/recipes-multimedia/itt/itt_3.18.10.bb
+++ b/recipes-multimedia/itt/itt_3.24.6.bb
@@ -3,18 +3,20 @@ DESCRIPTION = "The Instrumentation and Tracing Technology (ITT) API enables \
application to generate and control the collection of trace data during its \
execution across different Intel tools."
-LICENSE = "BSD-3-Clause & GPLv2"
+LICENSE = "BSD-3-Clause & GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSES/BSD-3-Clause.txt;md5=c551872bcf41ce707df54c722edeca7b \
file://LICENSES/GPL-2.0-only.txt;md5=e2d76e7801260c21b90eea3605508ad6 \
"
-SRC_URI = "git://github.com/intel/ittapi.git;protocol=https"
-SRCREV = "66ebaee7a44fcdfb6ae052beb9507318781f3cd0"
+SRC_URI = "git://github.com/intel/ittapi.git;protocol=https;branch=master"
+SRCREV = "ec077431fc725dba590b09b2cec5137878b14783"
S = "${WORKDIR}/git"
PE = "1"
UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$"
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
inherit pkgconfig cmake
EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=Release"
@@ -34,4 +36,4 @@ do_install() {
}
-RDEPENDS_${PN}-dev_remove = "${PN} (= ${EXTENDPKGV})"
+RDEPENDS:${PN}-dev:remove = "${PN} (= ${EXTENDPKGV})"
diff --git a/recipes-multimedia/libva/files/0001-Disable-vp9-padding-on-mtl.patch b/recipes-multimedia/libva/files/0001-Disable-vp9-padding-on-mtl.patch
new file mode 100644
index 00000000..90dff8d1
--- /dev/null
+++ b/recipes-multimedia/libva/files/0001-Disable-vp9-padding-on-mtl.patch
@@ -0,0 +1,35 @@
+From 1b303f417113ad1aa6b63fc024fbe4aa0c943f57 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <siew.hoon.lim@intel.com>
+Date: Tue, 5 Sep 2023 16:13:42 +0800
+Subject: [PATCH 01/12] Disable vp9 padding on mtl.
+
+Upstream-Status: Submitted [https://github.com/intel/media-driver/pull/1720]
+
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp b/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp
+index 844545a87..72265289c 100644
+--- a/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp
++++ b/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp
+@@ -284,7 +284,7 @@ static bool InitMtlMediaWaExt(struct GfxDeviceInfo *devInfo,
+
+ MEDIA_WR_WA(waTable, WaDisableSetObjectCapture, 1);
+
+- MEDIA_WR_WA(waTable, Wa_Vp9UnalignedHeight, 1);
++ MEDIA_WR_WA(waTable, Wa_Vp9UnalignedHeight, 0);
+
+ MEDIA_WR_WA(waTable, Wa_15013355402, 1);
+
+@@ -337,4 +337,4 @@ static struct LinuxDeviceInit arlDeviceInit =
+ };
+
+ static bool arlDeviceRegister = DeviceInfoFactory<LinuxDeviceInit>::
+- RegisterDevice((uint32_t)IGFX_ARROWLAKE, &arlDeviceInit);
+\ No newline at end of file
++ RegisterDevice((uint32_t)IGFX_ARROWLAKE, &arlDeviceInit);
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0002-Force-ARGB-surface-to-tile4-for-ACM.patch b/recipes-multimedia/libva/files/0002-Force-ARGB-surface-to-tile4-for-ACM.patch
new file mode 100644
index 00000000..df3d9805
--- /dev/null
+++ b/recipes-multimedia/libva/files/0002-Force-ARGB-surface-to-tile4-for-ACM.patch
@@ -0,0 +1,44 @@
+From 1580f01ec5ad5afdad58c39dded999494275be10 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <siew.hoon.lim@intel.com>
+Date: Wed, 11 Oct 2023 15:36:21 +0800
+Subject: [PATCH 02/12] Force ARGB surface to tile4 for ACM
+
+Upstream-Status: Submitted [https://github.com/intel/media-driver/pull/1728]
+
+Signed-off-by: Soon, Thean Siew <thean.siew.soon@intel.com>
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ media_driver/linux/common/ddi/media_libva_util.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/media_driver/linux/common/ddi/media_libva_util.cpp b/media_driver/linux/common/ddi/media_libva_util.cpp
+index 63c173419..73be76366 100755
+--- a/media_driver/linux/common/ddi/media_libva_util.cpp
++++ b/media_driver/linux/common/ddi/media_libva_util.cpp
+@@ -504,6 +504,7 @@ VAStatus DdiMediaUtil_AllocateSurface(
+ gmmCustomParams.Flags.Gpu.UnifiedAuxSurface = 0;
+ }
+ }
++
+ break;
+ case TILING_X:
+ gmmCustomParams.Flags.Info.TiledX = true;
+@@ -685,6 +686,15 @@ VAStatus DdiMediaUtil_AllocateSurface(
+ }
+ }
+ }
++ // There's no VAAPI interface for modifier query yet. As a workaround, always allocate
++ // RGB surface as tile4.
++ if ((format == Media_Format_A8R8G8B8 ||
++ format == Media_Format_B10G10R10A2 |
++ format == Media_Format_A8B8G8R8 ||
++ format == Media_Format_X8R8G8B8) && !MEDIA_IS_SKU(&mediaDrvCtx->SkuTable, FtrTileY))
++ {
++ gmmParams.Flags.Info.Tile4 = true;
++ }
+ break;
+ case TILING_X:
+ gmmParams.Flags.Info.TiledX = true;
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0004-Add-device-ID-for-ARL.patch b/recipes-multimedia/libva/files/0004-Add-device-ID-for-ARL.patch
new file mode 100644
index 00000000..59fff127
--- /dev/null
+++ b/recipes-multimedia/libva/files/0004-Add-device-ID-for-ARL.patch
@@ -0,0 +1,45 @@
+From bb860c0bfe53060925b1dce50da4e6e94cfc8cae Mon Sep 17 00:00:00 2001
+From: huangli2018 <li.h.huang@intel.com>
+Date: Wed, 20 Dec 2023 15:47:43 +0800
+Subject: [PATCH 04/13] Add device ID for ARL
+
+Add device ID for ARL
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/95cbfce81cafa3c24d9d4601d41a855093bc51fb]
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/media_softlet/linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp b/media_softlet/linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp
+index 426bd795f..7b73dfaff 100644
+--- a/media_softlet/linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp
++++ b/media_softlet/linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp
+@@ -1,6 +1,6 @@
+ /*===================== begin_copyright_notice ==================================
+
+-Copyright (c) 2022, Intel Corporation
++Copyright (c) 2023, Intel Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+@@ -218,4 +218,13 @@ static struct GfxDeviceInfo arlInfo = {
+ };
+
+ static bool arlsDevice7d67 = DeviceInfoFactory<GfxDeviceInfo>::
+- RegisterDevice(0x7D67, &arlInfo);
+\ No newline at end of file
++ RegisterDevice(0x7D67, &arlInfo);
++
++static bool arlhDevice7d51 = DeviceInfoFactory<GfxDeviceInfo>::
++ RegisterDevice(0x7D51, &arlInfo);
++
++static bool arlhDevice7dd1 = DeviceInfoFactory<GfxDeviceInfo>::
++ RegisterDevice(0x7DD1, &arlInfo);
++
++static bool arlhDevice7d41 = DeviceInfoFactory<GfxDeviceInfo>::
++ RegisterDevice(0x7D41, &arlInfo);
+\ No newline at end of file
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0005-Add-XR24-support-to-DMABuf.patch b/recipes-multimedia/libva/files/0005-Add-XR24-support-to-DMABuf.patch
new file mode 100644
index 00000000..a9cd2317
--- /dev/null
+++ b/recipes-multimedia/libva/files/0005-Add-XR24-support-to-DMABuf.patch
@@ -0,0 +1,34 @@
+From bbd3af94a6146d702909ff7e25b0c0547ecbb895 Mon Sep 17 00:00:00 2001
+From: jlui <jonathan.ming.jun.lui@intel.com>
+Date: Wed, 15 Nov 2023 10:48:34 +0800
+Subject: [PATCH 05/13] Add XR24 support to DMABuf
+
+This is to enable XR24/BGRX support for DMABuf
+
+Signed-off-by: Lui, Jonathan Ming Jun <jonathan.ming.jun.lui@intel.com>
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/3910b7029f5416fd0b5972f940c65d0a82c48c7b]
+
+Signed-off-by: Lim, Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../vp/ddi/capstable_data_vp_xe_lpm_plus_r0_specific.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/media_softlet/linux/xe_lpm_plus_r0/vp/ddi/capstable_data_vp_xe_lpm_plus_r0_specific.h b/media_softlet/linux/xe_lpm_plus_r0/vp/ddi/capstable_data_vp_xe_lpm_plus_r0_specific.h
+index fdcca8873..2dcf440a4 100644
+--- a/media_softlet/linux/xe_lpm_plus_r0/vp/ddi/capstable_data_vp_xe_lpm_plus_r0_specific.h
++++ b/media_softlet/linux/xe_lpm_plus_r0/vp/ddi/capstable_data_vp_xe_lpm_plus_r0_specific.h
+@@ -55,8 +55,9 @@ static ProfileSurfaceAttribInfo surfaceAttribInfo_VAEntrypointVideoProc_VAProfil
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('4', '2', '2', 'V')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('R', 'G', 'B', 'A')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('B', 'G', 'R', 'A')}}},
+- {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, { VA_FOURCC('R', 'G', 'B', 'P')}}},
++ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('R', 'G', 'B', 'P')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('R', 'G', 'B', 'X')}}},
++ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('X', 'R', 'G', 'B')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('P', '0', '1', '0')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC('R', 'G', '2', '4')}}},
+ {VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC_ARGB}}},
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0006-add-INTEL-MEDIA-ALLOC-refineE-to-specify-the-memory-.patch b/recipes-multimedia/libva/files/0006-add-INTEL-MEDIA-ALLOC-refineE-to-specify-the-memory-.patch
new file mode 100644
index 00000000..5b04201a
--- /dev/null
+++ b/recipes-multimedia/libva/files/0006-add-INTEL-MEDIA-ALLOC-refineE-to-specify-the-memory-.patch
@@ -0,0 +1,214 @@
+From 67fb6128adf8fc03d429393e98f0982b42a40e64 Mon Sep 17 00:00:00 2001
+From: Zhang_Xinfeng <carl.zhang@intel.com>
+Date: Wed, 27 Dec 2023 09:59:29 +0800
+Subject: [PATCH 06/12] add INTEL MEDIA ALLOC refineE to specify the memory
+ alignment
+
+this key is used to allocate bigger pages
+env variable INTEL_MEDIA_ALLOC_refineE also could be used
+and was not enabled by default
+mode 0 is default mode
+mode 1 is < 64 align to 64
+mode 2 is > 1M && <= 3M align to 1M, >3M align to 2M
+mode 3 is mode 1 & mode 2
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/765dd939dcc5562d18cca18e5eda505bda952797]
+Signed-off-by: Lim, Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../linux/common/os/i915/mos_bufmgr.c | 75 +++++++++++++++----
+ .../common/os/i915_production/mos_bufmgr.c | 1 +
+ .../common/os/mos_context_specific_next.cpp | 21 +++++-
+ .../common/os/mos_user_setting_specific.cpp | 7 ++
+ 4 files changed, 90 insertions(+), 14 deletions(-)
+
+diff --git a/media_softlet/linux/common/os/i915/mos_bufmgr.c b/media_softlet/linux/common/os/i915/mos_bufmgr.c
+index c0b3ba027..b623d0129 100644
+--- a/media_softlet/linux/common/os/i915/mos_bufmgr.c
++++ b/media_softlet/linux/common/os/i915/mos_bufmgr.c
+@@ -138,7 +138,7 @@ struct mos_bufmgr_gem {
+ int exec_count;
+
+ /** Array of lists of cached gem objects of power-of-two sizes */
+- struct mos_gem_bo_bucket cache_bucket[14 * 4];
++ struct mos_gem_bo_bucket cache_bucket[64];
+ int num_buckets;
+ time_t time;
+
+@@ -3852,9 +3852,9 @@ add_bucket(struct mos_bufmgr_gem *bufmgr_gem, int size)
+ }
+
+ static void
+-init_cache_buckets(struct mos_bufmgr_gem *bufmgr_gem)
++init_cache_buckets(struct mos_bufmgr_gem *bufmgr_gem, uint8_t alloc_mode)
+ {
+- unsigned long size, cache_max_size = 64 * 1024 * 1024;
++ unsigned long size, cache_max_size = 64 * 1024 * 1024, unit_size;
+
+ /* OK, so power of two buckets was too wasteful of memory.
+ * Give 3 other sizes between each power of two, to hopefully
+@@ -3864,17 +3864,63 @@ init_cache_buckets(struct mos_bufmgr_gem *bufmgr_gem)
+ * width/height alignment and rounding of sizes to pages will
+ * get us useful cache hit rates anyway)
+ */
+- add_bucket(bufmgr_gem, 4096);
+- add_bucket(bufmgr_gem, 4096 * 2);
+- add_bucket(bufmgr_gem, 4096 * 3);
++ /* alloc_mode 0 is default alloc_mode
++ * alloc_mode 1 rounding up to 64K for all < 1M
++ * alloc_mode 2 rounding up to 2M for size> 1M
++ * alloc_mode 3 rounding up to 2M for size > 1M and 64K for size <= 1M */
++ if( alloc_mode > 3 )
++ alloc_mode = 0;
++
++ if ( 0 == alloc_mode || 2 == alloc_mode)
++ {
++ // < 1M normal alloc_mode
++ add_bucket(bufmgr_gem, 4096);
++ add_bucket(bufmgr_gem, 4096 * 2);
++ add_bucket(bufmgr_gem, 4096 * 3);
++ /* Initialize the linked lists for BO reuse cache. */
++ for (size = 4 * 4096; size < 1024 * 1024; size *= 2) {
++ add_bucket(bufmgr_gem, size);
++ add_bucket(bufmgr_gem, size + size * 1 / 4);
++ add_bucket(bufmgr_gem, size + size * 2 / 4);
++ add_bucket(bufmgr_gem, size + size * 3 / 4);
++ }
+
+- /* Initialize the linked lists for BO reuse cache. */
+- for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
+- add_bucket(bufmgr_gem, size);
++ add_bucket(bufmgr_gem, 1024 * 1024);
++ }
++ if (1 == alloc_mode || 3 == alloc_mode)
++ {
++ // < 1M 64k alignment
++ unit_size = 64 * 1024;
++ for (size = unit_size; size <= 1024 * 1024; size += unit_size)
++ {
++ add_bucket(bufmgr_gem, size);
++ }
++ }
++ if( 0 == alloc_mode || 1 == alloc_mode)
++ {
++ //> 1M is normal alloc_mode
++ add_bucket(bufmgr_gem, 1280 * 1024);
++ add_bucket(bufmgr_gem, 1536 * 1024);
++ add_bucket(bufmgr_gem, 1792 * 1024);
++
++ for (size = 2 * 1024 * 1024; size < cache_max_size; size *= 2) {
++ add_bucket(bufmgr_gem, size);
++ add_bucket(bufmgr_gem, size + size * 1 / 4);
++ add_bucket(bufmgr_gem, size + size * 2 / 4);
++ add_bucket(bufmgr_gem, size + size * 3 / 4);
++ }
++ }
++ if( 2 == alloc_mode || 3 == alloc_mode)
++ {
++ //> 1M rolling to 2M
++ unit_size = 2 * 1024 * 1024;
++ add_bucket(bufmgr_gem, unit_size);
++ add_bucket(bufmgr_gem, 3 * 1024 * 1024);
+
+- add_bucket(bufmgr_gem, size + size * 1 / 4);
+- add_bucket(bufmgr_gem, size + size * 2 / 4);
+- add_bucket(bufmgr_gem, size + size * 3 / 4);
++ for (size = 4 * 1024 * 1024; size <= cache_max_size; size += unit_size)
++ {
++ add_bucket(bufmgr_gem, size);
++ }
+ }
+ }
+
+@@ -5100,6 +5146,7 @@ mos_bufmgr_gem_init_i915(int fd, int batch_size)
+ struct drm_i915_gem_get_aperture aperture;
+ drm_i915_getparam_t gp;
+ int ret, tmp;
++ uint8_t alloc_mode;
+ bool exec2 = false;
+
+ pthread_mutex_lock(&bufmgr_list_mutex);
+@@ -5352,10 +5399,12 @@ mos_bufmgr_gem_init_i915(int fd, int batch_size)
+ *
+ * Every 4 was too few for the blender benchmark.
+ */
++ alloc_mode = (uint8_t)(batch_size & 0xff);
++ batch_size &= 0xffffff00;
+ bufmgr_gem->max_relocs = batch_size / sizeof(uint32_t) / 2 - 2;
+
+ DRMINITLISTHEAD(&bufmgr_gem->named);
+- init_cache_buckets(bufmgr_gem);
++ init_cache_buckets(bufmgr_gem,alloc_mode);
+
+ DRMLISTADD(&bufmgr_gem->managers, &bufmgr_list);
+
+diff --git a/media_softlet/linux/common/os/i915_production/mos_bufmgr.c b/media_softlet/linux/common/os/i915_production/mos_bufmgr.c
+index 90b5685b1..b3574f7d3 100644
+--- a/media_softlet/linux/common/os/i915_production/mos_bufmgr.c
++++ b/media_softlet/linux/common/os/i915_production/mos_bufmgr.c
+@@ -5403,6 +5403,7 @@ mos_bufmgr_gem_init_i915(int fd, int batch_size)
+ *
+ * Every 4 was too few for the blender benchmark.
+ */
++ batch_size &= 0xffffff00;
+ bufmgr_gem->max_relocs = batch_size / sizeof(uint32_t) / 2 - 2;
+
+ DRMINITLISTHEAD(&bufmgr_gem->named);
+diff --git a/media_softlet/linux/common/os/mos_context_specific_next.cpp b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+index 9e9e3ff7e..543e262d1 100644
+--- a/media_softlet/linux/common/os/mos_context_specific_next.cpp
++++ b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+@@ -64,6 +64,7 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
+ uint32_t iDeviceId = 0;
+ MOS_STATUS eStatus = MOS_STATUS_SUCCESS;
+ uint32_t value = 0;
++ uint32_t mode = 0;
+ MediaUserSettingSharedPtr userSettingPtr = nullptr;
+
+ MOS_OS_FUNCTION_ENTER;
+@@ -89,7 +90,25 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
+
+ userSettingPtr = MosInterface::MosGetUserSettingInstance(osDriverContext);
+
+- m_bufmgr = mos_bufmgr_gem_init(m_fd, BATCH_BUFFER_SIZE, &m_deviceType);
++ mode = BATCH_BUFFER_SIZE;
++ ReadUserSetting(
++ userSettingPtr,
++ value,
++ "INTEL MEDIA ALLOC MODE",
++ MediaUserSetting::Group::Device);
++
++ if (value)
++ {
++ mode |= (value & 0x000000ff);
++ }
++ value = 0;
++ /* no need to set batch buffer size after switch to softpin
++ * keep it, just for test during relocation to softpin transition
++ * now , it could be a debug method , but is actually useless
++ * so it is safe to reuse the lowest 8bit to convey addtional information
++ * more suitable solution is deleting it , or add additional parameter*/
++
++ m_bufmgr = mos_bufmgr_gem_init(m_fd, (int)mode, &m_deviceType);
+ if (nullptr == m_bufmgr)
+ {
+ MOS_OS_ASSERTMESSAGE("Not able to allocate buffer manager, fd=0x%d", m_fd);
+diff --git a/media_softlet/linux/common/os/mos_user_setting_specific.cpp b/media_softlet/linux/common/os/mos_user_setting_specific.cpp
+index 6be8b4298..caed584f4 100644
+--- a/media_softlet/linux/common/os/mos_user_setting_specific.cpp
++++ b/media_softlet/linux/common/os/mos_user_setting_specific.cpp
+@@ -52,5 +52,12 @@ MOS_STATUS MosUserSetting::InitMosUserSettingSpecific(MediaUserSettingSharedPtr
+ 0,
+ true); //"Enable VM Bind."
+
++ DeclareUserSettingKey(
++ userSettingPtr,
++ "INTEL MEDIA ALLOC MODE",
++ MediaUserSetting::Group::Device,
++ 0,
++ false); //
++
+ return MOS_STATUS_SUCCESS;
+ }
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0007-Skip-report-keys.patch b/recipes-multimedia/libva/files/0007-Skip-report-keys.patch
new file mode 100644
index 00000000..459ff490
--- /dev/null
+++ b/recipes-multimedia/libva/files/0007-Skip-report-keys.patch
@@ -0,0 +1,78 @@
+From b1aebef4d342c77fc2b9c5efbf20aeb2aa9d634e Mon Sep 17 00:00:00 2001
+From: Wang_Pingli <pingli.wang@intel.com>
+Date: Thu, 28 Dec 2023 16:44:40 +0800
+Subject: [PATCH 07/12] Skip report keys
+
+Skip to report keys
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/68ce25b0a6fa90614eb4734c8680aa4e149e8323]
+Signed-off-by: Lim, Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../os/osservice/mos_utilities_specific.cpp | 30 +++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp b/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp
+index b5df29f06..96785e21e 100644
+--- a/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp
++++ b/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp
+@@ -67,6 +67,8 @@ int32_t g_mosMemoryFailSimulateAllocCounter = 0;
+ int32_t *MosUtilities::m_mosAllocMemoryFailSimulateAllocCounter = &g_mosMemoryFailSimulateAllocCounter;
+ #endif
+
++static bool s_skipToReportReg = false;
++
+ double MosUtilities::MosGetTime()
+ {
+ struct timespec ts = {};
+@@ -1551,6 +1553,10 @@ MOS_STATUS MosUtilities::MosInitializeReg(RegBufferMap &regBufferMap)
+ {
+ std::string id = "";
+
++ static const char *disableReportRegKeyList[] = {
++ "INTEL MEDIA ALLOC MODE"
++ };
++ static const uint32_t disableReportRegKeyListCount = sizeof(disableReportRegKeyList) / sizeof(disableReportRegKeyList[0]);
+ while(!regStream.eof())
+ {
+ std::string line = "";
+@@ -1585,8 +1591,22 @@ MOS_STATUS MosUtilities::MosInitializeReg(RegBufferMap &regBufferMap)
+ {
+ std::string name = line.substr(0,pos);
+ std::string value = line.substr(pos+1);
+- auto &keys = regBufferMap[id];
+- keys[name] = value;
++ if (name.size() > 0 && value.size() > 0)
++ {
++ auto &keys = regBufferMap[id];
++ keys[name] = value;
++ if (s_skipToReportReg == false && id == USER_SETTING_CONFIG_PATH)
++ {
++ for (uint32_t i = 0; i < disableReportRegKeyListCount; i++)
++ {
++ if (strcmp(name.c_str(), disableReportRegKeyList[i]) == 0)
++ {
++ s_skipToReportReg = true;
++ break;
++ }
++ }
++ }
++ }
+ }
+ }
+ }
+@@ -1606,6 +1626,12 @@ MOS_STATUS MosUtilities::MosInitializeReg(RegBufferMap &regBufferMap)
+ MOS_STATUS MosUtilities::MosUninitializeReg(RegBufferMap &regBufferMap)
+ {
+ MOS_STATUS status = MOS_STATUS_SUCCESS;
++
++ if (s_skipToReportReg)
++ {
++ return MOS_STATUS_SUCCESS;
++ }
++
+ if (regBufferMap.size() == 0)
+ {
+ return MOS_STATUS_SUCCESS;
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0008-Limit-INTEL-MEDIA-ALLOC-MODE-to-MTL-and-ARL-only.patch b/recipes-multimedia/libva/files/0008-Limit-INTEL-MEDIA-ALLOC-MODE-to-MTL-and-ARL-only.patch
new file mode 100644
index 00000000..ece5e00b
--- /dev/null
+++ b/recipes-multimedia/libva/files/0008-Limit-INTEL-MEDIA-ALLOC-MODE-to-MTL-and-ARL-only.patch
@@ -0,0 +1,255 @@
+From ac2ffac8d4aade216cc361c6c7120c13a8780719 Mon Sep 17 00:00:00 2001
+From: "Soon, Thean Siew" <thean.siew.soon@intel.com>
+Date: Thu, 28 Dec 2023 18:42:59 +0000
+Subject: [PATCH 08/12] Limit INTEL MEDIA ALLOC MODE to MTL and ARL only
+
+Upstream-Status: Submitted [https://github.com/intel/media-driver/pull/1754]
+
+Signed-off-by: Soon, Thean Siew <thean.siew.soon@intel.com>
+---
+ .../common/os/i915/include/mos_bufmgr_api.h | 1 +
+ .../common/os/i915/include/mos_bufmgr_priv.h | 2 +-
+ .../linux/common/os/i915/mos_bufmgr.c | 69 +++++++++++++++----
+ .../linux/common/os/i915/mos_bufmgr_api.c | 19 +++++
+ .../os/i915_production/mos_bufmgr_priv.h | 1 +
+ .../common/os/mos_context_specific_next.cpp | 36 +++++-----
+ 6 files changed, 94 insertions(+), 34 deletions(-)
+
+diff --git a/media_softlet/linux/common/os/i915/include/mos_bufmgr_api.h b/media_softlet/linux/common/os/i915/include/mos_bufmgr_api.h
+index 71cc01099..ab4f1ba89 100644
+--- a/media_softlet/linux/common/os/i915/include/mos_bufmgr_api.h
++++ b/media_softlet/linux/common/os/i915/include/mos_bufmgr_api.h
+@@ -299,6 +299,7 @@ void mos_bufmgr_enable_vmbind(struct mos_bufmgr *bufmgr);
+ void mos_bufmgr_disable_object_capture(struct mos_bufmgr *bufmgr);
+ int mos_bufmgr_get_memory_info(struct mos_bufmgr *bufmgr, char *info, uint32_t length);
+ int mos_bufmgr_get_devid(struct mos_bufmgr *bufmgr);
++void mos_bufmgr_realloc_cache(struct mos_bufmgr *bufmgr, uint8_t alloc_mode);
+
+ int mos_bo_map_unsynchronized(struct mos_linux_bo *bo);
+ int mos_bo_map_gtt(struct mos_linux_bo *bo);
+diff --git a/media_softlet/linux/common/os/i915/include/mos_bufmgr_priv.h b/media_softlet/linux/common/os/i915/include/mos_bufmgr_priv.h
+index 63f69f985..6fd58f827 100644
+--- a/media_softlet/linux/common/os/i915/include/mos_bufmgr_priv.h
++++ b/media_softlet/linux/common/os/i915/include/mos_bufmgr_priv.h
+@@ -358,9 +358,9 @@ struct mos_bufmgr {
+ void (*disable_object_capture)(struct mos_bufmgr *bufmgr) = nullptr;
+ int (*get_memory_info)(struct mos_bufmgr *bufmgr, char *info, uint32_t length) = nullptr;
+ int (*get_devid)(struct mos_bufmgr *bufmgr) = nullptr;
++ void (*realloc_cache)(struct mos_bufmgr *bufmgr, uint8_t alloc_mode) = nullptr;
+ int (*query_engines_count)(struct mos_bufmgr *bufmgr,
+ unsigned int *nengine) = nullptr;
+-
+ int (*query_engines)(struct mos_bufmgr *bufmgr,
+ __u16 engine_class,
+ __u64 caps,
+diff --git a/media_softlet/linux/common/os/i915/mos_bufmgr.c b/media_softlet/linux/common/os/i915/mos_bufmgr.c
+index b623d0129..2814ddbb7 100644
+--- a/media_softlet/linux/common/os/i915/mos_bufmgr.c
++++ b/media_softlet/linux/common/os/i915/mos_bufmgr.c
+@@ -2426,19 +2426,9 @@ mos_gem_bo_start_gtt_access(struct mos_linux_bo *bo, int write_enable)
+ }
+
+ static void
+-mos_bufmgr_gem_destroy(struct mos_bufmgr *bufmgr)
++mos_bufmgr_cleanup_cache(struct mos_bufmgr_gem *bufmgr_gem)
+ {
+- struct mos_bufmgr_gem *bufmgr_gem = (struct mos_bufmgr_gem *) bufmgr;
+- struct drm_gem_close close_bo;
+- int i, ret;
+-
+- free(bufmgr_gem->exec2_objects);
+- free(bufmgr_gem->exec_objects);
+- free(bufmgr_gem->exec_bos);
+- pthread_mutex_destroy(&bufmgr_gem->lock);
+-
+- /* Free any cached buffer objects we were going to reuse */
+- for (i = 0; i < bufmgr_gem->num_buckets; i++) {
++ for (int i = 0; i < bufmgr_gem->num_buckets; i++) {
+ struct mos_gem_bo_bucket *bucket =
+ &bufmgr_gem->cache_bucket[i];
+ struct mos_bo_gem *bo_gem;
+@@ -2450,7 +2440,25 @@ mos_bufmgr_gem_destroy(struct mos_bufmgr *bufmgr)
+
+ mos_gem_bo_free(&bo_gem->bo);
+ }
++ bufmgr_gem->cache_bucket[i].size = 0;
+ }
++ bufmgr_gem->num_buckets = 0;
++}
++
++static void
++mos_bufmgr_gem_destroy(struct mos_bufmgr *bufmgr)
++{
++ struct mos_bufmgr_gem *bufmgr_gem = (struct mos_bufmgr_gem *)bufmgr;
++ struct drm_gem_close close_bo;
++ int ret;
++
++ free(bufmgr_gem->exec2_objects);
++ free(bufmgr_gem->exec_objects);
++ free(bufmgr_gem->exec_bos);
++ pthread_mutex_destroy(&bufmgr_gem->lock);
++
++ /* Free any cached buffer objects we were going to reuse */
++ mos_bufmgr_cleanup_cache(bufmgr_gem);
+
+ /* Release userptr bo kept hanging around for optimisation. */
+ if (bufmgr_gem->userptr_active.ptr) {
+@@ -3852,9 +3860,41 @@ add_bucket(struct mos_bufmgr_gem *bufmgr_gem, int size)
+ }
+
+ static void
+-init_cache_buckets(struct mos_bufmgr_gem *bufmgr_gem, uint8_t alloc_mode)
++init_cache_buckets(struct mos_bufmgr_gem *bufmgr_gem)
++{
++ unsigned long size, cache_max_size = 64 * 1024 * 1024;
++
++ /* OK, so power of two buckets was too wasteful of memory.
++ * Give 3 other sizes between each power of two, to hopefully
++ * cover things accurately enough. (The alternative is
++ * probably to just go for exact matching of sizes, and assume
++ * that for things like composited window resize the tiled
++ * width/height alignment and rounding of sizes to pages will
++ * get us useful cache hit rates anyway)
++ */
++ add_bucket(bufmgr_gem, 4096);
++ add_bucket(bufmgr_gem, 4096 * 2);
++ add_bucket(bufmgr_gem, 4096 * 3);
++
++ /* Initialize the linked lists for BO reuse cache. */
++ for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
++ add_bucket(bufmgr_gem, size);
++
++ add_bucket(bufmgr_gem, size + size * 1 / 4);
++ add_bucket(bufmgr_gem, size + size * 2 / 4);
++ add_bucket(bufmgr_gem, size + size * 3 / 4);
++ }
++}
++
++static void
++mos_gem_realloc_cache(struct mos_bufmgr *bufmgr, uint8_t alloc_mode)
+ {
+ unsigned long size, cache_max_size = 64 * 1024 * 1024, unit_size;
++ struct mos_bufmgr_gem *bufmgr_gem = (struct mos_bufmgr_gem *)bufmgr;
++
++ // Clean up the pre-allocated cache before re-allocating according
++ // to alloc_mode
++ mos_bufmgr_cleanup_cache(bufmgr_gem);
+
+ /* OK, so power of two buckets was too wasteful of memory.
+ * Give 3 other sizes between each power of two, to hopefully
+@@ -5218,6 +5258,7 @@ mos_bufmgr_gem_init_i915(int fd, int batch_size)
+ bufmgr_gem->bufmgr.disable_object_capture = mos_gem_disable_object_capture;
+ bufmgr_gem->bufmgr.get_memory_info = mos_gem_get_memory_info;
+ bufmgr_gem->bufmgr.get_devid = mos_gem_get_devid;
++ bufmgr_gem->bufmgr.realloc_cache = mos_gem_realloc_cache;
+ bufmgr_gem->bufmgr.set_context_param = mos_gem_set_context_param;
+ bufmgr_gem->bufmgr.set_context_param_parallel = mos_gem_set_context_param_parallel;
+ bufmgr_gem->bufmgr.set_context_param_load_balance = mos_gem_set_context_param_load_balance;
+@@ -5404,7 +5445,7 @@ mos_bufmgr_gem_init_i915(int fd, int batch_size)
+ bufmgr_gem->max_relocs = batch_size / sizeof(uint32_t) / 2 - 2;
+
+ DRMINITLISTHEAD(&bufmgr_gem->named);
+- init_cache_buckets(bufmgr_gem,alloc_mode);
++ init_cache_buckets(bufmgr_gem);
+
+ DRMLISTADD(&bufmgr_gem->managers, &bufmgr_list);
+
+diff --git a/media_softlet/linux/common/os/i915/mos_bufmgr_api.c b/media_softlet/linux/common/os/i915/mos_bufmgr_api.c
+index abe8ef96a..d0e02c267 100644
+--- a/media_softlet/linux/common/os/i915/mos_bufmgr_api.c
++++ b/media_softlet/linux/common/os/i915/mos_bufmgr_api.c
+@@ -1204,6 +1204,25 @@ mos_bufmgr_get_devid(struct mos_bufmgr *bufmgr)
+ }
+ }
+
++void
++mos_bufmgr_realloc_cache(struct mos_bufmgr *bufmgr, uint8_t alloc_mode)
++{
++ if(!bufmgr)
++ {
++ MOS_OS_CRITICALMESSAGE("Input null ptr\n");
++ return;
++ }
++
++ if (bufmgr->realloc_cache)
++ {
++ return bufmgr->realloc_cache(bufmgr, alloc_mode);
++ }
++ else
++ {
++ MOS_OS_CRITICALMESSAGE("Unsupported\n");
++ }
++}
++
+ int
+ mos_query_engines_count(struct mos_bufmgr *bufmgr,
+ unsigned int *nengine)
+diff --git a/media_softlet/linux/common/os/i915_production/mos_bufmgr_priv.h b/media_softlet/linux/common/os/i915_production/mos_bufmgr_priv.h
+index c3b765a4c..1d7f7edb0 100644
+--- a/media_softlet/linux/common/os/i915_production/mos_bufmgr_priv.h
++++ b/media_softlet/linux/common/os/i915_production/mos_bufmgr_priv.h
+@@ -358,6 +358,7 @@ struct mos_bufmgr {
+ void (*disable_object_capture)(struct mos_bufmgr *bufmgr) = nullptr;
+ int (*get_memory_info)(struct mos_bufmgr *bufmgr, char *info, uint32_t length) = nullptr;
+ int (*get_devid)(struct mos_bufmgr *bufmgr) = nullptr;
++ void (*realloc_cache)(struct mos_bufmgr *bufmgr, uint8_t alloc_mode) = nullptr;
+ int (*query_engines_count)(struct mos_bufmgr *bufmgr,
+ unsigned int *nengine) = nullptr;
+
+diff --git a/media_softlet/linux/common/os/mos_context_specific_next.cpp b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+index 543e262d1..87059f538 100644
+--- a/media_softlet/linux/common/os/mos_context_specific_next.cpp
++++ b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+@@ -90,25 +90,7 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
+
+ userSettingPtr = MosInterface::MosGetUserSettingInstance(osDriverContext);
+
+- mode = BATCH_BUFFER_SIZE;
+- ReadUserSetting(
+- userSettingPtr,
+- value,
+- "INTEL MEDIA ALLOC MODE",
+- MediaUserSetting::Group::Device);
+-
+- if (value)
+- {
+- mode |= (value & 0x000000ff);
+- }
+- value = 0;
+- /* no need to set batch buffer size after switch to softpin
+- * keep it, just for test during relocation to softpin transition
+- * now , it could be a debug method , but is actually useless
+- * so it is safe to reuse the lowest 8bit to convey addtional information
+- * more suitable solution is deleting it , or add additional parameter*/
+-
+- m_bufmgr = mos_bufmgr_gem_init(m_fd, (int)mode, &m_deviceType);
++ m_bufmgr = mos_bufmgr_gem_init(m_fd, BATCH_BUFFER_SIZE, &m_deviceType);
+ if (nullptr == m_bufmgr)
+ {
+ MOS_OS_ASSERTMESSAGE("Not able to allocate buffer manager, fd=0x%d", m_fd);
+@@ -151,6 +133,22 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
+ return eStatus;
+ }
+
++ if (m_platformInfo.eProductFamily == IGFX_METEORLAKE ||
++ m_platformInfo.eProductFamily == IGFX_ARROWLAKE)
++ {
++ ReadUserSetting(
++ userSettingPtr,
++ value,
++ "INTEL MEDIA ALLOC MODE",
++ MediaUserSetting::Group::Device);
++
++ if (value)
++ {
++ mode = (value & 0x000000ff);
++ }
++ mos_bufmgr_realloc_cache(m_bufmgr, mode);
++ }
++
+ ReadUserSetting(
+ userSettingPtr,
+ value,
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0009-Skip-cache-bucket-realloc-for-default-mode-0.patch b/recipes-multimedia/libva/files/0009-Skip-cache-bucket-realloc-for-default-mode-0.patch
new file mode 100644
index 00000000..8ee7ef14
--- /dev/null
+++ b/recipes-multimedia/libva/files/0009-Skip-cache-bucket-realloc-for-default-mode-0.patch
@@ -0,0 +1,33 @@
+From 18c32247cbc0e9fabff7a847add099496af9e53f Mon Sep 17 00:00:00 2001
+From: "Soon, Thean Siew" <thean.siew.soon@intel.com>
+Date: Mon, 8 Jan 2024 18:12:30 +0000
+Subject: [PATCH 09/12] Skip cache bucket realloc for default mode 0
+
+Upstream-Status: Submitted [https://github.com/intel/media-driver/pull/1754]
+
+Signed-off-by: Soon, Thean Siew <thean.siew.soon@intel.com>
+---
+ .../linux/common/os/mos_context_specific_next.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/media_softlet/linux/common/os/mos_context_specific_next.cpp b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+index 87059f538..9dbd5da79 100644
+--- a/media_softlet/linux/common/os/mos_context_specific_next.cpp
++++ b/media_softlet/linux/common/os/mos_context_specific_next.cpp
+@@ -146,7 +146,12 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
+ {
+ mode = (value & 0x000000ff);
+ }
+- mos_bufmgr_realloc_cache(m_bufmgr, mode);
++
++ // Realloc cache only if it's not mode 0
++ if (mode)
++ {
++ mos_bufmgr_realloc_cache(m_bufmgr, mode);
++ }
+ }
+
+ ReadUserSetting(
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0010-Fix-failed-4k-video-wall-test-case-and-color-corrupt.patch b/recipes-multimedia/libva/files/0010-Fix-failed-4k-video-wall-test-case-and-color-corrupt.patch
new file mode 100644
index 00000000..0100df77
--- /dev/null
+++ b/recipes-multimedia/libva/files/0010-Fix-failed-4k-video-wall-test-case-and-color-corrupt.patch
@@ -0,0 +1,195 @@
+From 7291ab5206c5e172c6c94dcfbe4f1bc258f3b7a5 Mon Sep 17 00:00:00 2001
+From: WenshengZhang <wensheng.zhang@intel.com>
+Date: Wed, 10 Jan 2024 14:08:37 +0800
+Subject: [PATCH 10/12] Fix failed 4k video wall test case and color corruption
+ of video composition
+
+Fix failed 4k video wall test case from 16CH video only show 1CH output and
+corruption observed on certain number of video composition when doing
+sample_multi_transcode.
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/38e14b1b97170b51586d00d1fa607e496b0c5825]
+Signed-off-by: Lim, Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../common/vp/kdll/hal_kerneldll_next.h | 1 +
+ .../vp/hal/packet/vp_render_fc_kernel.cpp | 7 ++
+ .../common/vp/kdll/hal_kerneldll_next.c | 70 +++++++++++--------
+ .../linux/common/vp/ddi/ddi_vp_functions.cpp | 20 ++----
+ 4 files changed, 55 insertions(+), 43 deletions(-)
+
+diff --git a/media_common/agnostic/common/vp/kdll/hal_kerneldll_next.h b/media_common/agnostic/common/vp/kdll/hal_kerneldll_next.h
+index 6447999b7..8e2ab371e 100644
+--- a/media_common/agnostic/common/vp/kdll/hal_kerneldll_next.h
++++ b/media_common/agnostic/common/vp/kdll/hal_kerneldll_next.h
+@@ -588,6 +588,7 @@ typedef struct tagKdll_FilterEntry
+ Kdll_Scalingratio ScalingRatio;
+ Kdll_RenderMethod RenderMethod;
+ Kdll_SetCSCCoeffMethod SetCSCCoeffMode;
++ bool forceToTargetColorSpace;
+ } Kdll_FilterEntry, *PKdll_FilterEntry;
+
+ // Structure that defines a compositing filter
+diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_fc_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_fc_kernel.cpp
+index 8e982f67e..f8308fed1 100644
+--- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_fc_kernel.cpp
++++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_fc_kernel.cpp
+@@ -775,6 +775,13 @@ MOS_STATUS VpRenderFcKernel::BuildFilter(
+
+ for (i = 0; (i < (int)compParams->sourceCount) && (iMaxFilterSize > 0); i++)
+ {
++ if (i > 0)
++ {
++ if (!RECT1_CONTAINS_RECT2(compParams->source[0].surf->rcDst, compParams->source[i].surf->rcDst))
++ {
++ pFilter->forceToTargetColorSpace = true;
++ }
++ }
+ src = &compParams->source[i];
+
+ //--------------------------------
+diff --git a/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c b/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c
+index d8f7d429a..151f3b039 100644
+--- a/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c
++++ b/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c
+@@ -2378,6 +2378,7 @@ bool KernelDll_SetupCSC(
+ Kdll_CSC_Matrix curr_matrix;
+ Kdll_CSC_Matrix *matrix = pCSC->Matrix; // Color Space conversion matrix
+ uint8_t * matrixID = pCSC->MatrixID; // CSC coefficient allocation table
++ bool forceToTargetColorSpace = false;
+
+ // Clear all CSC matrices
+ MOS_ZeroMemory(matrix, sizeof(pCSC->Matrix));
+@@ -2395,6 +2396,10 @@ bool KernelDll_SetupCSC(
+ //---------------------------------------------------------------//
+ for (i = iFilterSize, pFilter = pSearchState->Filter; i > 0; i--, pFilter++)
+ {
++ if (pFilter->forceToTargetColorSpace)
++ {
++ forceToTargetColorSpace = true;
++ }
+ // Disable Procamp for all layers except Main Video
+ // Disable Procamp if source is RGB
+ if (pFilter->layer != Layer_MainVideo ||
+@@ -2456,44 +2461,51 @@ bool KernelDll_SetupCSC(
+ //---------------------------------------------------------------//
+ if (sel_cspace == CSpace_Any)
+ {
+- int cs;
+- for (cs = (CSpace_Any + 1); cs < CSpace_Count; cs++)
++ if (forceToTargetColorSpace)
+ {
+- // Skip color spaces not in use
+- cspace = (VPHAL_CSPACE)cs;
+- if (!cspace_in_use[cspace])
+- {
+- continue;
+- }
+-
+- // xvYCC and BT are treated as same for CSC considerations (BT.x to xvYCC.x matrix is I)
+- cspace = KernelDll_TranslateCspace(cspace);
+-
+- // Count # of CS conversions and matrices
+- csc_count = 0;
+- for (i = iFilterSize, pFilter = pSearchState->Filter; i > 0; i--, pFilter++)
++ sel_cspace = out_cspace;
++ }
++ else
++ {
++ int cs;
++ for (cs = (CSpace_Any + 1); cs < CSpace_Count; cs++)
+ {
+- // Ignore layers where the Color Space may be set in software (colorfill, palletized)
+- if (pFilter->cspace == CSpace_Any)
++ // Skip color spaces not in use
++ cspace = (VPHAL_CSPACE)cs;
++ if (!cspace_in_use[cspace])
+ {
+ continue;
+ }
+
+- // Check if CSC/PA is required
+- if (KernelDll_TranslateCspace(pFilter->cspace) != cspace ||
+- pFilter->procamp != DL_PROCAMP_DISABLED)
++ // xvYCC and BT are treated as same for CSC considerations (BT.x to xvYCC.x matrix is I)
++ cspace = KernelDll_TranslateCspace(cspace);
++
++ // Count # of CS conversions and matrices
++ csc_count = 0;
++ for (i = iFilterSize, pFilter = pSearchState->Filter; i > 0; i--, pFilter++)
+ {
+- csc_count++;
++ // Ignore layers where the Color Space may be set in software (colorfill, palletized)
++ if (pFilter->cspace == CSpace_Any)
++ {
++ continue;
++ }
++
++ // Check if CSC/PA is required
++ if (KernelDll_TranslateCspace(pFilter->cspace) != cspace ||
++ pFilter->procamp != DL_PROCAMP_DISABLED)
++ {
++ csc_count++;
++ }
+ }
+- }
+
+- // Save best choice as requiring minimum number of CSC operations
+- if ((sel_csc_count < 0) || // Initial value
+- (csc_count < sel_csc_count) || // Minimum number of CSC operations
+- (csc_count == sel_csc_count && cs == main_cspace)) // Use main cspace as default if same CSC count
+- {
+- sel_cspace = cspace;
+- sel_csc_count = csc_count;
++ // Save best choice as requiring minimum number of CSC operations
++ if ((sel_csc_count < 0) || // Initial value
++ (csc_count < sel_csc_count) || // Minimum number of CSC operations
++ (csc_count == sel_csc_count && cs == main_cspace)) // Use main cspace as default if same CSC count
++ {
++ sel_cspace = cspace;
++ sel_csc_count = csc_count;
++ }
+ }
+ }
+ }
+diff --git a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp
+index 40d0b3fad..e60a6c69c 100644
+--- a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp
++++ b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp
+@@ -2115,9 +2115,8 @@ VAStatus DdiVpFunctions::SetBackgroundColorfill(
+ {
+ DDI_VP_FUNC_ENTER;
+ DDI_VP_CHK_NULL(vpHalRenderParams, "nullptr vpHalRenderParams.", VA_STATUS_ERROR_INVALID_PARAMETER);
+- DDI_VP_CHK_NULL(vpHalRenderParams->pTarget[0],"nullptr pTarget[0].", VA_STATUS_ERROR_INVALID_PARAMETER);
+
+- if ((outBackGroundcolor >> 24) != 0 || vpHalRenderParams->pTarget[0]->ColorSpace == CSpace_sRGB)
++ if ((outBackGroundcolor >> 24) != 0)
+ {
+ if (vpHalRenderParams->pColorFillParams == nullptr)
+ {
+@@ -2126,18 +2125,11 @@ VAStatus DdiVpFunctions::SetBackgroundColorfill(
+
+ DDI_VP_CHK_NULL(vpHalRenderParams->pColorFillParams, "nullptr pColorFillParams.", VA_STATUS_ERROR_UNKNOWN);
+
+- if (vpHalRenderParams->pTarget[0]->ColorSpace == CSpace_sRGB && (outBackGroundcolor >> 24) == 0)
+- {
+- // set color space for sRGB output
+- vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
+- }
+- else
+- {
+- // set background colorfill option
+- vpHalRenderParams->pColorFillParams->Color = outBackGroundcolor;
+- vpHalRenderParams->pColorFillParams->bYCbCr = false;
+- vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
+- }
++ // set background colorfill option
++ vpHalRenderParams->pColorFillParams->Color = outBackGroundcolor;
++ vpHalRenderParams->pColorFillParams->bYCbCr = false;
++ vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
++
+ }
+ else
+ {
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0011-Disable-422H-format-output.patch b/recipes-multimedia/libva/files/0011-Disable-422H-format-output.patch
new file mode 100644
index 00000000..2f4aec1e
--- /dev/null
+++ b/recipes-multimedia/libva/files/0011-Disable-422H-format-output.patch
@@ -0,0 +1,33 @@
+From f8b4d982232d4c1330e1e5f5dcd7cd8ca94decba Mon Sep 17 00:00:00 2001
+From: WenshengZhang <wensheng.zhang@intel.com>
+Date: Thu, 25 Jan 2024 16:35:10 +0800
+Subject: [PATCH 11/12] Disable 422H format output
+
+Disable 422H format output.
+
+Upstream-Status: Backport [https://github.com/intel/media-driver/commit/eab411768e61a46e096793291f5f992eecf76cd8]
+Signed-off-by: Lim, Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../agnostic/common/vp/hal/feature_manager/policy.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp
+index 317cec25a..12f1124fa 100644
+--- a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp
++++ b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp
+@@ -1140,6 +1140,12 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled)
+ bool isAlphaSettingSupportedByVebox =
+ IsAlphaSettingSupportedByVebox(scalingParams->formatInput, scalingParams->formatOutput, scalingParams->pCompAlpha);
+
++ if (scalingParams->formatOutput == Format_422H)
++ {
++ VP_PUBLIC_ASSERTMESSAGE("Scaling not support 422H format output.");
++ return MOS_STATUS_UNIMPLEMENTED;
++ }
++
+ // Clean usedForNextPass flag.
+ if (scalingEngine->usedForNextPass)
+ {
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/files/0012-Decode-Fix-AVC-decode-SFC-4K-hang-issue.patch b/recipes-multimedia/libva/files/0012-Decode-Fix-AVC-decode-SFC-4K-hang-issue.patch
new file mode 100644
index 00000000..1be9139d
--- /dev/null
+++ b/recipes-multimedia/libva/files/0012-Decode-Fix-AVC-decode-SFC-4K-hang-issue.patch
@@ -0,0 +1,32 @@
+From b93904533d3ee66c7919fa8e23d26b852a37a917 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <siew.hoon.lim@intel.com>
+Date: Tue, 30 Jan 2024 13:27:52 +0800
+Subject: [PATCH 12/12] [Decode] Fix AVC decode SFC 4K hang issue
+
+Updated VDSFC input width and height for AVC decode
+
+Upstream-Status: Submitted [https://github.com/intel-innersource/drivers.gpu.unified/pull/151401]
+
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../hal/dec/avc/packet/decode_avc_downsampling_packet.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_downsampling_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_downsampling_packet.cpp
+index e75fd8137..9cc236bd7 100644
+--- a/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_downsampling_packet.cpp
++++ b/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_downsampling_packet.cpp
+@@ -59,6 +59,10 @@ MOS_STATUS AvcDownSamplingPkt::InitSfcParams(VDBOX_SFC_PARAMS &sfcParams)
+
+ AvcBasicFeature *avcBasicFeature = dynamic_cast<AvcBasicFeature*>(m_basicFeature);
+ DECODE_CHK_NULL(avcBasicFeature);
++
++ sfcParams.input.width = avcBasicFeature->m_width;
++ sfcParams.input.height = avcBasicFeature->m_height;
++
+ CODEC_PICTURE curPic = avcBasicFeature->m_avcPicParams->CurrPic;
+
+ if (avcBasicFeature->m_avcPicParams->seq_fields.mb_adaptive_frame_field_flag == true)
+--
+2.40.1
+
diff --git a/recipes-multimedia/libva/intel-media-driver_21.1.3.bb b/recipes-multimedia/libva/intel-media-driver_23.4.3.bb
index 637d8f0a..6513d574 100644
--- a/recipes-multimedia/libva/intel-media-driver_21.1.3.bb
+++ b/recipes-multimedia/libva/intel-media-driver_23.4.3.bb
@@ -19,19 +19,30 @@ REQUIRED_DISTRO_FEATURES = "opengl"
DEPENDS += "libva gmmlib"
SRC_URI = "git://github.com/intel/media-driver.git;protocol=https;nobranch=1 \
+ file://0001-Disable-vp9-padding-on-mtl.patch \
+ file://0002-Force-ARGB-surface-to-tile4-for-ACM.patch \
+ file://0004-Add-device-ID-for-ARL.patch \
+ file://0005-Add-XR24-support-to-DMABuf.patch \
+ file://0006-add-INTEL-MEDIA-ALLOC-refineE-to-specify-the-memory-.patch \
+ file://0007-Skip-report-keys.patch \
+ file://0008-Limit-INTEL-MEDIA-ALLOC-MODE-to-MTL-and-ARL-only.patch \
+ file://0009-Skip-cache-bucket-realloc-for-default-mode-0.patch \
+ file://0010-Fix-failed-4k-video-wall-test-case-and-color-corrupt.patch \
+ file://0011-Disable-422H-format-output.patch \
+ file://0012-Decode-Fix-AVC-decode-SFC-4K-hang-issue.patch \
"
-SRCREV = "bec8e1382637589bc3f302edf6c866bec3d754dd"
+SRCREV = "a9f272496fc0f3e823cc4a814666ea27b443d902"
S = "${WORKDIR}/git"
-COMPATIBLE_HOST_x86-x32 = "null"
+COMPATIBLE_HOST:x86-x32 = "null"
UPSTREAM_CHECK_GITTAGREGEX = "^intel-media-(?P<pver>(?!600\..*)\d+(\.\d+)+)$"
inherit cmake pkgconfig
-MEDIA_DRIVER_ARCH_x86 = "32"
-MEDIA_DRIVER_ARCH_x86-64 = "64"
+MEDIA_DRIVER_ARCH:x86 = "32"
+MEDIA_DRIVER_ARCH:x86-64 = "64"
EXTRA_OECMAKE += " \
-DMEDIA_RUN_TEST_SUITE=OFF \
@@ -39,12 +50,12 @@ EXTRA_OECMAKE += " \
-DMEDIA_BUILD_FATAL_WARNINGS=OFF \
"
-CXXFLAGS_append_x86 = " -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+CXXFLAGS:append:x86 = " -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
-do_configure_prepend_toolchain-clang() {
+do_configure:prepend:toolchain-clang() {
sed -i -e '/-fno-tree-pre/d' ${S}/media_driver/cmake/linux/media_compile_flags_linux.cmake
}
-FILES_${PN} += " \
+FILES:${PN} += " \
${libdir}/dri/ \
"
diff --git a/recipes-multimedia/libva/intel-vaapi-driver_2.4.1.bb b/recipes-multimedia/libva/intel-vaapi-driver_2.4.1.bb
index ccb9fec1..5038d8d7 100644
--- a/recipes-multimedia/libva/intel-vaapi-driver_2.4.1.bb
+++ b/recipes-multimedia/libva/intel-vaapi-driver_2.4.1.bb
@@ -29,6 +29,6 @@ PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)}
PACKAGECONFIG[x11] = "-Dwith_x11=yes, -Dwith_x11=no"
PACKAGECONFIG[wayland] = "-Dwith_wayland=yes, -Dwith_wayland=no, wayland wayland-native virtual/egl"
-FILES_${PN} += "${libdir}/dri/*.so"
-FILES_${PN}-dev += "${libdir}/dri/*.la"
-FILES_${PN}-dbg += "${libdir}/dri/.debug"
+FILES:${PN} += "${libdir}/dri/*.so"
+FILES:${PN}-dev += "${libdir}/dri/*.la"
+FILES:${PN}-dbg += "${libdir}/dri/.debug"
diff --git a/recipes-multimedia/libyami/libyami-utils/0001-Fix-build-with-clang.patch b/recipes-multimedia/libyami/libyami-utils/0001-Fix-build-with-clang.patch
deleted file mode 100644
index f7de9d16..00000000
--- a/recipes-multimedia/libyami/libyami-utils/0001-Fix-build-with-clang.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From f2e6d2ecfea635ab952649156e31ca893d4b1a47 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 12 Aug 2017 08:49:20 -0700
-Subject: [PATCH] Fix build with clang
-
-Fix errors e.g.
-error: comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]error: comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
-
-and
-
-psnr.cpp:225:17: error: bool literal returned from 'main' [-Werror,-Wmain]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
----
- tests/decodehelp.cpp | 2 +-
- tests/encodehelp.h | 2 +-
- tests/vpp.cpp | 2 +-
- tests/yamitranscode.cpp | 2 +-
- testscripts/psnr.cpp | 4 ++--
- 5 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/tests/decodehelp.cpp b/tests/decodehelp.cpp
-index b27b977..62cca63 100644
---- a/tests/decodehelp.cpp
-+++ b/tests/decodehelp.cpp
-@@ -81,7 +81,7 @@ bool processCmdLine(int argc, char** argv, DecodeParameter* parameters)
- { NULL, no_argument, NULL, 0 }
- };
-
-- char opt;
-+ int opt;
- while ((opt = getopt_long_only(argc, argv, "h:m:n:i:f:o:w:?", long_opts,&option_index)) != -1){
- switch (opt) {
- case 'h':
-diff --git a/tests/encodehelp.h b/tests/encodehelp.h
-index 63580a4..651ec08 100644
---- a/tests/encodehelp.h
-+++ b/tests/encodehelp.h
-@@ -109,7 +109,7 @@ static VideoRateControl string_to_rc_mode(char *str)
-
- static bool process_cmdline(int argc, char *argv[])
- {
-- char opt;
-+ int opt;
- const struct option long_opts[] = {
- { "help", no_argument, NULL, 'h' },
- { "qp", required_argument, NULL, 0 },
-diff --git a/tests/vpp.cpp b/tests/vpp.cpp
-index 5a60c0a..52da43b 100644
---- a/tests/vpp.cpp
-+++ b/tests/vpp.cpp
-@@ -151,7 +151,7 @@ public:
- private:
- bool processCmdLine(int argc, char* argv[])
- {
-- char opt;
-+ int opt;
- const struct option long_opts[] = {
- { "help", no_argument, NULL, 'h' },
- { "sharpening", required_argument, NULL, 's' },
-diff --git a/tests/yamitranscode.cpp b/tests/yamitranscode.cpp
-index 6207209..00164ce 100755
---- a/tests/yamitranscode.cpp
-+++ b/tests/yamitranscode.cpp
-@@ -100,7 +100,7 @@ static VideoRateControl string_to_rc_mode(char *str)
-
- static bool processCmdLine(int argc, char *argv[], TranscodeParams& para)
- {
-- char opt;
-+ int opt;
- const struct option long_opts[] = {
- { "help", no_argument, NULL, 'h' },
- { "qp", required_argument, NULL, 0 },
-diff --git a/testscripts/psnr.cpp b/testscripts/psnr.cpp
-index 5cc24c9..68bd668 100644
---- a/testscripts/psnr.cpp
-+++ b/testscripts/psnr.cpp
-@@ -215,14 +215,14 @@ int main(int argc, char *argv[])
- const char* psnrresult = "average_psnr.txt";
- int width=0,height=0;
- int standardpsnr = NORMAL_PSNR;
-- char opt;
-+ int opt;
- while ((opt = getopt(argc, argv, "h:W:H:i:o:s:?")) != -1)
- {
- switch (opt) {
- case 'h':
- case '?':
- print_help(argv[0]);
-- return false;
-+ return -1;
- case 'i':
- filename1 = optarg;
- break;
diff --git a/recipes-multimedia/libyami/libyami-utils_1.3.2.bb b/recipes-multimedia/libyami/libyami-utils_1.3.2.bb
deleted file mode 100644
index f9333f3d..00000000
--- a/recipes-multimedia/libyami/libyami-utils_1.3.2.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "Applications and Scripts for libyami."
-DESCRIPTION = "Applications and Scripts for libyami."
-
-HOMEPAGE = "https://github.com/intel/libyami-utils"
-BUGTRACKER = "https://github.com/intel/libyami-utils/issues/new"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
-
-SRC_URI = "git://github.com/intel/libyami-utils.git \
- file://0001-Fix-build-with-clang.patch \
- "
-SRCREV = "c3d25b64b05aeb0c4eecc140aef617cfeced6b8e"
-S = "${WORKDIR}/git"
-
-DEPENDS = "libva libyami"
-
-inherit autotools pkgconfig features_check
-
-REQUIRED_DISTRO_FEATURES = "opengl"
-
-PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
-
-# --enable-x11 needs libva-x11
-# gles-tests fail to build without x11: see https://github.com/intel/libyami-utils/issues/91
-PACKAGECONFIG[x11] = "--enable-x11 --enable-egl,--disable-x11 --disable-egl, virtual/libx11"
diff --git a/recipes-multimedia/libyami/libyami_1.3.2.bb b/recipes-multimedia/libyami/libyami_1.3.2.bb
deleted file mode 100644
index c8628141..00000000
--- a/recipes-multimedia/libyami/libyami_1.3.2.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "Yami is media infrastructure base on libva"
-DESCRIPTION = "Yet Another Media Infrastructure \
-light weight hardware codec library base on VA-API "
-
-HOMEPAGE = "https://github.com/intel/libyami"
-BUGTRACKER = "https://github.com/intel/libyami/issues/new"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE.md;md5=3b83ef96387f14655fc854ddc3c6bd57"
-
-SRC_URI = "git://github.com/intel/libyami.git;branch=apache \
-"
-SRCREV = "08606d0a43e0ef15e5b61cc13563169370ce8715"
-S = "${WORKDIR}/git"
-
-CXXFLAGS_append = " -Wno-error"
-
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)}"
-PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxrandr libxrender"
-
-DEPENDS = "libva"
-inherit autotools pkgconfig features_check
-
-REQUIRED_DISTRO_FEATURES = "opengl"
diff --git a/recipes-multimedia/mediasdk/files/0001-Don-t-try-to-autheticate-with-render-node.patch b/recipes-multimedia/mediasdk/files/0001-Don-t-try-to-autheticate-with-render-node.patch
deleted file mode 100644
index d424b68d..00000000
--- a/recipes-multimedia/mediasdk/files/0001-Don-t-try-to-autheticate-with-render-node.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 6945cd0ad84855ab4a2dc40016879fb5fc7f2b6a Mon Sep 17 00:00:00 2001
-From: Vincent Cheah Beng Keat <vincent.beng.keat.cheah@intel.com>
-Date: Wed, 7 Apr 2021 05:30:15 +0000
-Subject: [PATCH] Don't try to autheticate with render node
-
-Replicate similar libVA wayland change.
-https://github.com/intel/libva/commit/283f776a9649dcef58b47958c1269499adfa1cd4
-
-Platform: ADL-S, EHL, TGL
-OS: Yocto native wayland weston
-Tested:
- ./sample_decode h265 -i Puppies_3840x2160.265 -rwld -rgb4
-
-Issue: #2592
-
-Upstream-Status: Backport [https://github.com/Intel-Media-SDK/MediaSDK/commit/6945cd0ad84855ab4a2dc40016879fb5fc7f2b6a]
-
-Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
----
- samples/sample_misc/wayland/src/class_wayland.cpp | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/samples/sample_misc/wayland/src/class_wayland.cpp b/samples/sample_misc/wayland/src/class_wayland.cpp
-index 62f326e3..4a0beed3 100644
---- a/samples/sample_misc/wayland/src/class_wayland.cpp
-+++ b/samples/sample_misc/wayland/src/class_wayland.cpp
-@@ -433,8 +433,12 @@ void Wayland::DrmHandleDevice(const char *name)
- m_device_name << "\n";
- return;
- }
-- drmGetMagic(m_fd, &magic);
-- wl_drm_authenticate(m_drm, magic);
-+
-+ int type = drmGetNodeTypeFromFd(m_fd);
-+ if (type != DRM_NODE_RENDER) {
-+ drmGetMagic(m_fd, &magic);
-+ wl_drm_authenticate(m_drm, magic);
-+ }
- }
-
- void Wayland::DrmHandleAuthenticated()
---
-2.24.3
-
diff --git a/recipes-multimedia/mediasdk/files/fix-gcc13.patch b/recipes-multimedia/mediasdk/files/fix-gcc13.patch
new file mode 100644
index 00000000..fb973870
--- /dev/null
+++ b/recipes-multimedia/mediasdk/files/fix-gcc13.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inactive-Upstream
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+
+diff --git a/api/mfx_dispatch/linux/mfxparser.cpp b/api/mfx_dispatch/linux/mfxparser.cpp
+index 9d3823ec3e..12e46d1881 100644
+--- a/api/mfx_dispatch/linux/mfxparser.cpp
++++ b/api/mfx_dispatch/linux/mfxparser.cpp
+@@ -20,6 +20,7 @@
+
+ #include <ctype.h>
+ #include <stdio.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+
diff --git a/recipes-multimedia/mediasdk/intel-mediasdk_21.1.3.bb b/recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb
index b3a30bc4..f00a4404 100644
--- a/recipes-multimedia/mediasdk/intel-mediasdk_21.1.3.bb
+++ b/recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb
@@ -12,12 +12,14 @@ CVE_DETAILS = "intel:media_sdk"
# Only for 64 bit until media-driver issues aren't fixed
COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_x86-x32 = "null"
+COMPATIBLE_HOST:x86-x32 = "null"
inherit features_check
REQUIRED_DISTRO_FEATURES = "opengl"
-DEPENDS += "libdrm libva intel-media-driver"
+DEPENDS += "libva"
+
+RDEPENDS:${PN} += "intel-media-driver"
PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "dri3", "", d)} \
${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)} \
@@ -27,16 +29,16 @@ PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "dri3", "", d)
PACKAGECONFIG[dri3] = "-DENABLE_X11_DRI3=ON, -DENABLE_X11_DRI3=OFF"
PACKAGECONFIG[itt] = "-DENABLE_ITT=ON, -DENABLE_ITT=OFF, itt"
-PACKAGECONFIG[opencl] = "-DENABLE_OPENCL=ON, -DENABLE_OPENCL=OFF, ocl-icd opencl-clhpp opencl-headers"
+PACKAGECONFIG[opencl] = "-DENABLE_OPENCL=ON, -DENABLE_OPENCL=OFF, virtual/opencl-icd opencl-clhpp opencl-headers"
PACKAGECONFIG[samples] = "-DBUILD_SAMPLES=ON, -DBUILD_SAMPLES=OFF"
PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND=ON, -DENABLE_WAYLAND=OFF, wayland wayland-native"
SRC_URI = "git://github.com/Intel-Media-SDK/MediaSDK.git;protocol=https;nobranch=1;lfs=0 \
file://0001-FindITT.cmake-fix-detection-of-header-library.patch \
- file://0001-Don-t-try-to-autheticate-with-render-node.patch \
+ file://fix-gcc13.patch \
"
-SRCREV = "03164a0b491651c210abd4549ca5275ac974d105"
+SRCREV = "869b60a6c3d7b5e9f7c3b3b914986322dca4bbae"
S = "${WORKDIR}/git"
UPSTREAM_CHECK_GITTAGREGEX = "^intel-mediasdk-(?P<pver>(\d+(\.\d+)+))$"
@@ -45,17 +47,17 @@ inherit cmake pkgconfig
EXTRA_OECMAKE += "-DMFX_INCLUDE=${S}/api/include"
-do_install_append() {
+do_install:append() {
mv ${D}${datadir}/mfx/samples ${D}${libdir}/mfx/samples
}
PACKAGE_BEFORE_PN = " ${PN}-samples"
-FILES_${PN} += " \
+FILES:${PN} += " \
${libdir}/mfx \
${datadir}/mfx/plugins.cfg \
"
-FILES_${PN}-samples = "${libdir}/mfx/samples"
+FILES:${PN}-samples = "${libdir}/mfx/samples"
-INSANE_SKIP_${PN}-samples += "staticdev"
+INSANE_SKIP:${PN}-samples += "staticdev"
diff --git a/recipes-multimedia/onevpl/files/0001-ARLH-DID-open-source-6286.patch b/recipes-multimedia/onevpl/files/0001-ARLH-DID-open-source-6286.patch
new file mode 100644
index 00000000..8d1f3380
--- /dev/null
+++ b/recipes-multimedia/onevpl/files/0001-ARLH-DID-open-source-6286.patch
@@ -0,0 +1,39 @@
+From a425927469b36e7bc597bff4fdc24d42a1168d1a Mon Sep 17 00:00:00 2001
+From: gfxVPLsdm <gfxvplsdm@intel.com>
+Date: Mon, 18 Dec 2023 09:58:35 +0800
+Subject: [PATCH] ARLH DID open source (#6286)
+
+Co-authored-by: huangli <li.h.huang@intel.com>
+
+Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/66f1b4d60a367eb1b0774e0b4369f906e0e632ae]
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+
+---
+ _studio/shared/include/mfxstructures-int.h | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/_studio/shared/include/mfxstructures-int.h b/_studio/shared/include/mfxstructures-int.h
+index 363d9a63..8f16b0a8 100644
+--- a/_studio/shared/include/mfxstructures-int.h
++++ b/_studio/shared/include/mfxstructures-int.h
+@@ -1,4 +1,4 @@
+-// Copyright (c) 2007-2021 Intel Corporation
++// Copyright (c) 2007-2023 Intel Corporation
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
+ // of this software and associated documentation files (the "Software"), to deal
+@@ -569,6 +569,11 @@ typedef struct {
+ /* ARL S */
+ { 0x7D67, MFX_HW_ARL, MFX_GT2 },
+
++ /* ARL H*/
++ { 0x7D51, MFX_HW_ARL, MFX_GT2 },
++ { 0x7DD1, MFX_HW_ARL, MFX_GT2 },
++ { 0x7D41, MFX_HW_ARL, MFX_GT2 },
++
+ };
+
+ /*
+--
+2.40.1
+
diff --git a/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch b/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch
new file mode 100644
index 00000000..8e014c97
--- /dev/null
+++ b/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch
@@ -0,0 +1,32 @@
+From e118062518c95d8fb0080cc8276b123a90bd0eb9 Mon Sep 17 00:00:00 2001
+From: gfxVPLsdm <gfxvplsdm@intel.com>
+Date: Wed, 21 Feb 2024 17:11:52 +0800
+Subject: [PATCH] Fix SetBuffersYV12() V & U plane offsets calculation (#6475)
+
+Signed-off-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com>
+Co-authored-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com>
+
+Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/ce704ddfe11724767ba86c9425a3917dc3100d4a]
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ _studio/shared/src/libmfx_core_vaapi.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/_studio/shared/src/libmfx_core_vaapi.cpp b/_studio/shared/src/libmfx_core_vaapi.cpp
+index 2cad86f8..fd5fc269 100644
+--- a/_studio/shared/src/libmfx_core_vaapi.cpp
++++ b/_studio/shared/src/libmfx_core_vaapi.cpp
+@@ -462,8 +462,8 @@ public:
+ }
+ else
+ {
+- eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[1] / 2);
+- eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[2] / 2);
++ eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[0]);
++ eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[1] / 2);
+ }
+ eb.num_planes = 3;
+ eb.data_size = eb.offsets[2] + (eb.height * eb.pitches[2] / 2);
+--
+2.40.1
+
diff --git a/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch b/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch
new file mode 100644
index 00000000..e3854407
--- /dev/null
+++ b/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch
@@ -0,0 +1,96 @@
+From 40c0bc6d3dfe172dd25908df2c16de29c34fa4d4 Mon Sep 17 00:00:00 2001
+From: gfxVPLsdm <gfxvplsdm@intel.com>
+Date: Mon, 5 Feb 2024 17:14:07 +0800
+Subject: [PATCH] [JPEGe] Enable BGR4 JPEG Enc support (#6470)
+
+Co-authored-by: vcheah <vincent.beng.keat.cheah@intel.com>
+
+Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/e73763d05f8fdc348c356b58dcb83075b5e868f8]
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ .../mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp | 6 ++++--
+ .../encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | 9 +++++----
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
+index 141564b1..332f6372 100644
+--- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
++++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
+@@ -212,7 +212,8 @@ mfxStatus MFXVideoENCODEMJPEG_HW::QueryImplsDescription(
+ ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YV12;
+ ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUY2;
+ ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_RGB4;
+- memCaps.NumColorFormats = 4;
++ ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_BGR4;
++ memCaps.NumColorFormats = 5;
+
+ ah.PushBack(profileCaps.MemDesc);
+ profileCaps.MemDesc[1] = profileCaps.MemDesc[0];
+@@ -392,7 +393,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Query(VideoCORE * core, mfxVideoParam *in, mfx
+ if ((fourCC == 0 && chromaFormat == 0) ||
+ (fourCC == MFX_FOURCC_NV12 && (chromaFormat == MFX_CHROMAFORMAT_YUV420 || chromaFormat == MFX_CHROMAFORMAT_YUV400)) ||
+ (fourCC == MFX_FOURCC_YUY2 && chromaFormat == MFX_CHROMAFORMAT_YUV422H) ||
+- (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444))
++ ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444))
+ {
+ out->mfx.FrameInfo.FourCC = in->mfx.FrameInfo.FourCC;
+ out->mfx.FrameInfo.ChromaFormat = in->mfx.FrameInfo.ChromaFormat;
+@@ -698,6 +699,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Init(mfxVideoParam *par)
+ doubleBytesPerPx = 4;
+ break;
+ case MFX_FOURCC_RGB4:
++ case MFX_FOURCC_BGR4:
+ default:
+ doubleBytesPerPx = 8;
+ break;
+diff --git a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
+index 3fc619d1..b1ab556e 100644
+--- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
++++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
+@@ -108,6 +108,7 @@ mfxStatus MfxHwMJpegEncode::CheckJpegParam(VideoCORE *core, mfxVideoParam & par,
+ BytesPerPx = 2;
+ break;
+ case MFX_FOURCC_RGB4:
++ case MFX_FOURCC_BGR4:
+ default:
+ BytesPerPx = 4;
+ }
+@@ -157,7 +158,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
+
+ m_payload_base.length = 0;
+ m_payload_list.clear();
+- if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444)
++ if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)
+ {
+ m_app14_data.header = 0xEEFF;//APP14
+ m_app14_data.lenH = 0;
+@@ -287,7 +288,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
+ m_pps.num_components = 3;
+ else if (fourCC == MFX_FOURCC_NV12 && chromaFormat == MFX_CHROMAFORMAT_YUV400)
+ m_pps.num_components = 1;
+- else if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444)
++ else if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)
+ m_pps.num_components = 3;
+ else
+ MFX_RETURN(MFX_ERR_UNDEFINED_BEHAVIOR);
+@@ -341,7 +342,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
+ {
+ // No external tables - use Quality parameter
+ m_dqt_list.resize(0);
+- if (fourCC == MFX_FOURCC_RGB4)
++ if (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4)
+ {
+ m_pps.quantiser_table_selector[0] = 0;
+ m_pps.quantiser_table_selector[1] = 0;
+@@ -393,7 +394,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
+ {
+ m_dht_list.resize(0);
+ }
+- else if (hwCaps->MaxNumHuffTable == 1 || fourCC == MFX_FOURCC_RGB4)
++ else if (hwCaps->MaxNumHuffTable == 1 || (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4))
+ {
+ m_dht_list.resize(1);
+
+--
+2.40.1
+
diff --git a/recipes-multimedia/onevpl/files/0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch b/recipes-multimedia/onevpl/files/0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch
new file mode 100644
index 00000000..762a4902
--- /dev/null
+++ b/recipes-multimedia/onevpl/files/0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch
@@ -0,0 +1,28 @@
+From 630c32194f53c70f4f654fb3d198790df253ba1f Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Thu, 15 Jun 2023 13:43:32 +0200
+Subject: [PATCH] vpl.pc.in: dont pass pcfiledir to cflags
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+
+Upstream-Status: Inappropriate [oe specific]
+---
+ libvpl/pkgconfig/vpl.pc.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libvpl/pkgconfig/vpl.pc.in b/libvpl/pkgconfig/vpl.pc.in
+index ab468a9..05c020e 100644
+--- a/libvpl/pkgconfig/vpl.pc.in
++++ b/libvpl/pkgconfig/vpl.pc.in
+@@ -8,6 +8,6 @@ Description: oneAPI Video Processing Library
+ Version: @API_VERSION_MAJOR@.@API_VERSION_MINOR@
+ URL: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onevpl.html
+
+-Libs: -L${libdir} -l@OUTPUT_NAME@ @VPL_PKGCONFIG_DEPENDENT_LIBS@
++Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@OUTPUT_NAME@ @VPL_PKGCONFIG_DEPENDENT_LIBS@
+ Libs.private: @VPL_PKGCONFIG_PRIVATE_LIBS@
+-Cflags: -I${includedir} -I${includedir}/vpl
++Cflags: -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/vpl
+--
+2.40.1
+
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb
new file mode 100644
index 00000000..0b849bf1
--- /dev/null
+++ b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Intel(R) oneVPL runtime for Intel GPU accelerated media processing"
+DESCRIPTION = "Intel(R) oneVPL runtime provides an runtime to access hardware-accelerated \
+video decode, encode and filtering on Intel® graphics."
+
+HOMEPAGE = "https://github.com/oneapi-src/oneVPL-intel-gpu"
+BUGTRACKER = "https://github.com/oneapi-src/oneVPL-intel-gpu/issues"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb8cb45b9b57dbaa9fcc9adc4230202b"
+
+PE = "1"
+
+# Only for 64 bit
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:x86-x32 = "null"
+
+DEPENDS += "libdrm libva intel-media-driver onevpl pkgconfig-native"
+RDEPENDS:${PN} += "intel-media-driver"
+
+SRC_URI = "git://github.com/oneapi-src/oneVPL-intel-gpu.git;protocol=https;nobranch=1;lfs=0 \
+ file://0001-ARLH-DID-open-source-6286.patch \
+ file://0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch \
+ file://0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch \
+ "
+
+SRCREV = "852fa9f705ef44c004d014548601f3804a6de705"
+S = "${WORKDIR}/git"
+
+FILES:${PN} += " \
+ ${libdir}/libmfx-gen/enctools.so \
+ "
+
+inherit cmake
diff --git a/recipes-multimedia/onevpl/onevpl_2023.4.0.bb b/recipes-multimedia/onevpl/onevpl_2023.4.0.bb
new file mode 100644
index 00000000..513c7f2c
--- /dev/null
+++ b/recipes-multimedia/onevpl/onevpl_2023.4.0.bb
@@ -0,0 +1,40 @@
+SUMMARY = "oneAPI Video Processing Library"
+DESCRIPTION = "The oneAPI Video Processing Library (oneVPL) provides \
+a single video processing API for encode, decode, and video processing \
+that works across a wide range of accelerators."
+
+HOMEPAGE = "https://github.com/oneapi-src/oneVPL"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c18ea6bb4786a26bf4eee88a7424a408 \
+ file://third-party-programs.txt;md5=0e35a23482445dd089b4eabe19103a06"
+
+SRC_URI = "git://github.com/oneapi-src/oneVPL.git;protocol=https;branch=master \
+ file://0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch \
+ "
+SRCREV = "2274efcd3672b43297ef774f332e1fed6781381c"
+S = "${WORKDIR}/git"
+
+inherit cmake
+DEPENDS += "libva pkgconfig-native"
+
+PACKAGECONFIG ??= "tools"
+PACKAGECONFIG[tools] = "-DBUILD_TOOLS=ON, -DBUILD_TOOLS=OFF, wayland wayland-native wayland-protocols"
+
+do_install:append() {
+ mkdir -p ${D}${datadir}/oneVPL/samples
+ mv ${D}${bindir}/sample_* ${D}${datadir}/oneVPL/samples
+}
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+
+PACKAGES =+ "${PN}-examples"
+
+FILES:${PN}-examples = "${datadir}/vpl \
+ "
+
+FILES_SOLIBSDEV = ""
+FILES:${PN}-dev += "${libdir}/libvpl.so"
+
+FILES:${PN} += " ${datadir}/oneVPL/samples \
+ ${libdir}/vpl/libvpl_wayland.so \
+ "
diff --git a/recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch b/recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch
new file mode 100644
index 00000000..58ed1c9a
--- /dev/null
+++ b/recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch
@@ -0,0 +1,27 @@
+From efedbf9080c19241c2aa9ee7ba901245d38c8fa2 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <naveen.kumar.saini@intel.com>
+Date: Mon, 7 Mar 2022 16:44:24 +0800
+Subject: [PATCH 1/2] CMakeLists.txt: exclude host system headers
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ sources/ippcp/crypto_mb/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/sources/ippcp/crypto_mb/CMakeLists.txt b/sources/ippcp/crypto_mb/CMakeLists.txt
+index c4cc82a..4094f34 100644
+--- a/sources/ippcp/crypto_mb/CMakeLists.txt
++++ b/sources/ippcp/crypto_mb/CMakeLists.txt
+@@ -82,7 +82,6 @@ include_directories(
+ ${CRYPTO_MB_INCLUDE_DIR}
+ ${OPENSSL_INCLUDE_DIR}
+ $<$<C_COMPILER_ID:Intel>:$ENV{ROOT}/compiler/include $ENV{ROOT}/compiler/include/icc>
+- $<$<NOT:$<C_COMPILER_ID:Intel>>:${CMAKE_SYSTEM_INCLUDE_PATH}>
+ $<$<OR:$<C_COMPILER_ID:Intel>,$<BOOL:${MSVC_IDE}>>:$ENV{INCLUDE}>
+ )
+
+--
+2.17.1
+
diff --git a/recipes-oneapi/crypto/intel-crypto-mb/0001-crypto-mb-Make-sure-libs-are-installed-correctly.patch b/recipes-oneapi/crypto/intel-crypto-mb/0001-crypto-mb-Make-sure-libs-are-installed-correctly.patch
new file mode 100644
index 00000000..c47c8de5
--- /dev/null
+++ b/recipes-oneapi/crypto/intel-crypto-mb/0001-crypto-mb-Make-sure-libs-are-installed-correctly.patch
@@ -0,0 +1,42 @@
+From 3b7b4eca54aa8d851e37f60c74e4a027fa7b21f2 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 14 Jun 2023 13:18:45 +0800
+Subject: [PATCH] crypto-mb: Make sure libs are installed correctly
+
+Dont assume that "lib" is always the correct destination. This fixes
+multilib builds when libdir != /usr/lib.
+
+Upstream-Status: Pending
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ sources/ippcp/crypto_mb/src/CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sources/ippcp/crypto_mb/src/CMakeLists.txt b/sources/ippcp/crypto_mb/src/CMakeLists.txt
+index c9cad06..31f52bd 100644
+--- a/sources/ippcp/crypto_mb/src/CMakeLists.txt
++++ b/sources/ippcp/crypto_mb/src/CMakeLists.txt
+@@ -123,8 +123,8 @@ endif(DYNAMIC_LIB OR MB_STANDALONE)
+ # Installation of the shared library
+ if (MB_STANDALONE) # standalone crypto_mb's cmake run
+ install(TARGETS ${MB_DYN_LIB_TARGET}
+- LIBRARY DESTINATION "lib"
+- RUNTIME DESTINATION "lib"
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION "include/crypto_mb")
+ elseif (DYNAMIC_LIB) # build from ippcp's cmake
+ install(TARGETS ${MB_DYN_LIB_TARGET}
+@@ -154,7 +154,7 @@ endif()
+ # Static lib installation
+ if(MB_STANDALONE)
+ install(TARGETS ${MB_STATIC_LIB_TARGET}
+- ARCHIVE DESTINATION "lib"
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION "include/crypto_mb")
+ else()
+ install(TARGETS ${MB_STATIC_LIB_TARGET}
+--
+2.37.3
+
diff --git a/recipes-oneapi/crypto/intel-crypto-mb/0002-cmake-exclude-Yocto-build-flags.patch b/recipes-oneapi/crypto/intel-crypto-mb/0002-cmake-exclude-Yocto-build-flags.patch
new file mode 100644
index 00000000..62b56ea2
--- /dev/null
+++ b/recipes-oneapi/crypto/intel-crypto-mb/0002-cmake-exclude-Yocto-build-flags.patch
@@ -0,0 +1,45 @@
+From b4549bb765d279b5ba042c6340e1dd69d0890b64 Mon Sep 17 00:00:00 2001
+From: Naveen Saini <naveen.kumar.saini@intel.com>
+Date: Thu, 10 Mar 2022 14:30:01 +0800
+Subject: [PATCH 2/2] cmake: exclude Yocto build flags
+
+Ipp-crypto has its own set of flags and -march values,
+which causes conflict with default -march=nehalem in gcc
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
+---
+ sources/ippcp/crypto_mb/src/CMakeLists.txt | 2 +-
+ sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sources/ippcp/crypto_mb/src/CMakeLists.txt b/sources/ippcp/crypto_mb/src/CMakeLists.txt
+index 1ca1a8c..5284d62 100644
+--- a/sources/ippcp/crypto_mb/src/CMakeLists.txt
++++ b/sources/ippcp/crypto_mb/src/CMakeLists.txt
+@@ -81,7 +81,7 @@ endif()
+ set(MB_LIB_TARGET ${MB_DYN_LIB_TARGET})
+
+ set_source_files_properties(${CRYPTO_MB_SOURCES} PROPERTIES COMPILE_DEFINITIONS "${AVX512_LIBRARY_DEFINES}"
+- COMPILE_FLAGS "${AVX512_CFLAGS} ${CMAKE_ASM_FLAGS} ${CMAKE_C_FLAGS_SECURITY}")
++ COMPILE_FLAGS "${AVX512_CFLAGS} ${CMAKE_C_FLAGS_SECURITY}")
+
+ # Don't specify architectural flags for the assembler for this sources, because of the bug in Intel® C Compiler under MacOS: error: invalid instruction mnemonic 'vkmovb'
+ # The bug has been fixed since version 2021.3. This is a workaround to support older versions of Intel® C Compiler.
+diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
+index a2abeeb..aadd6e2 100644
+--- a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
++++ b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
+@@ -58,7 +58,7 @@ set(LINK_FLAGS_DYNAMIC "${LINK_FLAGS_DYNAMIC} ${CRYPTO_MB_SOURCES_DIR}/cmake/dll
+ # Compiler flags
+
+ # Tells the compiler to align functions and loops
+-set(CMAKE_C_FLAGS " -falign-functions=32 -falign-loops=32")
++set(CMAKE_C_FLAGS " -falign-functions=32 -falign-loops=32 ${TOOLCHAIN_OPTIONS}")
+ # Ensures that compilation takes place in a freestanding environment
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding")
+
+--
+2.17.1
+
diff --git a/recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb b/recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb
new file mode 100644
index 00000000..be72fd85
--- /dev/null
+++ b/recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Crypto Multi-buffer Library"
+DESCRIPTION = "Intel® Integrated Performance Primitives (Intel® IPP) Cryptography \
+is a secure, fast and lightweight library of building blocks for cryptography, \
+highly-optimized for various Intel® CPUs."
+HOMEPAGE = "https://github.com/intel/ipp-crypto"
+
+LICENSE = "Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://../../../LICENSE;md5=e787af283468feca985d6b865d27d95b"
+
+IPP_BRANCH = "ipp-crypto_${@'_'.join(d.getVar('PV').rsplit('.')[-3:])}"
+
+SRC_URI = "git://github.com/intel/ipp-crypto;protocol=https;branch=${IPP_BRANCH} \
+ file://0001-CMakeLists.txt-exclude-host-system-headers.patch;striplevel=4 \
+ file://0002-cmake-exclude-Yocto-build-flags.patch;striplevel=4 \
+ file://0001-crypto-mb-Make-sure-libs-are-installed-correctly.patch;striplevel=4 \
+ "
+SRCREV = "d02611e34328898d16025467d3deeb7d62b6076b"
+
+S = "${WORKDIR}/git/sources/ippcp/crypto_mb"
+
+DEPENDS = "openssl"
+
+inherit cmake pkgconfig
+COMPATIBLE_HOST = '(x86_64).*-linux'
+
+EXTRA_OECMAKE += " -DARCH=intel64"
+EXTRA_OECMAKE += " -DTOOLCHAIN_OPTIONS='${TOOLCHAIN_OPTIONS}'"
diff --git a/recipes-oneapi/onedpl/onedpl_2022.3.0.bb b/recipes-oneapi/onedpl/onedpl_2022.3.0.bb
new file mode 100644
index 00000000..d80b64c9
--- /dev/null
+++ b/recipes-oneapi/onedpl/onedpl_2022.3.0.bb
@@ -0,0 +1,26 @@
+SUMMARY = "oneAPI DPC++ Library (oneDPL)"
+DESCRIPTION = "The oneAPI DPC++ Library (oneDPL) aims to work with the \
+oneAPI DPC++ Compiler to provide high-productivity APIs to developers, \
+which can minimize DPC++ programming efforts across devices for high \
+performance parallel applications."
+HOMEPAGE = "https://github.com/oneapi-src/oneDPL"
+
+LICENSE = "Apache-2.0-with-LLVM-exception"
+LIC_FILES_CHKSUM = "file://licensing/LICENSE.txt;md5=2e982d844baa4df1c80de75470e0c5cb \
+ file://licensing/third-party-programs.txt;md5=cfb8d6b1f04a8fcc7d0dddd817619634"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://github.com/oneapi-src/oneDPL.git;protocol=https;branch=release/2022.3 \
+ "
+SRCREV = "180f18ad25fbc39fa13bad43f1df7d54ee8f5609"
+
+do_compile[noexec] = "1"
+do_configure[noexec] = "1"
+
+do_install() {
+ install -d -m 755 ${D}${includedir}/onedpl
+ cp -r ${S}/include/* ${D}${includedir}/onedpl
+}
+
+UPSTREAM_CHECK_GITTAGREGEX = "^oneDPL-(?P<pver>(\d+(\.\d+)+))-release$"
diff --git a/recipes-oneapi/setup-oneapi-env/files/intel-oneapi-runtime.conf b/recipes-oneapi/setup-oneapi-env/files/intel-oneapi-runtime.conf
new file mode 100644
index 00000000..5faf9854
--- /dev/null
+++ b/recipes-oneapi/setup-oneapi-env/files/intel-oneapi-runtime.conf
@@ -0,0 +1,4 @@
+/opt/intel/oneapi/lib
+/opt/intel/oneapi/lib/intel64
+/opt/intel/oneapi/lib/ia32
+/opt/intel/oneapi/lib/emu
diff --git a/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb b/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb
new file mode 100644
index 00000000..702f794e
--- /dev/null
+++ b/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Intel® oneAPI runtime libraries environment set up"
+DESCRIPTION = "Recipe to set up the environment for Intel® oneAPI runtime libraries \
+via configuration file in ld.so.conf.d directory."
+
+LICENSE = "EULA"
+LIC_FILES_CHKSUM = "file://${CUSTOM_LICENSES_PATH}/EULA;md5=7bfc91523de2e84e7131d0eacf2827d4"
+
+SRC_URI = "file://intel-oneapi-runtime.conf"
+
+do_install() {
+ mkdir -p ${D}${sysconfdir}/ld.so.conf.d/
+ install -m 644 ${WORKDIR}/intel-oneapi-runtime.conf ${D}${sysconfdir}/ld.so.conf.d/
+}
+
+pkg_postinst_ontarget:${PN}() {
+if [ x"$D" = "x" ]; then
+ if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
+fi
+}
+BBCLASSEXTEND = "native nativesdk"
diff --git a/recipes-selftest/images/secureboot-selftest-image-unsigned.bb b/recipes-selftest/images/secureboot-selftest-image-unsigned.bb
index e03e7b47..d0fa6405 100644
--- a/recipes-selftest/images/secureboot-selftest-image-unsigned.bb
+++ b/recipes-selftest/images/secureboot-selftest-image-unsigned.bb
@@ -1,12 +1,12 @@
require recipes-core/images/core-image-minimal.bb
-DEPENDS_remove = "grub-efi"
+DEPENDS:remove = "grub-efi"
inherit uefi-comboapp
WKS_FILE = "generic-bootdisk.wks.in"
-do_uefiapp_deploy_append() {
+do_uefiapp_deploy:append() {
for i in ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.boot*.efi; do
target=`basename $i`
target=`echo $target | sed -e 's/${IMAGE_LINK_NAME}.//'`
diff --git a/recipes-support/isa-l/isa-l_2.30.0.bb b/recipes-support/isa-l/isa-l_2.31.0.bb
index f06fd0b7..d5d09002 100644
--- a/recipes-support/isa-l/isa-l_2.30.0.bb
+++ b/recipes-support/isa-l/isa-l_2.31.0.bb
@@ -2,16 +2,18 @@ SUMMARY = "Intelligent Storage Acceleration Library"
DESCRIPTION = "ISA-L is a collection of optimized low-level functions \
targeting storage applications."
LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e6c7d82ad7dd512687b0991a159a1ca9"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2476688d0948d4a3f7c69473a603540d"
SECTION = "lib"
inherit autotools pkgconfig
S = "${WORKDIR}/git"
-SRCREV = "2df39cf5f1b9ccaa2973f6ef273857e4dc46f0cf"
-SRC_URI = "git://github.com/intel/isa-l.git"
+SRCREV = "bd226375027899087bd48f3e59b910430615cc0a"
+SRC_URI = "git://github.com/intel/isa-l.git;branch=master;protocol=https"
DEPENDS = "nasm-native"
AS[unexport] = "1"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
COMPATIBLE_HOST = '(x86_64).*-linux'
diff --git a/recipes-support/jhi/jhi_1.41.bb b/recipes-support/jhi/jhi_1.41.bb
deleted file mode 100644
index badb928f..00000000
--- a/recipes-support/jhi/jhi_1.41.bb
+++ /dev/null
@@ -1,72 +0,0 @@
-SUMMARY = "Intel Dynamic Application Loader (DAL) Host Interface"
-DESCRIPTION = "A daemon and libraries which allow user space applications \
-to install Java applets on DAL FW and communicate with them"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=833126f14614a3276708a4d7c9734645"
-
-SRC_URI = "git://github.com/intel/dynamic-application-loader-host-interface.git;protocol=https"
-
-inherit cmake useradd systemd pkgconfig update-rc.d
-
-SRCREV = "4c9ef52bcd55fa03b30ac323e553a05be858d41e"
-
-S = "${WORKDIR}/git"
-
-DEPENDS += "util-linux libxml2"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
-RDEPENDS_${PN} += "bash"
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false -g mei jhi"
-
-GROUPADD_PARAM_${PN} = "-g 880 mei"
-
-COMPATIBLE_HOST_libc-musl = 'null'
-
-SYSTEMD_SERVICE_${PN} = "jhi.service"
-
-INITSCRIPT_PACKAGES = "${PN}"
-INITSCRIPT_NAME_${PN} = "${PN}"
-INITSCRIPT_PARAMS_${PN} = "defaults"
-
-# systemd is the default so they are installed when sysvinit is not selected as INIT_SYSTEM
-EXTRA_OECMAKE = "-DCMAKE_SKIP_RPATH=ON \
- -DINIT_SYSTEM=${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'SysVinit', 'systemd', d)} \
- -DAPPLETS_DIR=${libdir}/dal/applets \
- -DAPP_REPO_DIR=${localstatedir}/cache/dal/applet_repository \
- "
-
-do_install_append () {
- install -d ${D}${localstatedir}/cache/dal/applet_repository
-
- chown -R jhi ${D}${localstatedir}/cache/dal/applet_repository
- chgrp -R mei ${D}${localstatedir}/cache/dal/applet_repository
-
- install -d ${D}${bindir}
- install -m 755 ${B}/bin_linux/smoketest ${D}${bindir}
- install -m 755 ${B}/bin_linux/bist ${D}${bindir}
-
- install -d ${D}${libdir}/dal/applets
- cp -r ${S}/test/smoketest/applets/* ${D}${libdir}/dal/applets/
-}
-
-PACKAGES += "${PN}-test"
-
-FILES_${PN}-dev = ""
-
-FILES_${PN} = "\
- ${sbindir} \
- ${sysconfdir} \
- ${libdir}/lib*${SOLIBSDEV} \
- ${libdir}/dal/applets/SpoolerApplet.dalp \
- ${nonarch_libdir}/tmpfiles.d \
- ${systemd_system_unitdir} \
- ${localstatedir}/cache/dal/applet_repository \
- "
-
-FILES_${PN}-test = "\
- ${bindir} \
- ${libdir}/dal/applets \
- "
-
-UPSTREAM_CHECK_COMMITS = "1"
diff --git a/recipes-support/libipt/libipt_2.0.4.bb b/recipes-support/libipt/libipt_2.1.1.bb
index a0554f44..205967c1 100644
--- a/recipes-support/libipt/libipt_2.0.4.bb
+++ b/recipes-support/libipt/libipt_2.1.1.bb
@@ -5,23 +5,24 @@ library or it can be partially or fully integrated into your tool."
HOMEPAGE = "https://github.com/intel/libipt"
LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=aea4783603fc6bd8dff5157996ccb9d9"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a429afa59f273b5d12778eda69d10313"
inherit pkgconfig cmake
S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/intel/libipt.git;protocol=https;branch=stable/v2.0"
+SRC_URI = "git://github.com/intel/libipt.git;protocol=https;branch=stable/v2.1"
-SRCREV = "63813186694487a2bc005f32be57eb526e16714b"
+SRCREV = "1c9bc700f4b9a71fd2d1cf1742de7e2351ddb281"
EXTRA_OECMAKE += " \
-DPTDUMP=ON \
-DPTTC=ON \
+ -DPTSEG=ON \
-DCMAKE_SKIP_RPATH=ON \
"
-do_install_append() {
+do_install:append() {
install -d ${D}${bindir}/libipt
install -d ${D}${bindir}/libipt/tests
@@ -29,5 +30,5 @@ do_install_append() {
cp -r ${WORKDIR}/git/test/src/* ${D}${bindir}/libipt/tests
}
-FILES_${PN}-test = "${bindir}"
+FILES:${PN}-test = "${bindir}"
PACKAGES =+ "${PN}-test"
diff --git a/recipes-support/sbsigntool/sbsigntool-native_git.bb b/recipes-support/sbsigntool/sbsigntool-native_git.bb
index f6094a5c..5a9f5b4d 100644
--- a/recipes-support/sbsigntool/sbsigntool-native_git.bb
+++ b/recipes-support/sbsigntool/sbsigntool-native_git.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Utility for signing and verifying files for UEFI Secure Boot"
-LICENSE = "GPLv3 & LGPL-2.1 & LGPL-3.0 & MIT"
+LICENSE = "GPL-3.0-only & LGPL-2.1-only & LGPL-3.0-only & MIT"
# sbsigntool statically links to libccan.a which is built with modules
# passed to "create-ccan-tree" (and their dependencies). Therefore,
@@ -19,25 +19,25 @@ LIC_FILES_CHKSUM = "file://LICENSE.GPLv3;md5=9eef91148a9b14ec7f9df333daebc746 \
# The original upstream is git://kernel.ubuntu.com/jk/sbsigntool but it has
# not been maintained and many patches have been backported in this repo.
-SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git;protocol=https;name=sbsigntools \
- git://github.com/rustyrussell/ccan.git;protocol=https;destsuffix=git/lib/ccan.git;name=ccan \
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git;protocol=https;name=sbsigntools;branch=master \
+ git://github.com/rustyrussell/ccan.git;protocol=https;destsuffix=git/lib/ccan.git;name=ccan;branch=master \
file://0001-configure-Fixup-build-dependencies-for-cross-compili.patch \
- "
+ "
-SRCREV_sbsigntools ?= "f12484869c9590682ac3253d583bf59b890bb826"
+SRCREV_sbsigntools ?= "9cfca9fe7aa7a8e29b92fe33ce8433e212c9a8ba"
SRCREV_ccan ?= "b1f28e17227f2320d07fe052a8a48942fe17caa5"
SRCREV_FORMAT = "sbsigntools_ccan"
DEPENDS = "binutils-native gnu-efi-native help2man-native openssl-native util-linux-native"
-PV = "0.9.4-git${SRCPV}"
+PV = "0.9.5"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
inherit native
-do_configure_prepend() {
+do_configure:prepend() {
cd ${S}
sed -i s#RECIPE_SYSROOT#${RECIPE_SYSROOT_NATIVE}#g configure.ac
@@ -79,3 +79,5 @@ EXTRA_OEMAKE = "\
-I${STAGING_INCDIR_NATIVE} \
-I${STAGING_INCDIR_NATIVE}/efi/${@efi_arch(d)}' \
"
+
+CFLAGS:append = " -Wno-error"
diff --git a/recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch b/recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch
index ef686511..ea7bee29 100644
--- a/recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch
+++ b/recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch
@@ -10,7 +10,7 @@ under /usr/include and /usr/lib.
Prepend these paths with a placeholder that can be replaced with the
actual paths once they are resolved.
-Upstream status: inappropriate [OE specific]
+Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>