aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README21
-rw-r--r--README.sources17
-rw-r--r--SECURITY.md6
-rw-r--r--conf/include/maintainers.inc8
-rw-r--r--conf/layer.conf8
-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.inc16
-rw-r--r--conf/machine/include/qemu-intel.inc2
-rw-r--r--conf/machine/include/qemuboot-intel.inc5
-rw-r--r--conf/machine/include/tune-skylake.inc48
-rw-r--r--conf/machine/intel-corei7-64.conf1
-rw-r--r--conf/machine/intel-skylake-64.conf5
-rw-r--r--custom-licenses/EULA879
-rw-r--r--custom-licenses/ISSL136
-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.4.4.bb)13
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch28
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch38
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.1.bb36
-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/llvm10-0001-OpenCL-3.0-support.patch8259
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0001-llvm-spirv-skip-building-tests.patch51
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Add-cl_khr_extended_subgroup-extensions.patch812
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Fix-building-in-tree-with-cmake-DLLVM_LINK_LLVM_DYLI.patch33
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.patch982
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Memory-leak-fix-for-Managed-Static-Mutex.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0004-Remove-repo-name-in-LLVM-IR.patch49
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0005-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch47
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0006-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch53
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0007-support-cl_ext_float_atomics.patch377
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch96
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0009-ispc-10_0_fix_for_1788.patch105
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0010-ispc-10_0_fix_for_1793.patch43
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0011-ispc-10_0_fix_for_1844.patch34
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0012-ispc-10_0_i8_shuffle_avx512_i8_i16.patch40
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch61
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0014-ispc-10_0_packed_load_store_avx512skx.patch97
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0015-ispc-10_0_vXi1calling_avx512_i8_i16.patch173
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Enable-the-call-site-info-only-for-g-optimizations.patch550
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Replace-MCTargetOptionsCommandFlags.inc-and-CommandF.patch2243
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-basic-block-sections-support.patch237
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch51
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch52
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0003-Support-cl_ext_float_atomics.patch344
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0004-ispc-12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch67
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0005-ispc-12_0_fix_for_2111.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend45
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch31
-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_24.05.28454.6.bb (renamed from dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.40.21182.bb)41
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch32
-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-llvm_deps.cmake-don-t-copy-header-file-when-building.patch35
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch10
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0004-find-external-llvm-tblgen.patch30
-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.8744.bb63
-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.inc12
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb15
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb12
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_13.0.0.bb15
-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.4.2.bb)22
-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_2141.0.0.0.bb)12
-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.6.bb)9
-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.patch (renamed from dynamic-layers/clang-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch)30
-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.6.2.bb)24
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/compiler/intel-oneapi-compiler_2021.4.0-3561.bb53
-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.bb (renamed from dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_3.13.2.bb)10
-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/ipp/intel-oneapi-ipp_2021.4.0-459.bb42
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2021.4.0-640.bb39
-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.bb (renamed from dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_1.4.1.bb)11
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb (renamed from dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_1.1.0.bb)11
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb (renamed from dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_2.8.0.bb)13
-rw-r--r--dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb (renamed from dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.8.0.bb)2
-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.patch38
-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.0387.bb)10
-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.patch56
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch333
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-Disable-Werror.patch43
-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.patch326
-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/open-model-zoo/0001-use-oe-gflags.patch18
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.4.2.bb66
-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.4.2.bb132
-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/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.1.0.bb)5
-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.bb1
-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_20210608.bb)9
-rw-r--r--recipes-core/microcode/iucode-tool_2.3.1.bb2
-rw-r--r--recipes-core/ovmf/files/0001-ovmf-RefkitTestCA-TEST-UEFI-SecureBoot.patch55
-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.bb4
-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.3.1.bb)4
-rw-r--r--recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch2
-rw-r--r--recipes-graphics/libva/libva-intel-utils_2.20.1.bb (renamed from recipes-graphics/libva/libva-intel-utils_2.13.0.bb)4
-rw-r--r--recipes-graphics/libva/libva-intel_2.20.0.bb (renamed from recipes-graphics/libva/libva-intel_2.13.0.bb)5
-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)3
-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.13.4.bb)9
-rw-r--r--recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb (renamed from recipes-kernel/intel-ethernet/ixgbevf_4.13.3.bb)9
-rw-r--r--recipes-kernel/iwlwifi/backport-iwlwifi_git.bb12
-rw-r--r--recipes-kernel/linux/linux-intel-dev.bb34
-rw-r--r--recipes-kernel/linux/linux-intel-rt_5.10.bb35
-rw-r--r--recipes-kernel/linux/linux-intel-rt_6.6.bb (renamed from recipes-kernel/linux/linux-intel-rt_5.15.bb)26
-rw-r--r--recipes-kernel/linux/linux-intel.inc15
-rw-r--r--recipes-kernel/linux/linux-intel/0001-io-mapping-Cleanup-atomic-iomap.patch94
-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/fix-perf-reproducibility.patch39
-rw-r--r--recipes-kernel/linux/linux-intel_5.10.bb33
-rw-r--r--recipes-kernel/linux/linux-intel_5.15.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-rt_%.bbappend (renamed from recipes-kernel/linux/linux-yocto-rt_5.%.bbappend)0
-rw-r--r--recipes-kernel/linux/linux-yocto_%.bbappend2
-rw-r--r--recipes-kernel/linux/linux-yocto_5.%.bbappend1
-rw-r--r--recipes-kernel/linux/meta-intel-compat-kernel.inc2
-rw-r--r--recipes-multimedia/itt/itt_3.24.6.bb (renamed from recipes-multimedia/itt/itt_3.22.4.bb)4
-rw-r--r--recipes-multimedia/libva/files/0001-Disable-vp9-padding-on-mtl.patch35
-rw-r--r--recipes-multimedia/libva/files/0001-MOS-user-setting-reentrant.patch476
-rw-r--r--recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch86
-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.3.5.bb)15
-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/fix-gcc13.patch15
-rw-r--r--recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb (renamed from recipes-multimedia/mediasdk/intel-mediasdk_21.3.5.bb)9
-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/0001-AVCd-Add-frame-info-check-and-update-ChromaFormat-in.patch98
-rw-r--r--recipes-multimedia/onevpl/onevpl-intel-gpu/0001-Adding-missing-device-ID-4692-for-ADL-S.patch33
-rw-r--r--recipes-multimedia/onevpl/onevpl-intel-gpu/0001-HEVCd-Add-frame-info-check-and-update-ChromaFormat-i.patch173
-rw-r--r--recipes-multimedia/onevpl/onevpl-intel-gpu/0001-jpegd-Enable-JPEG-decode-error-report.patch502
-rw-r--r--recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb (renamed from recipes-multimedia/onevpl/onevpl-intel-gpu_21.3.4.bb)18
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-Extends-errorTypes-to-support-JPEG-errors.patch59
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch37
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_decode-Add-VDSFC-CSC-for-AVC-HEVC.patch132
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_misc-Addin-basic-wayland-dmabuf-support.patch90
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch94
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch98
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-samples-use-find_program-to-detect-wayland-scanner-i.patch108
-rw-r--r--recipes-multimedia/onevpl/onevpl_2023.4.0.bb (renamed from recipes-multimedia/onevpl/onevpl_2021.6.0.bb)20
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch (renamed from recipes-oneapi/crypto/intel-crypto-mb/0003-CMakeLists.txt-exclude-host-system-headers.patch)17
-rw-r--r--recipes-oneapi/crypto/intel-crypto-mb/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch29
-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.bb (renamed from recipes-oneapi/crypto/intel-crypto-mb_2021.3.bb)17
-rw-r--r--recipes-oneapi/onedpl/onedpl_2022.3.0.bb (renamed from recipes-oneapi/onedpl/onedpl_2021.5.0.bb)6
-rw-r--r--recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb (renamed from recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2021.3.bb)3
-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)6
-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)7
-rw-r--r--recipes-support/sbsigntool/sbsigntool-native_git.bb9
-rw-r--r--recipes-support/sbsigntool/sbsigntool/0001-configure-Fixup-build-dependencies-for-cross-compili.patch2
-rw-r--r--recipes-support/sbsigntool/sbsigntool/0002-fix-openssl-3-0.patch32
210 files changed, 3894 insertions, 20324 deletions
diff --git a/README b/README
index 58d6a505..ca2c5041 100644
--- a/README
+++ b/README
@@ -207,14 +207,14 @@ add below configuration to local.conf :
WKS_FILE = "image-installer.wks.in"
IMAGE_FSTYPES:append = " ext4"
- IMAGE_TYPEDEP_wic = "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 = "\
${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/conf/include/maintainers.inc b/conf/include/maintainers.inc
index f10b7464..9849d0d8 100644
--- a/conf/include/maintainers.inc
+++ b/conf/include/maintainers.inc
@@ -8,8 +8,10 @@ RECIPE_MAINTAINER:pn-core-image-minimal-initramfs = "Anuj Mittal <anuj.mittal@in
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-graphics-compiler = "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>"
@@ -21,13 +23,10 @@ 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-libva-intel = "Anuj Mittal <anuj.mittal@intel.com>"
RECIPE_MAINTAINER:pn-libva-intel-utils = "Anuj Mittal <anuj.mittal@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>"
@@ -53,4 +52,3 @@ RECIPE_MAINTAINER:pn-secureboot-selftest-image-signed = "Anuj Mittal <anuj.mitta
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>"
diff --git a/conf/layer.conf b/conf/layer.conf
index 54e98c03..97dfb897 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -19,7 +19,7 @@ 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 hardknott honister"
+LAYERSERIES_COMPAT_intel = "kirkstone scarthgap"
BBFILES_DYNAMIC += " \
clang-layer:${LAYERDIR}/dynamic-layers/clang-layer/*/*/*.bb \
@@ -32,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"
@@ -46,4 +42,4 @@ PREFERRED_PROVIDER_libva-utils ?= "libva-utils"
PREFERRED_PROVIDER_libva-utils-native ?= "libva-utils-native"
PREFERRED_PROVIDER_nativesdk-libva-utils ?= "nativesdk-libva-utils"
-X86_TUNE_DIR = "${@bb.utils.contains('LAYERSERIES_CORENAMES', 'honister', 'include/x86', 'include', d)}"
+# addpylib ${LAYERDIR}/lib oeqa
diff --git a/conf/machine/include/intel-core2-32-common.inc b/conf/machine/include/intel-core2-32-common.inc
index 20d50207..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/${X86_TUNE_DIR}/tune-core2.inc
-require conf/machine/${X86_TUNE_DIR}/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 82645eb3..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/${X86_TUNE_DIR}/tune-corei7.inc
-require conf/machine/${X86_TUNE_DIR}/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 452a423d..230d0253 100644
--- a/conf/machine/include/meta-intel.inc
+++ b/conf/machine/include/meta-intel.inc
@@ -7,10 +7,9 @@
PREFERRED_PROVIDER_virtual/kernel ?= "linux-intel"
PREFERRED_PROVIDER_virtual/kernel:poky-tiny ?= "linux-intel"
-PREFERRED_VERSION_linux-intel ?= "5.15%"
-PREFERRED_VERSION_linux-intel-rt ?= "5.15%"
-PREFERRED_VERSION_linux-intel:poky-altcfg ?= "5.10%"
-PREFERRED_VERSION_linux-intel-rt:poky-altcfg ?= "5.10%"
+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"
@@ -21,10 +20,9 @@ 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', '12.0.0', '12.0.0', '13.0.0', d), d)}"
-PREFERRED_VERSION_opencl-clang-native ?= "${@bb.utils.contains('LLVMVERSION', '10.0.1', '10.0.0', \
- bb.utils.contains('LLVMVERSION', '12.0.0', '12.0.0', '13.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 \
"
@@ -34,7 +32,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURE
# 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_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.
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 bf66ef1e..17a1234d 100644
--- a/conf/machine/include/qemuboot-intel.inc
+++ b/conf/machine/include/qemuboot-intel.inc
@@ -13,7 +13,6 @@ 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_AUDIO_OPT = "-device AC97"
QB_KERNEL_CMDLINE_APPEND = " oprofile.timer=1"
-# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
-QB_OPT_APPEND = " -usb -usbdevice tablet -device virtio-rng-pci"
+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 b3630edd..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/${X86_TUNE_DIR}/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-corei7-64.conf b/conf/machine/intel-corei7-64.conf
index 719661a6..968395fe 100644
--- a/conf/machine/intel-corei7-64.conf
+++ b/conf/machine/intel-corei7-64.conf
@@ -15,6 +15,7 @@ MACHINE_HWCODECS ?= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '', 'intel-me
# Enable optional dpdk:
COMPATIBLE_MACHINE:pn-dpdk = "intel-corei7-64"
+COMPATIBLE_MACHINE:pn-dpdk-module = "intel-corei7-64"
XSERVER ?= "${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
diff --git a/conf/machine/intel-skylake-64.conf b/conf/machine/intel-skylake-64.conf
index 81047385..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/${X86_TUNE_DIR}/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"
@@ -15,6 +15,7 @@ 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-module = "intel-skylake-64"
XSERVER ?= "${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
diff --git a/custom-licenses/EULA b/custom-licenses/EULA
index 245d9bcd..549f78e1 100644
--- a/custom-licenses/EULA
+++ b/custom-licenses/EULA
@@ -1,4 +1,4 @@
-Intel End User License Agreement for Developer Tools (Version October 2020)
+Intel End User License Agreement for Developer Tools (Version October 2021)
IMPORTANT NOTICE - PLEASE READ AND AGREE BEFORE DOWNLOADING, INSTALLING, COPYING
OR USING
@@ -7,545 +7,386 @@ 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
-otherwise 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 otherwise use the Materials.
+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 cloud service provider offering a
- cloud-based platform, infrastructure, application or storage services, such
- as Microsoft Azure or Amazon Web Services, which You may utilize solely
- subject to the restrictions set forth in Section 3.3 B.
-
-B. "Computer" means a computer, workstation or server(s); as well as a container
- or virtual machine located on Your or Your Cloud Provider's server.
-
-C. "Derivative Work" means a derivative work, as defined in 17 U.S.C. 101, of
- the Source Code.
-
-D. "Executable Code" means computer programming code in binary form suitable for
- machine execution by a processor without the intervening steps of
- interpretation or compilation.
-
-E. "Instance" means a single running copy of the Materials on a Computer.
-
-F. "Licensed Patent Claims" mean the claims of Intel's patents that are
- necessarily and directly infringed by the reproduction and distribution of
- the Materials that is authorized in Section 3 below, when the Materials are
- in their unmodified form as delivered by Intel to You and not modified or
- combined with anything else. Licensed Patent Claims are only those claims
- that Intel can license without paying, or getting the consent of, a third
- party.
-
-G. "Materials" mean the software, documentation, the software product serial
- number, and other collateral, including any updates, that are made available
- to You by Intel under this Agreement. Materials include any Redistributables,
- Executable Code, Source Code, Sample Source Code, and Pre-Release Materials,
- but do not include Third Party Programs.
-
-H. "Microsoft Platforms" mean any current and future Microsoft operating system
- products, Microsoft run-time technologies (such as the .NET Framework), and
- Microsoft application platforms (such as Microsoft Office or Microsoft
- Dynamics) that Microsoft offers.
-
-I. "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, which may
- not be fully functional or tested and may contain bugs or errors, which Intel
- may substantially modify in its development of a production version, and for
- which Intel makes no assurances that it will ever develop or make generally
- available a production version. Pre-Release Materials are subject to the
- terms of Section 4.2.
-
-J. "Priority Support" means assistance through Intel's Online Service Center for
- paid User Types for the Materials.
-
-K. "Reciprocal Open Source Software" means any software that is subject to a
- license which requires that (a) it must be distributed in source code form;
- (b) it must be licensed under the same open source license terms; and (c) 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.
-
-L. "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.
-
-M. "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 nor validated by Intel and is provided purely as a programming
- example.
-
-N. "Source Code" means the software portion of the Materials provided in human
- readable format.
-
-O. "Term" means either a perpetual or a time limited term for the Materials
- that You obtain as specified on Intel's download website, in Intel's
- applicable documentation or as controlled by the serial number for the
- Materials.
-
-P. "Third Party Programs" mean the files (if any) listed in the
- "third-party-programs.txt" or other similarly-named text file that may be
- included in the Materials for the applicable software.
-
-Q. "User Type" has the meaning specified in Section 2.
-
-R. "Your Product" means one or more applications, products or projects developed
- by or for You using the Materials.
-
-2. USER TYPES. This Agreement covers both free and paid User Types. Free users
- do not receive access to Priority Support. All paid users receive access to
- Priority Support upon the payment of fees specified in Section 5. If you are
- a paid user, then the type of license You receive will be specified in
- writing by Intel directly or by an authorized Intel distributor. You
- understand and agree that the following User Types described below are
- subject to Your continued compliance with the license grants in Section 3:
-
-2.1 Free User. You are authorized to run as many Instances as needed for an
- unlimited number of users for You, Your company or other legal entity that
- you represent.
-
-2.2 Single Named-User. Subject to payment of appropriate fees, You are
- authorized to run as many Instances as needed for a single user.
-
-2.3 Concurrent User. Subject to payment of appropriate fees, You are authorized
- to run as many Instances as needed on a designated network(s) for use by no
- more than the authorized number of concurrent users.
-
-2.4 Site User. Subject to payment of appropriate fees, You are authorized to run
- as many Instances as needed for use by any number of concurrent users
- located at the specified site or sites specified in the
- "site_license_materials.txt" file you receive from Intel.
-
-3. LICENSE GRANTS.
-
-3.1 License to the Materials.
-
- Subject to the terms and conditions of this Agreement, Intel grants You for
- the appropriate Term a non-exclusive, worldwide, non-assignable (except as
- expressly permitted hereunder), non-sublicensable, limited right and license
- for Your applicable User Type:
-
- A. under its copyrights, to:
-
- (1) reproduce internally a reasonable number of copies of the Materials for
- Your personal or business use;
-
- (2) use the Materials internally solely for Your personal or business use to
- develop Your Product, in accordance with the documentation or text files
- included as part of the Materials;
-
- (3) modify or create Derivative Works of the Redistributables, or any portions,
- that are provided to You in Source Code;
-
- (4) 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 made pursuant
- to Section 3.1.A(3), or any portions, subject to the following conditions:
-
- (a) Any distribution of the Redistributables must only be as part of Your
- Product which must add significant primary functionality different than
+ 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;
- (b) You will redistribute the Redistributables originally provided to You by
- Intel only in Executable Code subject to a license agreement that
- prohibits disassembly and reverse engineering of the Redistributables;
+ (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;
- (c) This distribution right includes a limited right to sublicense only the
- Intel copyrights in the Redistributables and only to the extent necessary
+ (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) solely as incorporated in Your
- Product; and
-
- (d) You (i) will be solely responsible to Your customers for any update,
- support obligation or other liability which may arise from Your
- 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 without written permission from Intel,
- (iv) will comply with any additional restrictions which are included in
- the text files with the Redistributables and in Section 4 below, (v) will
- indemnify, hold harmless, and defend Intel and its suppliers from and
- against any claims or lawsuits, including attorney's fees, that arise or
- result from Your modifications, Derivative Works or Your distribution of
- Your Product;
-
- and
-
- B. under Intel's Licensed Patent Claims, to:
- (1) make copies of the Materials only as specified in Section 3.1.A(1);
- (2) use the Materials only as specified in Section 3.1.A(2); and
- (3) offer to distribute, and distribute, but not sell, the Redistributables
- only as part of Your Product under Intel's copyright license granted in
- Section 3.1(A), but only under the terms of that copyright license and not
- as a sale;
- And, provided further, that the license under the Licensed Patent Claims does
- not and will not apply to, and Intel expressly does not grant You a patent
- license in this Agreement to, any modifications to, or Derivative Works of, the
- Materials or Redistributables, whether made by You, Your contractor(s), Your
- customer(s) (which, for all purposes under this Agreement, will mean either a
- customer, reseller, distributor or other channel partner) or any third party,
- even if the modifications or Derivative Works are permitted under 3.1.A(3).
-
-3.2 Third Party Programs and Other Intel Programs Licenses. Third Party
- Programs, 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 Programs.
-
-3.3 Third Party Use.
-
-A. If you are an entity, Your contractors may use the Materials as specified in
- Section 3, 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 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 4.1(xii); (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, including attorney's fees, that
- arise or result from Your Cloud Provider's use, misuse or disclosure of the
- Materials.
-
-4. LICENSE CONDITIONS.
-
-4.1 Restrictions. Except as expressly provided in this Agreement, You may NOT:
- (i) use, copy, 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 or attempt to modify or tamper with the normal function of any
- license manager that may regulate usage of the Materials; (vii) distribute,
- sublicense or transfer any Source Code, of the Materials or Derivative Works
- to any third party; (viii) allow Redistributables to run on a platform other
- than a Microsoft Platform if according to the accompanying user
- documentation the Materials are meant to execute only on a Microsoft
- Platform; (ix) remove, minimize, block or modify any notices of Intel or its
- suppliers in the Materials; (x) include the Redistributables in malicious,
- deceptive, or unlawful programs or products or use the Materials in any way
- that is against the law; (xi) modify, create a Derivative Work, link, or
- distribute the Materials so that any part of it becomes Reciprocal Open
- Source Software; (xii) 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 a service, such as the
- salesforce.com service business model).
-
-4.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.
-
-4.3 Safety, Critical, and Lifesaving Applications. The Materials may provide
- information relevant to safety-critical applications to allow compliance
- with functional safety standards or requirements ("Safety-Critical
- Applications"). You understand and acknowledge 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 assure 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 lifesaving systems)
- ("Lifesaving Applications"), You agree to indemnify, defend, and hold Intel
- and its representatives harmless against all claims, costs, damages, and
- expenses, including reasonable attorney fees arising in any way out of Your
- use of the Materials in Safety-Critical Applications or Lifesaving
- 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
+ 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.
-4.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
+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.5 Materials Transfer. You may only permanently transfer the Materials, and all
- of Your rights and obligations under this Agreement, to another party
- ("Recipient") solely in conjunction with a change of ownership, merger,
- acquisition, sale or transfer of all or substantially all of Your business
- or assets, either voluntarily, by operation of law or otherwise subject to
- the following: You must notify Intel of the transfer by sending a letter to
- Intel: (i) identifying the Recipient and Your legal entities, (ii)
- identifying the Materials (i.e., the specific Intel software and version)
- and the associated serial numbers to be transferred, (iii) certifying that
- You retain no copies of the Materials or portions, (iv) certifying that the
- Recipient has agreed in writing to be bound by all of the terms and
- conditions of this Agreement, (v) for paid User Types listed in Section 2,
- certifying that the Recipient has been notified that in order to receive
- support from Intel for the Materials they must notify Intel in writing of
- the transfer and provide Intel with the information specified in subsection
- (ii) above along with the name and email address of the individual assigned
- to use the Materials, and (vi) providing Your email address so that Intel
- may confirm receipt of Your letter. The above information can be emailed to
- your Intel representative or by letter to: Intel Corporation, 2111 NE 25th
- Avenue, Hillsboro, OR 97124, Attn: CPDP Contracts Management, JF2-28. The
- Materials will be permanently transferred to the Recipient once Intel
- confirms receipt of Your request.
-
-5. FEES; TAXES.
-
-5.1 Fees. Upon Your receipt of Intel's or its reseller's invoice, You will pay
- Intel or its reseller the license and support fees, if any, for the
- Materials in US dollars according to Your User Type
-
-5.2 Taxes. All payments will be made free and clear without deduction for any
- and all present and future taxes imposed by any taxing authority. In the
- event that You are prohibited by law from making such payments unless You
- deduct or withhold taxes therefrom and remit such taxes to the local taxing
- jurisdiction, then You will duly withhold and remit such taxes to the
- appropriate taxing authority and will pay to Intel or its reseller its
- proportionate share of the remaining net amount after the taxes have been
- withheld. You will promptly furnish Intel or its reseller with a copy of an
- official tax receipt or other appropriate evidence of any taxes imposed on
- payments made under this Agreement, including taxes on any additional
- amounts paid. In cases other than taxes referred to above, including but not
- limited to sales and use taxes, stamp taxes, value added taxes, property
- taxes and other taxes or duties imposed by any taxing authority on or with
- respect to this Agreement, the costs of such taxes or duties will be borne
- by You. In the event that such taxes or duties are legally imposed initially
- on Intel or its reseller, or Intel or its reseller is later assessed by any
- taxing authority, then Intel or its reseller will be promptly reimbursed by
- You for such taxes or duties.
-
-6. DATA COLLECTION AND PRIVACY.
-
-6.1 Data Collection. Certain 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
+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.
-6.2 Intel's Privacy Notice. Intel is committed to respecting Your privacy. To
+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.
-7. OWNERSHIP. Title to the Materials and all copies remain with Intel or its
+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. You agree to prevent any unauthorized copying of
- 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.
-
-8. NO WARRANTY AND NO SUPPORT.
-
-8.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 other liability.
-
-8.2 No Support; Priority Support for Paid User Types. 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 Priority Support
- for paid User Types.
-
-9. LIMITATION OF LIABILITY.
-
-9.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 9).
-
-9.2 Intel's total cumulative liability to You, including for direct damages for
- claims relating to this Agreement (whether for breach of contract,
- negligence, or for any other reason), will not exceed the sum paid to Intel
- by You in the twelve (12) month period preceding the date such claim arose
- for the Materials that are the subject of and directly affected by such
- claim.
-
-9.3 You acknowledge that the limitations of liability provided in this Section 9
+ 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, alone or in combination with other items from You.
-
-10. USER SUBMISSIONS. This Agreement does not obligate You to provide Intel with
- materials, information, comments, suggestions or other communications
- regarding the Materials. However, You agree that any material, information,
- comments, suggestions or other communications You transmit or post to an
- Intel website (including but not limited to, submissions to the Priority
- Support and/or other customer support websites or online portals) or provide
- to Intel under this Agreement are not controlled by the International
- Traffic in Arms Regulations (ITAR) or the Export Administration Regulation
- (EAR), and if related to the features, functions, performance or use of the
- Materials are deemed non-confidential and non-proprietary
- ("Communications"). Intel will have no obligations with respect to the
- Communications. You hereby grant to Intel a non-exclusive, perpetual,
- irrevocable, royalty-free, copyright license to copy, modify, create
- Derivative Works, publicly display, disclose, distribute, license and
- sublicense through multiple tiers of distribution and licensees, incorporate
- and otherwise use the Communications and all data, images, sounds, text, and
- other things embodied therein, including Derivative Works thereto, for any
- and all commercial or non-commercial purposes. You are prohibited from
- posting or transmitting to or from an Intel website or providing to Intel
- any unlawful, threatening, libelous, defamatory, obscene, pornographic, or
- other material that would violate any law. 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.
-
- Nothing in this Agreement will be construed as preventing Intel from
- reviewing Your Communications and errors or defects in Intel products
- discovered while reviewing Your Communications. Furthermore, nothing in this
- Agreement will be construed as preventing Intel from implementing
- independently-developed enhancements to Intel's own error diagnosis
- methodology to detect errors or defects in Intel products discovered while
- reviewing Your Communications or to implement bug fixes or enhancements in
- Intel products. The foregoing may include the right to include Your
- Communications in regression test suites.
-
-11. 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 11 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.
-
-12. 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. If You are using the Materials under a paid User Type with a
- limited Term, this Agreement terminates without notice on the last day of
- the Term. If you are using the Materials under a free User Type, the Term is
- perpetual. The Term for any Pre-Release Materials terminates upon release of
- a commercial version. Intel may terminate this Agreement if You are in
- breach of any of its terms and conditions and such breach is not cured
- within thirty (30) days of written notice from Intel. Upon termination, You
- will promptly destroy the Materials and all copies. In the event of
- termination of this Agreement, the license grant 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, 3.1.A(4)(d)(v), 3.2, 3.3
- B(iii), 4.3, 5.2, 6, 7, 8, 9, 10, 11, 12 (with respect to these survival
- provisions in the last sentence), 13, and 14 will survive expiration or
- termination of this Agreement.
-
-13. 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
+ 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
+ "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.
-14. GENERAL PROVISIONS.
-
-14.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. This Agreement, including
- without limitation its termination, has no effect on any signed NDA between
- the parties, which remain in full force and effect as separate agreements
- to their terms. 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 oneAPI End User License
- Agreement (Version October 2020)"); except that Intel may make changes to
- the 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.
-
-14.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 (a) into any U.S. embargoed countries or (b) 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.
-
-14.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.
-
-14.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
+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 eae71fc7..f987e502 100644
--- a/custom-licenses/ISSL
+++ b/custom-licenses/ISSL
@@ -1,63 +1,73 @@
-Intel Simplified Software License (Version February 2020)
-
-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.
-
-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.
-
-Third party programs. The Software may contain Third Party Programs. “Third Party Programs” are third party
-software, open source software or other Intel software listed in the “third-party-programs.txt” or other similarly
-named text file that is included with the Software. Third Party Programs, even if included with the distribution
-of the Software, 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 may
-govern your use of the Third Party Programs.
-
-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.
-
-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.
-
-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.
-
-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.
+Intel Simplified Software License (Version August 2021)
+
+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.
+
+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.
+
+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.
+
+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.
+
+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.
+
+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.
+
+Termination. Your right to use the Software is terminated in the event of your
+breach of this license.
+
+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.
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.4.4.bb b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.bb
index 4d8bf2ff..afea70df 100644
--- a/dynamic-layers/clang-layer/recipes-core/dnn/onednn_2.4.4.bb
+++ b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.bb
@@ -3,7 +3,7 @@ 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=b48e3de3bfd47c27882a0d85b20823f5 \
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \
file://tests/gtests/gtest/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a \
file://src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \
file://src/common/ittnotify/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \
@@ -12,9 +12,11 @@ SECTION = "lib"
inherit pkgconfig cmake ptest
+DNN_BRANCH = "rls-v${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+
S = "${WORKDIR}/git"
-SRCREV = "145c4b50196ac90ec1b946fb80cb5cef6e7d2d35"
-SRC_URI = "git://github.com/oneapi-src/oneDNN.git;branch=rls-v2.4;protocol=https \
+SRCREV = "ecd7fb6d5a0df6503d1691c1754a684b9c769c16"
+SRC_URI = "git://github.com/oneapi-src/oneDNN.git;branch=${DNN_BRANCH};protocol=https \
file://run-ptest \
"
@@ -32,10 +34,11 @@ 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 () {
install -d ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch
deleted file mode 100644
index 4e25420c..00000000
--- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From b9bc0df996d1e65fd70d5eb2d40866693f23bb67 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Thu, 24 Jun 2021 17:53:27 +0800
-Subject: [PATCH] CMakeLists.txt: link with libclang-cpp library instead
-
-Upstream-Status: Inappropriate
-
-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 ef88317e..7507d6a5 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -281,7 +281,7 @@ if (WASM_ENABLED)
- list(APPEND ISPC_TARGETS wasm-i32x4)
- endif()
-
--set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
-+set(CLANG_LIBRARY_LIST clang-cpp)
- set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option frontendopenmp)
-
- if (X86_ENABLED)
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch
deleted file mode 100644
index 1b87af4c..00000000
--- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 8b5d0f26916e776bc3664e6a4dc68eff3a198d7a Mon Sep 17 00:00:00 2001
-From: Dmitry Babokin <dmitry.y.babokin@intel.com>
-Date: Wed, 16 Jun 2021 20:38:44 -0700
-Subject: [PATCH] Do not use depricated file open flags
-
-Upstream-Status: Backport [https://github.com/ispc/ispc/commit/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a]
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- src/module.cpp | 2 +-
- src/opt.cpp | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/module.cpp b/src/module.cpp
-index 1e68d30c4..352bcd09e 100644
---- a/src/module.cpp
-+++ b/src/module.cpp
-@@ -1314,7 +1314,7 @@ bool Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, llvm:
- llvm::CodeGenFileType fileType = (outputType == Object) ? llvm::CGFT_ObjectFile : llvm::CGFT_AssemblyFile;
- bool binary = (fileType == llvm::CGFT_ObjectFile);
-
-- llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text;
-+ llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text;
-
- std::error_code error;
-
-diff --git a/src/opt.cpp b/src/opt.cpp
-index ae1a11d3d..de1b27e1e 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -4687,7 +4687,7 @@ void DebugPassFile::run(llvm::Module &module, bool init) {
- std::error_code EC;
- char fname[100];
- snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
-- llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
-+ llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::OF_None);
- Assert(!EC && "IR dump file creation failed!");
- module.print(OS, 0);
- }
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.1.bb b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.1.bb
deleted file mode 100644
index c319885f..00000000
--- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.1.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-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=3cd6f8a7c3bd9d2bb898fcb27c75221a"
-
-inherit cmake python3native
-
-S = "${WORKDIR}/git"
-
-SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=releases/v1.16.x \
- file://0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch \
- file://0002-cmake-don-t-build-for-32-bit-targets.patch \
- file://8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch \
- "
-SRCREV = "ae404c1da54422bc70696fbdaa4055bca0d1711e"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-
-DEPENDS += " clang-native bison-native "
-RDEPENDS:${PN} += " clang-libllvm clang"
-
-EXTRA_OECMAKE += " \
- -DISPC_INCLUDE_TESTS=OFF \
- -DISPC_INCLUDE_EXAMPLES=OFF \
- -DISPC_NO_DUMPS=ON \
- -DARM_ENABLED=OFF \
- -DISPC_CROSS=ON \
- -DSYSROOT_DIR=${STAGING_DIR_NATIVE} \
- "
-
-TOOLCHAIN = "clang"
-BBCLASSEXTEND = "native nativesdk"
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/llvm10-0001-OpenCL-3.0-support.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0001-OpenCL-3.0-support.patch
deleted file mode 100644
index 1ab00df0..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0001-OpenCL-3.0-support.patch
+++ /dev/null
@@ -1,8259 +0,0 @@
-From 8dbdb2f26674a938ff43b5bfe5b3bf3d1117f9e4 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/7] 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-0001-llvm-spirv-skip-building-tests.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0001-llvm-spirv-skip-building-tests.patch
deleted file mode 100644
index 84a4ba19..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0001-llvm-spirv-skip-building-tests.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 661021749a168c423d69d0ba7cdfa16fed860836 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 1/3] 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 92c50370..80999c98 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 10.0.0 REQUIRED
- COMPONENTS
- Analysis
-@@ -63,9 +56,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.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Add-cl_khr_extended_subgroup-extensions.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Add-cl_khr_extended_subgroup-extensions.patch
deleted file mode 100644
index 3f1b24e7..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Add-cl_khr_extended_subgroup-extensions.patch
+++ /dev/null
@@ -1,812 +0,0 @@
-From 3f544cfe44ee5f113a3fb554aca2cf5d64996062 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/7] 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/llvm10-0002-Fix-building-in-tree-with-cmake-DLLVM_LINK_LLVM_DYLI.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Fix-building-in-tree-with-cmake-DLLVM_LINK_LLVM_DYLI.patch
deleted file mode 100644
index 1aff65e7..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0002-Fix-building-in-tree-with-cmake-DLLVM_LINK_LLVM_DYLI.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 331e323ae2633a8999a660314022491d670c442c 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 2/3] 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()
-
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.patch
deleted file mode 100644
index 49edd7e1..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.patch
+++ /dev/null
@@ -1,982 +0,0 @@
-From fbc9996d6490a5d4720b85b47f38335e7fdc99d9 Mon Sep 17 00:00:00 2001
-From: haonanya <haonan.yang@intel.com>
-Date: Mon, 19 Jul 2021 10:14:20 +0800
-Subject: [PATCH 3/3] Add support for cl_ext_float_atomics in SPIRVWriter
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/spirv/0001-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.patch]
-
-Signed-off-by: haonanya <haonan.yang@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- lib/SPIRV/OCL20ToSPIRV.cpp | 79 ++++++++++++++++--
- lib/SPIRV/SPIRVToOCL.h | 3 +
- lib/SPIRV/SPIRVToOCL12.cpp | 21 +++++
- lib/SPIRV/SPIRVToOCL20.cpp | 28 ++++++-
- lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h | 1 -
- lib/SPIRV/libSPIRV/SPIRVOpCode.h | 8 +-
- test/AtomicFAddEXTForOCL.ll | 64 +++++++++++++++
- test/AtomicFAddExt.ll | 111 ++++++++-----------------
- test/AtomicFMaxEXT.ll | 113 +++++++-------------------
- test/AtomicFMaxEXTForOCL.ll | 64 +++++++++++++++
- test/AtomicFMinEXT.ll | 113 +++++++-------------------
- test/AtomicFMinEXTForOCL.ll | 64 +++++++++++++++
- test/InvalidAtomicBuiltins.cl | 8 --
- 13 files changed, 417 insertions(+), 260 deletions(-)
- create mode 100644 test/AtomicFAddEXTForOCL.ll
- create mode 100644 test/AtomicFMaxEXTForOCL.ll
- create mode 100644 test/AtomicFMinEXTForOCL.ll
-
-diff --git a/lib/SPIRV/OCL20ToSPIRV.cpp b/lib/SPIRV/OCL20ToSPIRV.cpp
-index e30aa5be..b676a009 100644
---- a/lib/SPIRV/OCL20ToSPIRV.cpp
-+++ b/lib/SPIRV/OCL20ToSPIRV.cpp
-@@ -408,10 +408,63 @@ void OCL20ToSPIRV::visitCallInst(CallInst &CI) {
- if (DemangledName.find(kOCLBuiltinName::AtomicPrefix) == 0 ||
- DemangledName.find(kOCLBuiltinName::AtomPrefix) == 0) {
-
-- // Compute atomic builtins do not support floating types.
-- if (CI.getType()->isFloatingPointTy() &&
-- isComputeAtomicOCLBuiltin(DemangledName))
-- return;
-+ // Compute "atom" prefixed builtins do not support floating types.
-+ if (CI.getType()->isFloatingPointTy()) {
-+ if (DemangledName.find(kOCLBuiltinName::AtomPrefix) == 0)
-+ return;
-+ // handle functions which are "atomic_" prefixed.
-+ StringRef Stem = DemangledName;
-+ Stem = Stem.drop_front(strlen("atomic_"));
-+ // FP-typed atomic_{add, sub, inc, dec, exchange, min, max, or, and, xor,
-+ // fetch_or, fetch_xor, fetch_and, fetch_or_explicit, fetch_xor_explicit,
-+ // fetch_and_explicit} should be identified as function call
-+ bool IsFunctionCall = llvm::StringSwitch<bool>(Stem)
-+ .Case("add", true)
-+ .Case("sub", true)
-+ .Case("inc", true)
-+ .Case("dec", true)
-+ .Case("cmpxchg", true)
-+ .Case("min", true)
-+ .Case("max", true)
-+ .Case("or", true)
-+ .Case("xor", true)
-+ .Case("and", true)
-+ .Case("fetch_or", true)
-+ .Case("fetch_and", true)
-+ .Case("fetch_xor", true)
-+ .Case("fetch_or_explicit", true)
-+ .Case("fetch_xor_explicit", true)
-+ .Case("fetch_and_explicit", true)
-+ .Default(false);
-+ if (IsFunctionCall)
-+ return;
-+ if (F->arg_size() != 2) {
-+ IsFunctionCall = llvm::StringSwitch<bool>(Stem)
-+ .Case("exchange", true)
-+ .Case("fetch_add", true)
-+ .Case("fetch_sub", true)
-+ .Case("fetch_min", true)
-+ .Case("fetch_max", true)
-+ .Case("load", true)
-+ .Case("store", true)
-+ .Default(false);
-+ if (IsFunctionCall)
-+ return;
-+ }
-+ if (F->arg_size() != 3 && F->arg_size() != 4) {
-+ IsFunctionCall = llvm::StringSwitch<bool>(Stem)
-+ .Case("exchange_explicit", true)
-+ .Case("fetch_add_explicit", true)
-+ .Case("fetch_sub_explicit", true)
-+ .Case("fetch_min_explicit", true)
-+ .Case("fetch_max_explicit", true)
-+ .Case("load_explicit", true)
-+ .Case("store_explicit", true)
-+ .Default(false);
-+ if (IsFunctionCall)
-+ return;
-+ }
-+ }
-
- auto PCI = &CI;
- if (DemangledName == kOCLBuiltinName::AtomicInit) {
-@@ -819,7 +872,7 @@ void OCL20ToSPIRV::transAtomicBuiltin(CallInst *CI, OCLBuiltinTransInfo &Info) {
- AttributeList Attrs = CI->getCalledFunction()->getAttributes();
- mutateCallInstSPIRV(
- M, CI,
-- [=](CallInst *CI, std::vector<Value *> &Args) {
-+ [=](CallInst *CI, std::vector<Value *> &Args) -> std::string {
- Info.PostProc(Args);
- // Order of args in OCL20:
- // object, 0-2 other args, 1-2 order, scope
-@@ -864,7 +917,21 @@ void OCL20ToSPIRV::transAtomicBuiltin(CallInst *CI, OCLBuiltinTransInfo &Info) {
- std::rotate(Args.begin() + 2, Args.begin() + OrderIdx,
- Args.end() - Offset);
- }
-- return getSPIRVFuncName(OCLSPIRVBuiltinMap::map(Info.UniqName));
-+ llvm::Type* AtomicBuiltinsReturnType =
-+ CI->getCalledFunction()->getReturnType();
-+ auto IsFPType = [](llvm::Type *ReturnType) {
-+ return ReturnType->isHalfTy() || ReturnType->isFloatTy() ||
-+ ReturnType->isDoubleTy();
-+ };
-+ auto SPIRVFunctionName =
-+ getSPIRVFuncName(OCLSPIRVBuiltinMap::map(Info.UniqName));
-+ if (!IsFPType(AtomicBuiltinsReturnType))
-+ return SPIRVFunctionName;
-+ // Translate FP-typed atomic builtins.
-+ return llvm::StringSwitch<std::string>(SPIRVFunctionName)
-+ .Case("__spirv_AtomicIAdd", "__spirv_AtomicFAddEXT")
-+ .Case("__spirv_AtomicSMax", "__spirv_AtomicFMaxEXT")
-+ .Case("__spirv_AtomicSMin", "__spirv_AtomicFMinEXT");
- },
- &Attrs);
- }
-diff --git a/lib/SPIRV/SPIRVToOCL.h b/lib/SPIRV/SPIRVToOCL.h
-index ddeec0b6..006fb0b1 100644
---- a/lib/SPIRV/SPIRVToOCL.h
-+++ b/lib/SPIRV/SPIRVToOCL.h
-@@ -178,6 +178,9 @@ public:
- /// using separate maps for OpenCL 1.2 and OpenCL 2.0
- virtual Instruction *mutateAtomicName(CallInst *CI, Op OC) = 0;
-
-+ // Transform FP atomic opcode to corresponding OpenCL function name
-+ virtual std::string mapFPAtomicName(Op OC) = 0;
-+
- private:
- /// Transform uniform group opcode to corresponding OpenCL function name,
- /// example: GroupIAdd(Reduce) => group_iadd => work_group_reduce_add |
-diff --git a/lib/SPIRV/SPIRVToOCL12.cpp b/lib/SPIRV/SPIRVToOCL12.cpp
-index afddd596..d7f00de3 100644
---- a/lib/SPIRV/SPIRVToOCL12.cpp
-+++ b/lib/SPIRV/SPIRVToOCL12.cpp
-@@ -104,6 +104,9 @@ public:
- /// cl_khr_int64_base_atomics and cl_khr_int64_extended_atomics extensions.
- std::string mapAtomicName(Op OC, Type *Ty);
-
-+ // Transform FP atomic opcode to corresponding OpenCL function name
-+ std::string mapFPAtomicName(Op OC) override;
-+
- static char ID;
- };
-
-@@ -338,6 +341,21 @@ Instruction *SPIRVToOCL12::visitCallSPIRVAtomicBuiltin(CallInst *CI, Op OC) {
- return NewCI;
- }
-
-+std::string SPIRVToOCL12::mapFPAtomicName(Op OC) {
-+ assert(isFPAtomicOpCode(OC) && "Not intended to handle other opcodes than "
-+ "AtomicF{Add/Min/Max}EXT!");
-+ switch (OC) {
-+ case OpAtomicFAddEXT:
-+ return "atomic_add";
-+ case OpAtomicFMinEXT:
-+ return "atomic_min";
-+ case OpAtomicFMaxEXT:
-+ return "atomic_max";
-+ default:
-+ llvm_unreachable("Unsupported opcode!");
-+ }
-+}
-+
- Instruction *SPIRVToOCL12::mutateAtomicName(CallInst *CI, Op OC) {
- AttributeList Attrs = CI->getCalledFunction()->getAttributes();
- return mutateCallInstOCL(
-@@ -351,6 +369,9 @@ Instruction *SPIRVToOCL12::mutateAtomicName(CallInst *CI, Op OC) {
- std::string SPIRVToOCL12::mapAtomicName(Op OC, Type *Ty) {
- std::string Prefix = Ty->isIntegerTy(64) ? kOCLBuiltinName::AtomPrefix
- : kOCLBuiltinName::AtomicPrefix;
-+ // Map fp atomic instructions to regular OpenCL built-ins.
-+ if (isFPAtomicOpCode(OC))
-+ return mapFPAtomicName(OC);
- return Prefix += OCL12SPIRVBuiltinMap::rmap(OC);
- }
-
-diff --git a/lib/SPIRV/SPIRVToOCL20.cpp b/lib/SPIRV/SPIRVToOCL20.cpp
-index d829ff42..01d088e9 100644
---- a/lib/SPIRV/SPIRVToOCL20.cpp
-+++ b/lib/SPIRV/SPIRVToOCL20.cpp
-@@ -82,6 +82,9 @@ public:
- /// compare_exchange_strong/weak_explicit
- Instruction *visitCallSPIRVAtomicCmpExchg(CallInst *CI, Op OC) override;
-
-+ // Transform FP atomic opcode to corresponding OpenCL function name
-+ std::string mapFPAtomicName(Op OC) override;
-+
- static char ID;
- };
-
-@@ -144,11 +147,29 @@ void SPIRVToOCL20::visitCallSPIRVControlBarrier(CallInst *CI) {
- &Attrs);
- }
-
-+std::string SPIRVToOCL20::mapFPAtomicName(Op OC) {
-+ assert(isFPAtomicOpCode(OC) && "Not intended to handle other opcodes than "
-+ "AtomicF{Add/Min/Max}EXT!");
-+ switch (OC) {
-+ case OpAtomicFAddEXT:
-+ return "atomic_fetch_add_explicit";
-+ case OpAtomicFMinEXT:
-+ return "atomic_fetch_min_explicit";
-+ case OpAtomicFMaxEXT:
-+ return "atomic_fetch_max_explicit";
-+ default:
-+ llvm_unreachable("Unsupported opcode!");
-+ }
-+}
-+
- Instruction *SPIRVToOCL20::mutateAtomicName(CallInst *CI, Op OC) {
- AttributeList Attrs = CI->getCalledFunction()->getAttributes();
- return mutateCallInstOCL(
- M, CI,
- [=](CallInst *, std::vector<Value *> &Args) {
-+ // Map fp atomic instructions to regular OpenCL built-ins.
-+ if (isFPAtomicOpCode(OC))
-+ return mapFPAtomicName(OC);
- return OCLSPIRVBuiltinMap::rmap(OC);
- },
- &Attrs);
-@@ -215,7 +236,12 @@ CallInst *SPIRVToOCL20::mutateCommonAtomicArguments(CallInst *CI, Op OC) {
- }
- }
- auto Ptr = findFirstPtr(Args);
-- auto Name = OCLSPIRVBuiltinMap::rmap(OC);
-+ std::string Name;
-+ // Map fp atomic instructions to regular OpenCL built-ins.
-+ if (isFPAtomicOpCode(OC))
-+ Name = mapFPAtomicName(OC);
-+ else
-+ Name = OCLSPIRVBuiltinMap::rmap(OC);
- auto NumOrder = getSPIRVAtomicBuiltinNumMemoryOrderArgs(OC);
- auto ScopeIdx = Ptr + 1;
- auto OrderIdx = Ptr + 2;
-diff --git a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
-index 13f93fbe..7b707993 100644
---- a/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
-+++ b/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
-@@ -521,7 +521,6 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
- add(CapabilityAtomicFloat64AddEXT, "AtomicFloat64AddEXT");
- add(CapabilityAtomicFloat32MinMaxEXT, "AtomicFloat32MinMaxEXT");
- add(CapabilityAtomicFloat64MinMaxEXT, "AtomicFloat64MinMaxEXT");
-- add(CapabilityAtomicFloat16MinMaxEXT, "AtomicFloat16MinMaxEXT");
- add(CapabilitySubgroupShuffleINTEL, "SubgroupShuffleINTEL");
- add(CapabilitySubgroupBufferBlockIOINTEL, "SubgroupBufferBlockIOINTEL");
- add(CapabilitySubgroupImageBlockIOINTEL, "SubgroupImageBlockIOINTEL");
-diff --git a/lib/SPIRV/libSPIRV/SPIRVOpCode.h b/lib/SPIRV/libSPIRV/SPIRVOpCode.h
-index feec70f6..8e595e83 100644
---- a/lib/SPIRV/libSPIRV/SPIRVOpCode.h
-+++ b/lib/SPIRV/libSPIRV/SPIRVOpCode.h
-@@ -54,11 +54,17 @@ template <> inline void SPIRVMap<Op, std::string>::init() {
- }
- SPIRV_DEF_NAMEMAP(Op, OpCodeNameMap)
-
-+inline bool isFPAtomicOpCode(Op OpCode) {
-+ return OpCode == OpAtomicFAddEXT || OpCode == OpAtomicFMinEXT ||
-+ OpCode == OpAtomicFMaxEXT;
-+}
-+
- inline bool isAtomicOpCode(Op OpCode) {
- static_assert(OpAtomicLoad < OpAtomicXor, "");
- return ((unsigned)OpCode >= OpAtomicLoad &&
- (unsigned)OpCode <= OpAtomicXor) ||
-- OpCode == OpAtomicFlagTestAndSet || OpCode == OpAtomicFlagClear;
-+ OpCode == OpAtomicFlagTestAndSet || OpCode == OpAtomicFlagClear ||
-+ isFPAtomicOpCode(OpCode);
- }
- inline bool isBinaryOpCode(Op OpCode) {
- return ((unsigned)OpCode >= OpIAdd && (unsigned)OpCode <= OpFMod) ||
-diff --git a/test/AtomicFAddEXTForOCL.ll b/test/AtomicFAddEXTForOCL.ll
-new file mode 100644
-index 00000000..fb146fb9
---- /dev/null
-+++ b/test/AtomicFAddEXTForOCL.ll
-@@ -0,0 +1,64 @@
-+; RUN: llvm-as %s -o %t.bc
-+; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_EXT_shader_atomic_float_add -o %t.spv
-+; RUN: spirv-val %t.spv
-+; RUN: llvm-spirv -to-text %t.spv -o %t.spt
-+; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-+
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-+
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-+
-+target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
-+target triple = "spir-unknown-unknown"
-+
-+; CHECK-SPIRV: Capability AtomicFloat32AddEXT
-+; CHECK-SPIRV: Capability AtomicFloat64AddEXT
-+; CHECK-SPIRV: Extension "SPV_EXT_shader_atomic_float_add"
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-+
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_atomic_float(float addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFAddEXT [[TYPE_FLOAT_32]]
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_add_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call = tail call spir_func float @_Z25atomic_fetch_add_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)* %a, float 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+
-+; Function Attrs: convergent
-+declare spir_func float @_Z25atomic_fetch_add_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)*, float, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_atomic_double(double addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFAddEXT [[TYPE_FLOAT_64]]
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_add_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+diid]]({{.*}})
-+ %call = tail call spir_func double @_Z25atomic_fetch_add_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)* %a, double 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+; Function Attrs: convergent
-+declare spir_func double @_Z25atomic_fetch_add_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)*, double, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #1 = { convergent "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #2 = { convergent nounwind }
-+
-+!llvm.module.flags = !{!0}
-+!opencl.ocl.version = !{!1}
-+!opencl.spir.version = !{!1}
-+!llvm.ident = !{!2}
-+
-+!0 = !{i32 1, !"wchar_size", i32 4}
-+!1 = !{i32 2, i32 0}
-+!2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 94aa388f0ce0723bb15503cf41c2c15b288375b9)"}
-diff --git a/test/AtomicFAddExt.ll b/test/AtomicFAddExt.ll
-index 011dd8a7..42bdfeea 100644
---- a/test/AtomicFAddExt.ll
-+++ b/test/AtomicFAddExt.ll
-@@ -4,20 +4,16 @@
- ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-
- ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
--; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL12
-
--target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
--target triple = "spir64-unknown-unknown-sycldevice"
--
--%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--%"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" = type { [1 x i64] }
--%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--
--$_ZTSZZ3addIfEvvENKUlRN2cl4sycl7handlerEE19_14clES3_EUlNS1_4itemILi1ELb1EEEE23_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-
--$_ZTSZZ3addIdEvvENKUlRN2cl4sycl7handlerEE19_14clES3_EUlNS1_4itemILi1ELb1EEEE23_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-
--@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
-+target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
-+target triple = "spir64-unknown-unknown-sycldevice"
-
- ; CHECK-SPIRV: Capability AtomicFloat32AddEXT
- ; CHECK-SPIRV: Capability AtomicFloat64AddEXT
-@@ -25,62 +21,43 @@ $_ZTSZZ3addIdEvvENKUlRN2cl4sycl7handlerEE19_14clES3_EUlNS1_4itemILi1ELb1EEEE23_3
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-
--; Function Attrs: convergent norecurse mustprogress
--define weak_odr dso_local spir_kernel void @_ZTSZZ3addIfEvvENKUlRN2cl4sycl7handlerEE19_14clES3_EUlNS1_4itemILi1ELb1EEEE23_37(float addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, float addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func float @_Z14AtomicFloatIncRf(float addrspace(4)* align 4 dereferenceable(4) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds float, float addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds float, float addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !5
-- %5 = extractelement <3 x i64> %4, i64 0
-+ %0 = addrspacecast float addrspace(4)* %Arg to float addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFAddEXT [[TYPE_FLOAT_32]]
-- ; CHECK-LLVM: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i.i = tail call spir_func float @_Z21__spirv_AtomicFAddEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %add.ptr.i29, i32 1, i32 896, float 1.000000e+00) #2
-- %add.i.i = fadd float %call3.i.i.i.i, 1.000000e+00
-- %sext.i = shl i64 %5, 32
-- %conv5.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i64 %conv5.i
-- %ptridx.ascast.i.i = addrspacecast float addrspace(1)* %ptridx.i.i to float addrspace(4)*
-- store float %add.i.i, float addrspace(4)* %ptridx.ascast.i.i, align 4, !tbaa !14
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func float @[[FLOAT_FUNC_NAME:_Z10atomic_add[[:alnum:]]+ff]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_add_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call3.i.i = tail call spir_func float @_Z21__spirv_AtomicFAddEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %0, i32 1, i32 896, float 1.000000e+00) #2
-+ ret float %call3.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float addrspace(1)*, i32, i32, float)
- declare dso_local spir_func float @_Z21__spirv_AtomicFAddEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)*, i32, i32, float) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-
--; Function Attrs: convergent norecurse mustprogress
--define weak_odr dso_local spir_kernel void @_ZTSZZ3addIdEvvENKUlRN2cl4sycl7handlerEE19_14clES3_EUlNS1_4itemILi1ELb1EEEE23_37(double addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, double addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func double @_Z15AtomicDoubleIncRd(double addrspace(4)* align 8 dereferenceable(8) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds double, double addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds double, double addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !18
-- %5 = extractelement <3 x i64> %4, i64 0
-+ %0 = addrspacecast double addrspace(4)* %Arg to double addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFAddEXT [[TYPE_FLOAT_64]]
-- ; CHECK-LLVM: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i.i = tail call spir_func double @_Z21__spirv_AtomicFAddEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %add.ptr.i29, i32 1, i32 896, double 1.000000e+00) #2
-- %add.i.i = fadd double %call3.i.i.i.i, 1.000000e+00
-- %sext.i = shl i64 %5, 32
-- %conv5.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds double, double addrspace(1)* %add.ptr.i, i64 %conv5.i
-- %ptridx.ascast.i.i = addrspacecast double addrspace(1)* %ptridx.i.i to double addrspace(4)*
-- store double %add.i.i, double addrspace(4)* %ptridx.ascast.i.i, align 8, !tbaa !27
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func double @[[DOUBLE_FUNC_NAME:_Z10atomic_add[[:alnum:]]+dd]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_add_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFAddEXT[[:alnum:]]+diid]]({{.*}})
-+ %call3.i.i = tail call spir_func double @_Z21__spirv_AtomicFAddEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %0, i32 1, i32 896, double 1.000000e+00) #2
-+ ret double %call3.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double addrspace(1)*, i32, i32, double)
- declare dso_local spir_func double @_Z21__spirv_AtomicFAddEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)*, i32, i32, double) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-
--attributes #0 = { convergent norecurse }
--attributes #1 = { convergent }
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "disable-tail-calls"="false" "frame-pointer"="all" "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
-+attributes #1 = { convergent "disable-tail-calls"="false" "frame-pointer"="all" "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 }
-
- !llvm.module.flags = !{!0}
-@@ -91,29 +68,5 @@ attributes #2 = { convergent nounwind }
- !0 = !{i32 1, !"wchar_size", i32 4}
- !1 = !{i32 1, i32 2}
- !2 = !{i32 4, i32 100000}
--!3 = !{!"clang version 12.0.0"}
--!4 = !{i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1}
--!5 = !{!6, !8, !10, !12}
--!6 = distinct !{!6, !7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!7 = distinct !{!7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!8 = distinct !{!8, !9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!9 = distinct !{!9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!10 = distinct !{!10, !11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!11 = distinct !{!11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!12 = distinct !{!12, !13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!13 = distinct !{!13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!14 = !{!15, !15, i64 0}
--!15 = !{!"float", !16, i64 0}
--!16 = !{!"omnipotent char", !17, i64 0}
--!17 = !{!"Simple C++ TBAA"}
--!18 = !{!19, !21, !23, !25}
--!19 = distinct !{!19, !20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!20 = distinct !{!20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!21 = distinct !{!21, !22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!22 = distinct !{!22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!23 = distinct !{!23, !24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!24 = distinct !{!24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!25 = distinct !{!25, !26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!26 = distinct !{!26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!27 = !{!28, !28, i64 0}
--!28 = !{!"double", !16, i64 0}
-+!3 = !{!"clang version 13.0.0"}
-+
-diff --git a/test/AtomicFMaxEXT.ll b/test/AtomicFMaxEXT.ll
-index 1b81e53b..1c2eec93 100644
---- a/test/AtomicFMaxEXT.ll
-+++ b/test/AtomicFMaxEXT.ll
-@@ -4,20 +4,16 @@
- ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-
- ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
--; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL12
-
--target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
--target triple = "spir64-unknown-unknown-sycldevice"
--
--%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--%"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" = type { [1 x i64] }
--%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--
--$_ZTSZZ8max_testIfEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-
--$_ZTSZZ8max_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-
--@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
-+target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
-+target triple = "spir64-unknown-unknown-sycldevice"
-
- ; CHECK-SPIRV: Capability AtomicFloat32MinMaxEXT
- ; CHECK-SPIRV: Capability AtomicFloat64MinMaxEXT
-@@ -25,65 +21,42 @@ $_ZTSZZ8max_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4item
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-
--; Function Attrs: convergent norecurse
--define weak_odr dso_local spir_kernel void @_ZTSZZ8max_testIfEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37(float addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, float addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func float @_Z14AtomicFloatMaxRf(float addrspace(4)* align 4 dereferenceable(4) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds float, float addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds float, float addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !5
-- %5 = extractelement <3 x i64> %4, i64 0
-- %conv.i = trunc i64 %5 to i32
-- %conv3.i = sitofp i32 %conv.i to float
-- %add.i = fadd float %conv3.i, 1.000000e+00
-+ %0 = addrspacecast float addrspace(4)* %Arg to float addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFMaxEXT [[TYPE_FLOAT_32]]
-- ; CHECK-LLVM: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i = tail call spir_func float @_Z21__spirv_AtomicFMaxEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %add.ptr.i29, i32 1, i32 896, float %add.i) #2
-- %sext.i = shl i64 %5, 32
-- %conv6.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i64 %conv6.i
-- %ptridx.ascast.i.i = addrspacecast float addrspace(1)* %ptridx.i.i to float addrspace(4)*
-- store float %call3.i.i.i, float addrspace(4)* %ptridx.ascast.i.i, align 4, !tbaa !14
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func float @[[FLOAT_FUNC_NAME:_Z10atomic_max[[:alnum:]]+ff]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_max_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call.i.i.i = tail call spir_func float @_Z21__spirv_AtomicFMaxEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %0, i32 1, i32 896, float 1.000000e+00) #2
-+ ret float %call.i.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float addrspace(1)*, i32, i32, float)
- declare dso_local spir_func float @_Z21__spirv_AtomicFMaxEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)*, i32, i32, float) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-
--; Function Attrs: convergent norecurse
--define weak_odr dso_local spir_kernel void @_ZTSZZ8max_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37(double addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, double addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func double @_Z15AtomicDoubleMaxRd(double addrspace(4)* align 8 dereferenceable(8) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds double, double addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds double, double addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !18
-- %5 = extractelement <3 x i64> %4, i64 0
-- %conv.i = trunc i64 %5 to i32
-- %conv3.i = sitofp i32 %conv.i to double
-- %add.i = fadd double %conv3.i, 1.000000e+00
-+ %0 = addrspacecast double addrspace(4)* %Arg to double addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFMaxEXT [[TYPE_FLOAT_64]]
-- ; CHECK-LLVM: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i = tail call spir_func double @_Z21__spirv_AtomicFMaxEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %add.ptr.i29, i32 1, i32 896, double %add.i) #2
-- %sext.i = shl i64 %5, 32
-- %conv6.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds double, double addrspace(1)* %add.ptr.i, i64 %conv6.i
-- %ptridx.ascast.i.i = addrspacecast double addrspace(1)* %ptridx.i.i to double addrspace(4)*
-- store double %call3.i.i.i, double addrspace(4)* %ptridx.ascast.i.i, align 8, !tbaa !27
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func double @[[DOUBLE_FUNC_NAME:_Z10atomic_max[[:alnum:]]+dd]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_max_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+diid]]({{.*}})
-+ %call.i.i.i = tail call spir_func double @_Z21__spirv_AtomicFMaxEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %0, i32 1, i32 896, double 1.000000e+00) #2
-+ ret double %call.i.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double addrspace(1)*, i32, i32, double)
- declare dso_local spir_func double @_Z21__spirv_AtomicFMaxEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)*, i32, i32, double) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-
--attributes #0 = { convergent norecurse "disable-tail-calls"="false" "frame-pointer"="all" "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"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "disable-tail-calls"="false" "frame-pointer"="all" "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"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
- attributes #1 = { convergent "disable-tail-calls"="false" "frame-pointer"="all" "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 }
-
-@@ -95,29 +68,5 @@ attributes #2 = { convergent nounwind }
- !0 = !{i32 1, !"wchar_size", i32 4}
- !1 = !{i32 1, i32 2}
- !2 = !{i32 4, i32 100000}
--!3 = !{!"clang version 12.0.0"}
--!4 = !{i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1}
--!5 = !{!6, !8, !10, !12}
--!6 = distinct !{!6, !7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!7 = distinct !{!7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!8 = distinct !{!8, !9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!9 = distinct !{!9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!10 = distinct !{!10, !11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!11 = distinct !{!11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!12 = distinct !{!12, !13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!13 = distinct !{!13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!14 = !{!15, !15, i64 0}
--!15 = !{!"float", !16, i64 0}
--!16 = !{!"omnipotent char", !17, i64 0}
--!17 = !{!"Simple C++ TBAA"}
--!18 = !{!19, !21, !23, !25}
--!19 = distinct !{!19, !20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!20 = distinct !{!20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!21 = distinct !{!21, !22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!22 = distinct !{!22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!23 = distinct !{!23, !24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!24 = distinct !{!24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!25 = distinct !{!25, !26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!26 = distinct !{!26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!27 = !{!28, !28, i64 0}
--!28 = !{!"double", !16, i64 0}
-+!3 = !{!"clang version 13.0.0"}
-+
-diff --git a/test/AtomicFMaxEXTForOCL.ll b/test/AtomicFMaxEXTForOCL.ll
-new file mode 100644
-index 00000000..1f2530d9
---- /dev/null
-+++ b/test/AtomicFMaxEXTForOCL.ll
-@@ -0,0 +1,64 @@
-+; RUN: llvm-as %s -o %t.bc
-+; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_EXT_shader_atomic_float_min_max -o %t.spv
-+; RUN: spirv-val %t.spv
-+; RUN: llvm-spirv -to-text %t.spv -o %t.spt
-+; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-+
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-+
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-+
-+target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
-+target triple = "spir-unknown-unknown"
-+
-+; CHECK-SPIRV: Capability AtomicFloat32MinMaxEXT
-+; CHECK-SPIRV: Capability AtomicFloat64MinMaxEXT
-+; CHECK-SPIRV: Extension "SPV_EXT_shader_atomic_float_min_max"
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_float(float addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFMaxEXT [[TYPE_FLOAT_32]]
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_max_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call = tail call spir_func float @_Z25atomic_fetch_max_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)* %a, float 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+
-+; Function Attrs: convergent
-+declare spir_func float @_Z25atomic_fetch_max_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)*, float, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_double(double addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFMaxEXT [[TYPE_FLOAT_64]]
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_max_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMaxEXT[[:alnum:]]+diid]]({{.*}})
-+ %call = tail call spir_func double @_Z25atomic_fetch_max_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)* %a, double 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+
-+; Function Attrs: convergent
-+declare spir_func double @_Z25atomic_fetch_max_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)*, double, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #1 = { convergent "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #2 = { convergent nounwind }
-+
-+!llvm.module.flags = !{!0}
-+!opencl.ocl.version = !{!1}
-+!opencl.spir.version = !{!1}
-+!llvm.ident = !{!2}
-+
-+!0 = !{i32 1, !"wchar_size", i32 4}
-+!1 = !{i32 2, i32 0}
-+!2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 94aa388f0ce0723bb15503cf41c2c15b288375b9)"}
-diff --git a/test/AtomicFMinEXT.ll b/test/AtomicFMinEXT.ll
-index 98c98b8e..9e40a669 100644
---- a/test/AtomicFMinEXT.ll
-+++ b/test/AtomicFMinEXT.ll
-@@ -4,20 +4,16 @@
- ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-
- ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
--; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL12
-
--target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
--target triple = "spir64-unknown-unknown-sycldevice"
--
--%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--%"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" = type { [1 x i64] }
--%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id" = type { %"class._ZTSN2cl4sycl6detail5arrayILi1EEE.cl::sycl::detail::array" }
--
--$_ZTSZZ8min_testIfEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-
--$_ZTSZZ8min_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37 = comdat any
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-
--@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
-+target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
-+target triple = "spir64-unknown-unknown-sycldevice"
-
- ; CHECK-SPIRV: Capability AtomicFloat32MinMaxEXT
- ; CHECK-SPIRV: Capability AtomicFloat64MinMaxEXT
-@@ -25,65 +21,42 @@ $_ZTSZZ8min_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4item
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
- ; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-
--; Function Attrs: convergent norecurse
--define weak_odr dso_local spir_kernel void @_ZTSZZ8min_testIfEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37(float addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, float addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func float @_Z14AtomicFloatMinRf(float addrspace(4)* align 4 dereferenceable(4) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds float, float addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds float, float addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !5
-- %5 = extractelement <3 x i64> %4, i64 0
-- %conv.i = trunc i64 %5 to i32
-- %conv3.i = sitofp i32 %conv.i to float
-- %add.i = fadd float %conv3.i, 1.000000e+00
-+ %0 = addrspacecast float addrspace(4)* %Arg to float addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFMinEXT [[TYPE_FLOAT_32]]
-- ; CHECK-LLVM: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i = tail call spir_func float @_Z21__spirv_AtomicFMinEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %add.ptr.i29, i32 1, i32 896, float %add.i) #2
-- %sext.i = shl i64 %5, 32
-- %conv6.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i64 %conv6.i
-- %ptridx.ascast.i.i = addrspacecast float addrspace(1)* %ptridx.i.i to float addrspace(4)*
-- store float %call3.i.i.i, float addrspace(4)* %ptridx.ascast.i.i, align 4, !tbaa !14
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func float @[[FLOAT_FUNC_NAME:_Z10atomic_min[[:alnum:]]+ff]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_min_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call.i.i.i = tail call spir_func float @_Z21__spirv_AtomicFMinEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)* %0, i32 1, i32 896, float 1.000000e+00) #2
-+ ret float %call.i.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float addrspace(1)*, i32, i32, float)
- declare dso_local spir_func float @_Z21__spirv_AtomicFMinEXTPU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf(float addrspace(1)*, i32, i32, float) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-
--; Function Attrs: convergent norecurse
--define weak_odr dso_local spir_kernel void @_ZTSZZ8min_testIdEvN2cl4sycl5queueEmENKUlRNS1_7handlerEE16_14clES4_EUlNS1_4itemILi1ELb1EEEE19_37(double addrspace(1)* %_arg_, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_1, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_2, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_3, double addrspace(1)* %_arg_4, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_6, %"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range"* byval(%"class._ZTSN2cl4sycl5rangeILi1EEE.cl::sycl::range") align 8 %_arg_7, %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* byval(%"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id") align 8 %_arg_8) local_unnamed_addr #0 comdat !kernel_arg_buffer_location !4 {
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func double @_Z15AtomicDoubleMinRd(double addrspace(4)* align 8 dereferenceable(8) %Arg) local_unnamed_addr #0 {
- entry:
-- %0 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_3, i64 0, i32 0, i32 0, i64 0
-- %1 = load i64, i64* %0, align 8
-- %add.ptr.i29 = getelementptr inbounds double, double addrspace(1)* %_arg_, i64 %1
-- %2 = getelementptr inbounds %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id", %"class._ZTSN2cl4sycl2idILi1EEE.cl::sycl::id"* %_arg_8, i64 0, i32 0, i32 0, i64 0
-- %3 = load i64, i64* %2, align 8
-- %add.ptr.i = getelementptr inbounds double, double addrspace(1)* %_arg_4, i64 %3
-- %4 = load <3 x i64>, <3 x i64> addrspace(4)* addrspacecast (<3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId to <3 x i64> addrspace(4)*), align 32, !noalias !18
-- %5 = extractelement <3 x i64> %4, i64 0
-- %conv.i = trunc i64 %5 to i32
-- %conv3.i = sitofp i32 %conv.i to double
-- %add.i = fadd double %conv3.i, 1.000000e+00
-+ %0 = addrspacecast double addrspace(4)* %Arg to double addrspace(1)*
- ; CHECK-SPIRV: 7 AtomicFMinEXT [[TYPE_FLOAT_64]]
-- ; CHECK-LLVM: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+]]({{.*}})
-- %call3.i.i.i = tail call spir_func double @_Z21__spirv_AtomicFMinEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %add.ptr.i29, i32 1, i32 896, double %add.i) #2
-- %sext.i = shl i64 %5, 32
-- %conv6.i = ashr exact i64 %sext.i, 32
-- %ptridx.i.i = getelementptr inbounds double, double addrspace(1)* %add.ptr.i, i64 %conv6.i
-- %ptridx.ascast.i.i = addrspacecast double addrspace(1)* %ptridx.i.i to double addrspace(4)*
-- store double %call3.i.i.i, double addrspace(4)* %ptridx.ascast.i.i, align 8, !tbaa !27
-- ret void
-+ ; CHECK-LLVM-CL12: call spir_func double @[[DOUBLE_FUNC_NAME:_Z10atomic_min[[:alnum:]]+dd]]({{.*}})
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_min_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+diid]]({{.*}})
-+ %call.i.i.i = tail call spir_func double @_Z21__spirv_AtomicFMinEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)* %0, i32 1, i32 896, double 1.000000e+00) #2
-+ ret double %call.i.i.i
- }
-
- ; Function Attrs: convergent
--; CHECK-LLVM: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double addrspace(1)*, i32, i32, double)
- declare dso_local spir_func double @_Z21__spirv_AtomicFMinEXTPU3AS1dN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEd(double addrspace(1)*, i32, i32, double) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-
--attributes #0 = { convergent norecurse "disable-tail-calls"="false" "frame-pointer"="all" "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"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "disable-tail-calls"="false" "frame-pointer"="all" "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"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
- attributes #1 = { convergent "disable-tail-calls"="false" "frame-pointer"="all" "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 }
-
-@@ -95,29 +68,5 @@ attributes #2 = { convergent nounwind }
- !0 = !{i32 1, !"wchar_size", i32 4}
- !1 = !{i32 1, i32 2}
- !2 = !{i32 4, i32 100000}
--!3 = !{!"clang version 12.0.0 (https://github.com/otcshare/llvm.git 67add71766d55d6a8d8d894822f583d6365a3b7d)"}
--!4 = !{i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1}
--!5 = !{!6, !8, !10, !12}
--!6 = distinct !{!6, !7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!7 = distinct !{!7, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!8 = distinct !{!8, !9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!9 = distinct !{!9, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!10 = distinct !{!10, !11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!11 = distinct !{!11, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!12 = distinct !{!12, !13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!13 = distinct !{!13, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!14 = !{!15, !15, i64 0}
--!15 = !{!"float", !16, i64 0}
--!16 = !{!"omnipotent char", !17, i64 0}
--!17 = !{!"Simple C++ TBAA"}
--!18 = !{!19, !21, !23, !25}
--!19 = distinct !{!19, !20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv: %agg.result"}
--!20 = distinct !{!20, !"_ZN7__spirv29InitSizesSTGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEE8initSizeEv"}
--!21 = distinct !{!21, !22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v: %agg.result"}
--!22 = distinct !{!22, !"_ZN7__spirvL22initGlobalInvocationIdILi1EN2cl4sycl2idILi1EEEEET0_v"}
--!23 = distinct !{!23, !24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv: %agg.result"}
--!24 = distinct !{!24, !"_ZN2cl4sycl6detail7Builder7getItemILi1ELb1EEENSt9enable_ifIXT0_EKNS0_4itemIXT_EXT0_EEEE4typeEv"}
--!25 = distinct !{!25, !26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE: %agg.result"}
--!26 = distinct !{!26, !"_ZN2cl4sycl6detail7Builder10getElementILi1ELb1EEEDTcl7getItemIXT_EXT0_EEEEPNS0_4itemIXT_EXT0_EEE"}
--!27 = !{!28, !28, i64 0}
--!28 = !{!"double", !16, i64 0}
-+!3 = !{!"clang version 13.0.0"}
-+
-diff --git a/test/AtomicFMinEXTForOCL.ll b/test/AtomicFMinEXTForOCL.ll
-new file mode 100644
-index 00000000..6196b0f8
---- /dev/null
-+++ b/test/AtomicFMinEXTForOCL.ll
-@@ -0,0 +1,64 @@
-+; RUN: llvm-as %s -o %t.bc
-+; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_EXT_shader_atomic_float_min_max -o %t.spv
-+; RUN: spirv-val %t.spv
-+; RUN: llvm-spirv -to-text %t.spv -o %t.spt
-+; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
-+
-+; RUN: llvm-spirv --spirv-target-env=CL2.0 -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-CL,CHECK-LLVM-CL20
-+
-+; RUN: llvm-spirv --spirv-target-env=SPV-IR -r %t.spv -o %t.rev.bc
-+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefixes=CHECK-LLVM-SPV
-+
-+target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
-+target triple = "spir-unknown-unknown"
-+
-+; CHECK-SPIRV: Capability AtomicFloat32MinMaxEXT
-+; CHECK-SPIRV: Capability AtomicFloat64MinMaxEXT
-+; CHECK-SPIRV: Extension "SPV_EXT_shader_atomic_float_min_max"
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_32:[0-9]+]] 32
-+; CHECK-SPIRV: TypeFloat [[TYPE_FLOAT_64:[0-9]+]] 64
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_float(float addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFMinEXT [[TYPE_FLOAT_32]]
-+ ; CHECK-LLVM-CL20: call spir_func float @[[FLOAT_FUNC_NAME:_Z25atomic_fetch_min_explicit[[:alnum:]]+_Atomicff[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func float @[[FLOAT_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+fiif]]({{.*}})
-+ %call = tail call spir_func float @_Z25atomic_fetch_min_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)* %a, float 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+
-+; Function Attrs: convergent
-+declare spir_func float @_Z25atomic_fetch_min_explicitPU3AS1VU7_Atomicff12memory_order(float addrspace(1)*, float, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+
-+; Function Attrs: convergent norecurse nounwind
-+define dso_local spir_func void @test_double(double addrspace(1)* %a) local_unnamed_addr #0 {
-+entry:
-+ ; CHECK-SPIRV: 7 AtomicFMinEXT [[TYPE_FLOAT_64]]
-+ ; CHECK-LLVM-CL20: call spir_func double @[[DOUBLE_FUNC_NAME:_Z25atomic_fetch_min_explicit[[:alnum:]]+_Atomicdd[a-zA-Z0-9_]+]]({{.*}})
-+ ; CHECK-LLVM-SPV: call spir_func double @[[DOUBLE_FUNC_NAME:_Z21__spirv_AtomicFMinEXT[[:alnum:]]+diid]]({{.*}})
-+ %call = tail call spir_func double @_Z25atomic_fetch_min_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)* %a, double 0.000000e+00, i32 0) #2
-+ ret void
-+}
-+
-+; Function Attrs: convergent
-+declare spir_func double @_Z25atomic_fetch_min_explicitPU3AS1VU7_Atomicdd12memory_order(double addrspace(1)*, double, i32) local_unnamed_addr #1
-+; CHECK-LLVM-SPV: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+; CHECK-LLVM-CL: declare {{.*}}spir_func float @[[FLOAT_FUNC_NAME]](float
-+; CHECK-LLVM-CL: declare {{.*}}spir_func double @[[DOUBLE_FUNC_NAME]](double
-+
-+attributes #0 = { convergent norecurse nounwind "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #1 = { convergent "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
-+attributes #2 = { convergent nounwind }
-+
-+!llvm.module.flags = !{!0}
-+!opencl.ocl.version = !{!1}
-+!opencl.spir.version = !{!1}
-+!llvm.ident = !{!2}
-+
-+!0 = !{i32 1, !"wchar_size", i32 4}
-+!1 = !{i32 2, i32 0}
-+!2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 94aa388f0ce0723bb15503cf41c2c15b288375b9)"}
-diff --git a/test/InvalidAtomicBuiltins.cl b/test/InvalidAtomicBuiltins.cl
-index b8ec5b89..2182f070 100644
---- a/test/InvalidAtomicBuiltins.cl
-+++ b/test/InvalidAtomicBuiltins.cl
-@@ -41,13 +41,9 @@ float __attribute__((overloadable)) atomic_fetch_xor(volatile generic atomic_flo
- double __attribute__((overloadable)) atomic_fetch_and(volatile generic atomic_double *object, double operand, memory_order order);
- double __attribute__((overloadable)) atomic_fetch_max(volatile generic atomic_double *object, double operand, memory_order order);
- double __attribute__((overloadable)) atomic_fetch_min(volatile generic atomic_double *object, double operand, memory_order order);
--float __attribute__((overloadable)) atomic_fetch_add_explicit(volatile generic atomic_float *object, float operand, memory_order order);
--float __attribute__((overloadable)) atomic_fetch_sub_explicit(volatile generic atomic_float *object, float operand, memory_order order);
- float __attribute__((overloadable)) atomic_fetch_or_explicit(volatile generic atomic_float *object, float operand, memory_order order);
- float __attribute__((overloadable)) atomic_fetch_xor_explicit(volatile generic atomic_float *object, float operand, memory_order order);
- double __attribute__((overloadable)) atomic_fetch_and_explicit(volatile generic atomic_double *object, double operand, memory_order order);
--double __attribute__((overloadable)) atomic_fetch_max_explicit(volatile generic atomic_double *object, double operand, memory_order order);
--double __attribute__((overloadable)) atomic_fetch_min_explicit(volatile generic atomic_double *object, double operand, memory_order order);
-
- __kernel void test_atomic_fn(volatile __global float *p,
- volatile __global double *pp,
-@@ -86,11 +82,7 @@ __kernel void test_atomic_fn(volatile __global float *p,
- d = atomic_fetch_and(pp, val, order);
- d = atomic_fetch_min(pp, val, order);
- d = atomic_fetch_max(pp, val, order);
-- f = atomic_fetch_add_explicit(p, val, order);
-- f = atomic_fetch_sub_explicit(p, val, order);
- f = atomic_fetch_or_explicit(p, val, order);
- f = atomic_fetch_xor_explicit(p, val, order);
- d = atomic_fetch_and_explicit(pp, val, order);
-- d = atomic_fetch_min_explicit(pp, val, order);
-- d = atomic_fetch_max_explicit(pp, val, order);
- }
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Memory-leak-fix-for-Managed-Static-Mutex.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Memory-leak-fix-for-Managed-Static-Mutex.patch
deleted file mode 100644
index 3b035f47..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0003-Memory-leak-fix-for-Managed-Static-Mutex.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From cfb18b75e8a353bc7486f337541476a36994b063 Mon Sep 17 00:00:00 2001
-From: juanrod2 <>
-Date: Tue, 22 Dec 2020 08:33:08 +0800
-Subject: [PATCH 3/7] 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.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0004-Remove-repo-name-in-LLVM-IR.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0004-Remove-repo-name-in-LLVM-IR.patch
deleted file mode 100644
index f8dec996..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0004-Remove-repo-name-in-LLVM-IR.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From b794037bf1f90a93efa4c542855ad569cb13b4c5 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 4/7] 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 1b6519b4b7c4..8fd6b23bb345 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.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0005-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0005-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch
deleted file mode 100644
index f8f177e5..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0005-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 3dd4766499d25e5978a5d90001f18e657e875da0 Mon Sep 17 00:00:00 2001
-From: haonanya <haonan.yang@intel.com>
-Date: Thu, 12 Aug 2021 15:48:34 +0800
-Subject: [PATCH 5/7] Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR
- doesn't require image support
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/clang/0003-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch]
-
-Signed-off-by: haonanya <haonan.yang@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/Frontend/InitPreprocessor.cpp | 3 ---
- clang/test/Preprocessor/predefined-macros.c | 4 ----
- 2 files changed, 7 deletions(-)
-
-diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
-index aefd208e6cd3..b4a84636673a 100644
---- a/clang/lib/Frontend/InitPreprocessor.cpp
-+++ b/clang/lib/Frontend/InitPreprocessor.cpp
-@@ -1108,9 +1108,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- if (TI.getSupportedOpenCLOpts().isSupported(#Ext)) \
- Builder.defineMacro(#Ext);
- #include "clang/Basic/OpenCLExtensions.def"
--
-- if (TI.getTriple().isSPIR())
-- Builder.defineMacro("__IMAGE_SUPPORT__");
- }
-
- if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
-diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c
-index b088a37ba665..39a222d02faf 100644
---- a/clang/test/Preprocessor/predefined-macros.c
-+++ b/clang/test/Preprocessor/predefined-macros.c
-@@ -184,10 +184,6 @@
- // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
- // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
-
--// RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \
--// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR
--// CHECK-SPIR: #define __IMAGE_SUPPORT__ 1
--
- // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP
- // CHECK-HIP-NOT: #define __CUDA_ARCH__
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0006-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0006-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch
deleted file mode 100644
index 0b4ee8c7..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0006-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 2c53abd0008bbecfcfe871c6060f4bbf1c94c74a Mon Sep 17 00:00:00 2001
-From: Raphael Isemann <teemperor@gmail.com>
-Date: Thu, 1 Apr 2021 18:41:44 +0200
-Subject: [PATCH 6/7] Avoid calling ParseCommandLineOptions in BackendUtil if
- possible
-
-Calling `ParseCommandLineOptions` should only be called from `main` as the
-CommandLine setup code isn't thread-safe. As BackendUtil is part of the
-generic Clang FrontendAction logic, a process which has several threads executing
-Clang FrontendActions will randomly crash in the unsafe setup code.
-
-This patch avoids calling the function unless either the debug-pass option or
-limit-float-precision option is set. Without these two options set the
-`ParseCommandLineOptions` call doesn't do anything beside parsing
-the command line `clang` which doesn't set any options.
-
-See also D99652 where LLDB received a workaround for this crash.
-
-Reviewed By: JDevlieghere
-
-Differential Revision: https://reviews.llvm.org/D99740
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/clang/0004-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch]
-
-Signed-off-by: Raphael Isemann <teemperor@gmail.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/CodeGen/BackendUtil.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
-index 0bfcab88a3a9..db8fd4166d7a 100644
---- a/clang/lib/CodeGen/BackendUtil.cpp
-+++ b/clang/lib/CodeGen/BackendUtil.cpp
-@@ -743,7 +743,15 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) {
- BackendArgs.push_back("-limit-float-precision");
- BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str());
- }
-+ // Check for the default "clang" invocation that won't set any cl::opt values.
-+ // Skip trying to parse the command line invocation to avoid the issues
-+ // described below.
-+ if (BackendArgs.size() == 1)
-+ return;
- BackendArgs.push_back(nullptr);
-+ // FIXME: The command line parser below is not thread-safe and shares a global
-+ // state, so this call might crash or overwrite the options of another Clang
-+ // instance in the same process.
- llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1,
- BackendArgs.data());
- }
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0007-support-cl_ext_float_atomics.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0007-support-cl_ext_float_atomics.patch
deleted file mode 100644
index f7d191ff..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0007-support-cl_ext_float_atomics.patch
+++ /dev/null
@@ -1,377 +0,0 @@
-From a685de6fc45afcdbe4a7120e9d5b33e175dd71cd Mon Sep 17 00:00:00 2001
-From: haonanya <haonan.yang@intel.com>
-Date: Fri, 13 Aug 2021 10:00:02 +0800
-Subject: [PATCH 7/7] support cl_ext_float_atomics
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/clang/0005-OpenCL-support-cl_ext_float_atomics.patch]
-
-Signed-off-by: haonanya <haonan.yang@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/Headers/opencl-c-base.h | 25 ++++
- clang/lib/Headers/opencl-c.h | 208 ++++++++++++++++++++++++++
- clang/test/Headers/opencl-c-header.cl | 96 ++++++++++++
- 3 files changed, 329 insertions(+)
-
-diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
-index 2cc688ccc3da..86bbee12fdf8 100644
---- a/clang/lib/Headers/opencl-c-base.h
-+++ b/clang/lib/Headers/opencl-c-base.h
-@@ -14,6 +14,31 @@
- #define CL_VERSION_3_0 300
- #endif
-
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+// For SPIR all extensions are supported.
-+#if defined(__SPIR__)
-+#define cl_ext_float_atomics 1
-+#ifdef cl_khr_fp16
-+#define __opencl_c_ext_fp16_global_atomic_load_store 1
-+#define __opencl_c_ext_fp16_local_atomic_load_store 1
-+#define __opencl_c_ext_fp16_global_atomic_add 1
-+#define __opencl_c_ext_fp16_local_atomic_add 1
-+#define __opencl_c_ext_fp16_global_atomic_min_max 1
-+#define __opencl_c_ext_fp16_local_atomic_min_max 1
-+#endif
-+#ifdef __opencl_c_fp64
-+#define __opencl_c_ext_fp64_global_atomic_add 1
-+#define __opencl_c_ext_fp64_local_atomic_add 1
-+#define __opencl_c_ext_fp64_global_atomic_min_max 1
-+#define __opencl_c_ext_fp64_local_atomic_min_max 1
-+#endif
-+#define __opencl_c_ext_fp32_global_atomic_add 1
-+#define __opencl_c_ext_fp32_local_atomic_add 1
-+#define __opencl_c_ext_fp32_global_atomic_min_max 1
-+#define __opencl_c_ext_fp32_local_atomic_min_max 1
-+#endif // defined(__SPIR__)
-+#endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+
- // Define features for 2.0 for header backward compatibility
- #ifndef __opencl_c_int64
- #define __opencl_c_int64 1
-diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
-index 67d900eb1c3d..b463e702d95e 100644
---- a/clang/lib/Headers/opencl-c.h
-+++ b/clang/lib/Headers/opencl-c.h
-@@ -14354,6 +14354,214 @@ intptr_t __ovld atomic_fetch_max_explicit(
- // defined(cl_khr_int64_extended_atomics)
- #endif // (__OPENCL_C_VERSION__ >= CL_VERSION_3_0)
-
-+#if defined(cl_ext_float_atomics)
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_max(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_min_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_global_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_max(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_min_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_max(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_min_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp64_global_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_max(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_min_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_global_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_max(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_min_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp64_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_max(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_min_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_add)
-+float __ovld atomic_fetch_add(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_sub(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_add_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_global_atomic_add)
-+
-+#if defined(__opencl_c_ext_fp32_local_atomic_add)
-+float __ovld atomic_fetch_add(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_sub(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_add_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_local_atomic_add)
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_add)
-+float __ovld atomic_fetch_add(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_sub(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_add_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp32_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_add)
-+
-+#if defined(__opencl_c_ext_fp64_global_atomic_add)
-+double __ovld atomic_fetch_add(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_sub(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_add_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_global_atomic_add)
-+
-+#if defined(__opencl_c_ext_fp64_local_atomic_add)
-+double __ovld atomic_fetch_add(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_sub(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_add_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_local_atomic_add)
-+
-+#if defined(__opencl_c_ext_fp64_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_add)
-+double __ovld atomic_fetch_add(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_sub(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_add_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif // defined(__opencl_c_ext_fp64_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_add)
-+
-+#endif // cl_ext_float_atomics
-+
- // atomic_store()
-
- #if defined(__opencl_c_atomic_scope_device) && \
-diff --git a/clang/test/Headers/opencl-c-header.cl b/clang/test/Headers/opencl-c-header.cl
-index 2716076acdcf..7f720cf28142 100644
---- a/clang/test/Headers/opencl-c-header.cl
-+++ b/clang/test/Headers/opencl-c-header.cl
-@@ -98,3 +98,99 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
- #pragma OPENCL EXTENSION cl_intel_planar_yuv : enable
-
- // CHECK-MOD: Reading modules
-+
-+// For SPIR all extensions are supported.
-+#if defined(__SPIR__)
-+
-+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+
-+#if __opencl_c_ext_fp16_global_atomic_load_store != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_load_store"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_load_store != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_load_store"
-+#endif
-+#if __opencl_c_ext_fp16_global_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp32_global_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_global_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp64_global_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp64_global_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp32_local_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_local_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp64_local_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp64_local_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp16_global_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp32_global_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_global_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp64_global_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp64_global_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp32_local_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_local_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp64_local_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp64_local_atomic_min_max"
-+#endif
-+#else
-+
-+#ifdef __opencl_c_ext_fp16_global_atomic_load_store
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_load_store defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_load_store
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_load_store defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp32_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp64_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp32_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp64_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp32_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp64_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp32_local_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp64_local_atomic_min_max defined"
-+#endif
-+
-+#endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-+
-+#endif // defined(__SPIR__)
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch
deleted file mode 100644
index 09be8202..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 294ca2fd69a077b35acec9d498120d6cb0324dae Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 11:53:27 +0800
-Subject: [PATCH 1/2] This patch is required to fix the crash referenced to in
- #1767
-
-It is a port of the following llvm 11.0 commit : https://reviews.llvm.org/D76994.
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/41f13f1f64d2074ae7512fb23656c22585e912bd]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- .../CodeGen/SelectionDAG/LegalizeTypes.cpp | 3 +-
- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 31 ++++++++++++-------
- 2 files changed, 21 insertions(+), 13 deletions(-)
-
-diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
-index 63ddb59fce68..822da2183269 100644
---- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
-+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
-@@ -173,7 +173,7 @@ void DAGTypeLegalizer::PerformExpensiveChecks() {
- }
- }
- }
--
-+#ifndef NDEBUG
- // Checked that NewNodes are only used by other NewNodes.
- for (unsigned i = 0, e = NewNodes.size(); i != e; ++i) {
- SDNode *N = NewNodes[i];
-@@ -181,6 +181,7 @@ void DAGTypeLegalizer::PerformExpensiveChecks() {
- UI != UE; ++UI)
- assert(UI->getNodeId() == NewNode && "NewNode used by non-NewNode!");
- }
-+#endif
- }
-
- /// This is the main entry point for the type legalizer. This does a top-down
-diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
-index faae14444d51..b908c5c58e9f 100644
---- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
-+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
-@@ -155,7 +155,9 @@ private:
- const SDValue &getSDValue(TableId &Id) {
- RemapId(Id);
- assert(Id && "TableId should be non-zero");
-- return IdToValueMap[Id];
-+ auto I = IdToValueMap.find(Id);
-+ assert(I != IdToValueMap.end() && "cannot find Id in map");
-+ return I->second;
- }
-
- public:
-@@ -172,24 +174,29 @@ public:
- bool run();
-
- void NoteDeletion(SDNode *Old, SDNode *New) {
-+ assert(Old != New && "node replaced with self");
- for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i) {
- TableId NewId = getTableId(SDValue(New, i));
- TableId OldId = getTableId(SDValue(Old, i));
-
-- if (OldId != NewId)
-+ if (OldId != NewId) {
- ReplacedValues[OldId] = NewId;
-
-- // Delete Node from tables.
-+ // Delete Node from tables. We cannot do this when OldId == NewId,
-+ // because NewId can still have table references to it in
-+ // ReplacedValues.
-+ IdToValueMap.erase(OldId);
-+ PromotedIntegers.erase(OldId);
-+ ExpandedIntegers.erase(OldId);
-+ SoftenedFloats.erase(OldId);
-+ PromotedFloats.erase(OldId);
-+ ExpandedFloats.erase(OldId);
-+ ScalarizedVectors.erase(OldId);
-+ SplitVectors.erase(OldId);
-+ WidenedVectors.erase(OldId);
-+ }
-+
- ValueToIdMap.erase(SDValue(Old, i));
-- IdToValueMap.erase(OldId);
-- PromotedIntegers.erase(OldId);
-- ExpandedIntegers.erase(OldId);
-- SoftenedFloats.erase(OldId);
-- PromotedFloats.erase(OldId);
-- ExpandedFloats.erase(OldId);
-- ScalarizedVectors.erase(OldId);
-- SplitVectors.erase(OldId);
-- WidenedVectors.erase(OldId);
- }
- }
-
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0009-ispc-10_0_fix_for_1788.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0009-ispc-10_0_fix_for_1788.patch
deleted file mode 100644
index 72877d83..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0009-ispc-10_0_fix_for_1788.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From d266087e8dba9e8fd4984e1cb85c20376e2c8ea3 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 11:56:01 +0800
-Subject: [PATCH 2/2] This patch is a fix for #1788.
-
-It is a port of the following llvm 11.0 commit: https://reviews.llvm.org/D81698
-This also needed part of another llvm 11.0 commit: https://reviews.llvm.org/D72975
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/aeb50448019ce1b1002f3781f9647d486320d83c]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/include/llvm/IR/PatternMatch.h | 22 ++++++++++++---
- .../InstCombine/InstructionCombining.cpp | 27 +++++++++++++++++--
- 2 files changed, 44 insertions(+), 5 deletions(-)
-
-diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
-index 6621fc9f819c..fb7ad93519f6 100644
---- a/llvm/include/llvm/IR/PatternMatch.h
-+++ b/llvm/include/llvm/IR/PatternMatch.h
-@@ -152,8 +152,10 @@ inline match_combine_and<LTy, RTy> m_CombineAnd(const LTy &L, const RTy &R) {
-
- struct apint_match {
- const APInt *&Res;
-+ bool AllowUndef;
-
-- apint_match(const APInt *&R) : Res(R) {}
-+ apint_match(const APInt *&Res, bool AllowUndef)
-+ : Res(Res), AllowUndef(AllowUndef) {}
-
- template <typename ITy> bool match(ITy *V) {
- if (auto *CI = dyn_cast<ConstantInt>(V)) {
-@@ -162,7 +164,8 @@ struct apint_match {
- }
- if (V->getType()->isVectorTy())
- if (const auto *C = dyn_cast<Constant>(V))
-- if (auto *CI = dyn_cast_or_null<ConstantInt>(C->getSplatValue())) {
-+ if (auto *CI = dyn_cast_or_null<ConstantInt>(
-+ C->getSplatValue(AllowUndef))) {
- Res = &CI->getValue();
- return true;
- }
-@@ -192,7 +195,20 @@ struct apfloat_match {
-
- /// Match a ConstantInt or splatted ConstantVector, binding the
- /// specified pointer to the contained APInt.
--inline apint_match m_APInt(const APInt *&Res) { return Res; }
-+inline apint_match m_APInt(const APInt *&Res) {
-+ // Forbid undefs by default to maintain previous behavior.
-+ return apint_match(Res, /* AllowUndef */ false);
-+}
-+
-+/// Match APInt while allowing undefs in splat vector constants.
-+inline apint_match m_APIntAllowUndef(const APInt *&Res) {
-+ return apint_match(Res, /* AllowUndef */ true);
-+}
-+
-+/// Match APInt while forbidding undefs in splat vector constants.
-+inline apint_match m_APIntForbidUndef(const APInt *&Res) {
-+ return apint_match(Res, /* AllowUndef */ false);
-+}
-
- /// Match a ConstantFP or splatted ConstantVector, binding the
- /// specified pointer to the contained APFloat.
-diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
-index bf32996d96e2..40a246b9d7a7 100644
---- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
-+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
-@@ -925,8 +925,31 @@ Instruction *InstCombiner::FoldOpIntoSelect(Instruction &Op, SelectInst *SI) {
- if (auto *CI = dyn_cast<CmpInst>(SI->getCondition())) {
- if (CI->hasOneUse()) {
- Value *Op0 = CI->getOperand(0), *Op1 = CI->getOperand(1);
-- if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) ||
-- (SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1))
-+
-+ // FIXME: This is a hack to avoid infinite looping with min/max patterns.
-+ // We have to ensure that vector constants that only differ with
-+ // undef elements are treated as equivalent.
-+ auto areLooselyEqual = [](Value *A, Value *B) {
-+ if (A == B)
-+ return true;
-+
-+ // Test for vector constants.
-+ Constant *ConstA, *ConstB;
-+ if (!match(A, m_Constant(ConstA)) || !match(B, m_Constant(ConstB)))
-+ return false;
-+
-+ // TODO: Deal with FP constants?
-+ if (!A->getType()->isIntOrIntVectorTy() || A->getType() != B->getType())
-+ return false;
-+
-+ // Compare for equality including undefs as equal.
-+ auto *Cmp = ConstantExpr::getCompare(ICmpInst::ICMP_EQ, ConstA, ConstB);
-+ const APInt *C;
-+ return match(Cmp, m_APIntAllowUndef(C)) && C->isOneValue();
-+ };
-+
-+ if ((areLooselyEqual(TV, Op0) && areLooselyEqual(FV, Op1)) ||
-+ (areLooselyEqual(FV, Op0) && areLooselyEqual(TV, Op1)))
- return nullptr;
- }
- }
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0010-ispc-10_0_fix_for_1793.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0010-ispc-10_0_fix_for_1793.patch
deleted file mode 100644
index fc6935a1..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0010-ispc-10_0_fix_for_1793.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 8f83e2b7618da7a98a30839a8f41a6dd82dec468 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:00:23 +0800
-Subject: [PATCH 1/2] This patch is required to fix stability problem #1793
-
-It's backport of the following llvm 11.0 commit: 120c5f1057dc50229f73bc75bbabf4df6ee50fef
-
-Upstream-Status: Backport
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-index 2476fd26f250..2743acc89bca 100644
---- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -10702,8 +10702,9 @@ SDValue DAGCombiner::visitSIGN_EXTEND_VECTOR_INREG(SDNode *N) {
- SDValue N0 = N->getOperand(0);
- EVT VT = N->getValueType(0);
-
-+ // zext_vector_inreg(undef) = 0 because the top bits will be zero.
- if (N0.isUndef())
-- return DAG.getUNDEF(VT);
-+ return DAG.getConstant(0, SDLoc(N), VT);
-
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
- return Res;
-@@ -10718,8 +10719,9 @@ SDValue DAGCombiner::visitZERO_EXTEND_VECTOR_INREG(SDNode *N) {
- SDValue N0 = N->getOperand(0);
- EVT VT = N->getValueType(0);
-
-+ // sext_vector_inreg(undef) = 0 because the top bit will all be the same.
- if (N0.isUndef())
-- return DAG.getUNDEF(VT);
-+ return DAG.getConstant(0, SDLoc(N), VT);
-
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
- return Res;
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0011-ispc-10_0_fix_for_1844.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0011-ispc-10_0_fix_for_1844.patch
deleted file mode 100644
index e3e70107..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0011-ispc-10_0_fix_for_1844.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 62b05a69b4a185cd0b7535f19742686e19fcaf22 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:02:37 +0800
-Subject: [PATCH 2/2] Fix for #1844, affects avx512skx-i8x64 and
- avx512skx-i16x32.
-
-It's a port of 11.0 commit edcfb47ff6d5562e22207f364c65f84302aa346b
-https://reviews.llvm.org/D76312
-
-Upstream-Status: Backport
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-index 2743acc89bca..439a8367dabe 100644
---- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -10841,7 +10841,9 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
-
- // Attempt to pre-truncate BUILD_VECTOR sources.
- if (N0.getOpcode() == ISD::BUILD_VECTOR && !LegalOperations &&
-- TLI.isTruncateFree(SrcVT.getScalarType(), VT.getScalarType())) {
-+ TLI.isTruncateFree(SrcVT.getScalarType(), VT.getScalarType()) &&
-+ // Avoid creating illegal types if running after type legalizer.
-+ (!LegalTypes || TLI.isTypeLegal(VT.getScalarType()))) {
- SDLoc DL(N);
- EVT SVT = VT.getScalarType();
- SmallVector<SDValue, 8> TruncOps;
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0012-ispc-10_0_i8_shuffle_avx512_i8_i16.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0012-ispc-10_0_i8_shuffle_avx512_i8_i16.patch
deleted file mode 100644
index 8aca5fbf..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0012-ispc-10_0_i8_shuffle_avx512_i8_i16.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From cc4301f82ca1bde1d438c3708de285b0ab8c72d3 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:07:25 +0800
-Subject: [PATCH 1/2] [X86] createVariablePermute - handle case where recursive
- createVariablePermute call fails
-
-Account for the case where a recursive createVariablePermute call with a wider vector type fails.
-
-Original test case from @craig.topper (Craig Topper)
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/6bdd63dc28208a597542b0c6bc41093f32417804]
-
-Signed-off-by: Simon Pilgrim <llvm-dev@redking.me.uk>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/Target/X86/X86ISelLowering.cpp | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
-index c8720d9ae3a6..63eb050e9b3a 100644
---- a/llvm/lib/Target/X86/X86ISelLowering.cpp
-+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
-@@ -9571,9 +9571,11 @@ static SDValue createVariablePermute(MVT VT, SDValue SrcVec, SDValue IndicesVec,
- IndicesVT = EVT(VT).changeVectorElementTypeToInteger();
- IndicesVec = widenSubVector(IndicesVT.getSimpleVT(), IndicesVec, false,
- Subtarget, DAG, SDLoc(IndicesVec));
-- return extractSubVector(
-- createVariablePermute(VT, SrcVec, IndicesVec, DL, DAG, Subtarget), 0,
-- DAG, DL, SizeInBits);
-+ SDValue NewSrcVec =
-+ createVariablePermute(VT, SrcVec, IndicesVec, DL, DAG, Subtarget);
-+ if (NewSrcVec)
-+ return extractSubVector(NewSrcVec, 0, DAG, DL, SizeInBits);
-+ return SDValue();
- } else if (SrcVec.getValueSizeInBits() < SizeInBits) {
- // Widen smaller SrcVec to match VT.
- SrcVec = widenSubVector(VT, SrcVec, false, Subtarget, DAG, SDLoc(SrcVec));
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch
deleted file mode 100644
index e03c279f..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9cdff0785d5cf9effc8e922d3330311c4d3dda78 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:09:42 +0800
-Subject: [PATCH 2/2] This patch is needed for avx512skx-i8x64 and
- avx512skx-i16x32 targets.
-
-This is combination of two commits:
-- 0cd6712a7af0fa2702b5d4cc733500eb5e62e7d0 - stability fix.
-- d8ad7cc0885f32104a7cd83c77191aec15fd684f - performance follow up.
-
-Upstream-Status: Backport
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 23 +++++++++++++++++--
- 1 file changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-index 439a8367dabe..b1639c7f275d 100644
---- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -18471,6 +18471,26 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
-
- // Allow targets to opt-out.
- EVT VT = Extract->getValueType(0);
-+
-+ // We can only create byte sized loads.
-+ if (!VT.isByteSized())
-+ return SDValue();
-+
-+ unsigned Index = ExtIdx->getZExtValue();
-+ unsigned NumElts = VT.getVectorNumElements();
-+
-+ // If the index is a multiple of the extract element count, we can offset the
-+ // address by the store size multiplied by the subvector index. Otherwise if
-+ // the scalar type is byte sized, we can just use the index multiplied by
-+ // the element size in bytes as the offset.
-+ unsigned Offset;
-+ if (Index % NumElts == 0)
-+ Offset = (Index / NumElts) * VT.getStoreSize();
-+ else if (VT.getScalarType().isByteSized())
-+ Offset = Index * VT.getScalarType().getStoreSize();
-+ else
-+ return SDValue();
-+
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
- if (!TLI.shouldReduceLoadWidth(Ld, Ld->getExtensionType(), VT))
- return SDValue();
-@@ -18478,8 +18498,7 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
- // The narrow load will be offset from the base address of the old load if
- // we are extracting from something besides index 0 (little-endian).
- SDLoc DL(Extract);
-- SDValue BaseAddr = Ld->getOperand(1);
-- unsigned Offset = ExtIdx->getZExtValue() * VT.getScalarType().getStoreSize();
-+ SDValue BaseAddr = Ld->getBasePtr();
-
- // TODO: Use "BaseIndexOffset" to make this more effective.
- SDValue NewAddr = DAG.getMemBasePlusOffset(BaseAddr, Offset, DL);
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0014-ispc-10_0_packed_load_store_avx512skx.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0014-ispc-10_0_packed_load_store_avx512skx.patch
deleted file mode 100644
index d1768216..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0014-ispc-10_0_packed_load_store_avx512skx.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From c2ebd328979c081dd2c9fd0e359ed99473731d0e Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:13:00 +0800
-Subject: [PATCH 1/2] [X86] When storing v1i1/v2i1/v4i1 to memory, make sure we
- store zeros in the rest of the byte
-
-We can't store garbage in the unused bits. It possible that something like zextload from i1/i2/i4 is created to read the memory. Those zextloads would be legalized assuming the extra bits are 0.
-
-I'm not sure that the code in lowerStore is executed for the v1i1/v2i1/v4i1 case. It looks like the DAG combine in combineStore may have converted them to v8i1 first. And I think we're missing some cases to avoid going to the stack in the first place. But I don't have time to investigate those things at the moment so I wanted to focus on the correctness issue.
-
-Should fix PR48147.
-
-Reviewed By: RKSimon
-
-Differential Revision: https://reviews.llvm.org/D9129
-
-Upstream-Status: Backport
-
-Signed-off-by:Craig Topper <craig.topper@sifive.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/Target/X86/X86ISelLowering.cpp | 20 ++++++++++++++------
- llvm/lib/Target/X86/X86InstrAVX512.td | 2 --
- 2 files changed, 14 insertions(+), 8 deletions(-)
-
-diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
-index 63eb050e9b3a..96b5e2cfbd82 100644
---- a/llvm/lib/Target/X86/X86ISelLowering.cpp
-+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
-@@ -22688,17 +22688,22 @@ static SDValue LowerStore(SDValue Op, const X86Subtarget &Subtarget,
- // Without AVX512DQ, we need to use a scalar type for v2i1/v4i1/v8i1 stores.
- if (StoredVal.getValueType().isVector() &&
- StoredVal.getValueType().getVectorElementType() == MVT::i1) {
-- assert(StoredVal.getValueType().getVectorNumElements() <= 8 &&
-- "Unexpected VT");
-+ unsigned NumElts = StoredVal.getValueType().getVectorNumElements();
-+ assert(NumElts <= 8 && "Unexpected VT");
- assert(!St->isTruncatingStore() && "Expected non-truncating store");
- assert(Subtarget.hasAVX512() && !Subtarget.hasDQI() &&
- "Expected AVX512F without AVX512DQI");
-
-+ // We must pad with zeros to ensure we store zeroes to any unused bits.
- StoredVal = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, MVT::v16i1,
- DAG.getUNDEF(MVT::v16i1), StoredVal,
- DAG.getIntPtrConstant(0, dl));
- StoredVal = DAG.getBitcast(MVT::i16, StoredVal);
- StoredVal = DAG.getNode(ISD::TRUNCATE, dl, MVT::i8, StoredVal);
-+ // Make sure we store zeros in the extra bits.
-+ if (NumElts < 8)
-+ StoredVal = DAG.getZeroExtendInReg(StoredVal, dl,
-+ MVT::getIntegerVT(NumElts));
-
- return DAG.getStore(St->getChain(), dl, StoredVal, St->getBasePtr(),
- St->getPointerInfo(), St->getAlignment(),
-@@ -41585,8 +41590,10 @@ static SDValue combineStore(SDNode *N, SelectionDAG &DAG,
-
- EVT NewVT = EVT::getIntegerVT(*DAG.getContext(), VT.getVectorNumElements());
- StoredVal = DAG.getBitcast(NewVT, StoredVal);
--
-- return DAG.getStore(St->getChain(), dl, StoredVal, St->getBasePtr(),
-+ SDValue Val = StoredVal.getOperand(0);
-+ // We must store zeros to the unused bits.
-+ Val = DAG.getZeroExtendInReg(Val, dl, MVT::i1);
-+ return DAG.getStore(St->getChain(), dl, Val, St->getBasePtr(),
- St->getPointerInfo(), St->getAlignment(),
- St->getMemOperand()->getFlags());
- }
-@@ -41602,10 +41609,11 @@ static SDValue combineStore(SDNode *N, SelectionDAG &DAG,
- }
-
- // Widen v2i1/v4i1 stores to v8i1.
-- if ((VT == MVT::v2i1 || VT == MVT::v4i1) && VT == StVT &&
-+ if ((VT == MVT::v1i1 || VT == MVT::v2i1 || VT == MVT::v4i1) && VT == StVT &&
- Subtarget.hasAVX512()) {
- unsigned NumConcats = 8 / VT.getVectorNumElements();
-- SmallVector<SDValue, 4> Ops(NumConcats, DAG.getUNDEF(VT));
-+ // We must store zeros to the unused bits.
-+ SmallVector<SDValue, 4> Ops(NumConcats, DAG.getConstant(0, dl, VT));
- Ops[0] = StoredVal;
- StoredVal = DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v8i1, Ops);
- return DAG.getStore(St->getChain(), dl, StoredVal, St->getBasePtr(),
-diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td
-index 32f012033fb0..d3b92183f87b 100644
---- a/llvm/lib/Target/X86/X86InstrAVX512.td
-+++ b/llvm/lib/Target/X86/X86InstrAVX512.td
-@@ -2888,8 +2888,6 @@ def : Pat<(i64 (bitconvert (v64i1 VK64:$src))),
-
- // Load/store kreg
- let Predicates = [HasDQI] in {
-- def : Pat<(store VK1:$src, addr:$dst),
-- (KMOVBmk addr:$dst, (COPY_TO_REGCLASS VK1:$src, VK8))>;
-
- def : Pat<(v1i1 (load addr:$src)),
- (COPY_TO_REGCLASS (KMOVBkm addr:$src), VK1)>;
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0015-ispc-10_0_vXi1calling_avx512_i8_i16.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0015-ispc-10_0_vXi1calling_avx512_i8_i16.patch
deleted file mode 100644
index 03b40e9b..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0015-ispc-10_0_vXi1calling_avx512_i8_i16.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From c1565af764adceca118daad0f592e5f14c2bdd4a Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 12:15:09 +0800
-Subject: [PATCH 2/2] [X86] Convert vXi1 vectors to xmm/ymm/zmm types via
- getRegisterTypeForCallingConv rather than using CCPromoteToType in the td
- file
-
- Previously we tried to promote these to xmm/ymm/zmm by promoting
- in the X86CallingConv.td file. But this breaks when we run out
- of xmm/ymm/zmm registers and need to fall back to memory. We end
- up trying to create a non-sensical scalar to vector. This lead
- to an assertion. The new tests in avx512-calling-conv.ll all
- trigger this assertion.
-
- Since we really want to treat these types like we do on avx2,
- it seems better to promote them before the calling convention
- code gets involved. Except when the calling convention is one
- that passes the vXi1 type in a k register.
-
- The changes in avx512-regcall-Mask.ll are because we indicated
- that xmm/ymm/zmm types should be passed indirectly for the
- Win64 ABI before we go to the common lines that promoted the
- vXi1 types. This caused the promoted types to be picked up by
- the default calling convention code. Now we promote them earlier
- so they get passed indirectly as though they were xmm/ymm/zmm.
-
- Differential Revision: https://reviews.llvm.org/D75154
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/eadea7868f5b7542ee6bdcd9a975697a0c919ffc]
-
-Signed-off-by:Craig Topper <craig.topper@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/Target/X86/X86ISelLowering.cpp | 90 +++++++++++++++++--------
- 1 file changed, 61 insertions(+), 29 deletions(-)
-
-diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
-index 96b5e2cfbd82..d5de94aeb8a2 100644
---- a/llvm/lib/Target/X86/X86ISelLowering.cpp
-+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
-@@ -2085,51 +2085,83 @@ X86TargetLowering::getPreferredVectorAction(MVT VT) const {
- return TargetLoweringBase::getPreferredVectorAction(VT);
- }
-
-+static std::pair<MVT, unsigned>
-+handleMaskRegisterForCallingConv(unsigned NumElts, CallingConv::ID CC,
-+ const X86Subtarget &Subtarget) {
-+ // v2i1/v4i1/v8i1/v16i1 all pass in xmm registers unless the calling
-+ // convention is one that uses k registers.
-+ if (NumElts == 2)
-+ return {MVT::v2i64, 1};
-+ if (NumElts == 4)
-+ return {MVT::v4i32, 1};
-+ if (NumElts == 8 && CC != CallingConv::X86_RegCall &&
-+ CC != CallingConv::Intel_OCL_BI)
-+ return {MVT::v8i16, 1};
-+ if (NumElts == 16 && CC != CallingConv::X86_RegCall &&
-+ CC != CallingConv::Intel_OCL_BI)
-+ return {MVT::v16i8, 1};
-+ // v32i1 passes in ymm unless we have BWI and the calling convention is
-+ // regcall.
-+ if (NumElts == 32 && (!Subtarget.hasBWI() || CC != CallingConv::X86_RegCall))
-+ return {MVT::v32i8, 1};
-+ // Split v64i1 vectors if we don't have v64i8 available.
-+ if (NumElts == 64 && Subtarget.hasBWI() && CC != CallingConv::X86_RegCall) {
-+ if (Subtarget.useAVX512Regs())
-+ return {MVT::v64i8, 1};
-+ return {MVT::v32i8, 2};
-+ }
-+
-+ // Break wide or odd vXi1 vectors into scalars to match avx2 behavior.
-+ if (!isPowerOf2_32(NumElts) || (NumElts == 64 && !Subtarget.hasBWI()) ||
-+ NumElts > 64)
-+ return {MVT::i8, NumElts};
-+
-+ return {MVT::INVALID_SIMPLE_VALUE_TYPE, 0};
-+}
-+
- MVT X86TargetLowering::getRegisterTypeForCallingConv(LLVMContext &Context,
- CallingConv::ID CC,
- EVT VT) const {
-- // v32i1 vectors should be promoted to v32i8 to match avx2.
-- if (VT == MVT::v32i1 && Subtarget.hasAVX512() && !Subtarget.hasBWI())
-- return MVT::v32i8;
-- // Break wide or odd vXi1 vectors into scalars to match avx2 behavior.
- if (VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
-- Subtarget.hasAVX512() &&
-- (!isPowerOf2_32(VT.getVectorNumElements()) ||
-- (VT.getVectorNumElements() > 16 && !Subtarget.hasBWI()) ||
-- (VT.getVectorNumElements() > 64 && Subtarget.hasBWI())))
-- return MVT::i8;
-- // Split v64i1 vectors if we don't have v64i8 available.
-- if (VT == MVT::v64i1 && Subtarget.hasBWI() && !Subtarget.useAVX512Regs() &&
-- CC != CallingConv::X86_RegCall)
-- return MVT::v32i1;
-+ Subtarget.hasAVX512()) {
-+ unsigned NumElts = VT.getVectorNumElements();
-+
-+ MVT RegisterVT;
-+ unsigned NumRegisters;
-+ std::tie(RegisterVT, NumRegisters) =
-+ handleMaskRegisterForCallingConv(NumElts, CC, Subtarget);
-+ if (RegisterVT != MVT::INVALID_SIMPLE_VALUE_TYPE)
-+ return RegisterVT;
-+ }
-+
- // FIXME: Should we just make these types legal and custom split operations?
- if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !EnableOldKNLABI &&
- Subtarget.useAVX512Regs() && !Subtarget.hasBWI())
- return MVT::v16i32;
-+
- return TargetLowering::getRegisterTypeForCallingConv(Context, CC, VT);
- }
-
- unsigned X86TargetLowering::getNumRegistersForCallingConv(LLVMContext &Context,
- CallingConv::ID CC,
- EVT VT) const {
-- // v32i1 vectors should be promoted to v32i8 to match avx2.
-- if (VT == MVT::v32i1 && Subtarget.hasAVX512() && !Subtarget.hasBWI())
-- return 1;
-- // Break wide or odd vXi1 vectors into scalars to match avx2 behavior.
- if (VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
-- Subtarget.hasAVX512() &&
-- (!isPowerOf2_32(VT.getVectorNumElements()) ||
-- (VT.getVectorNumElements() > 16 && !Subtarget.hasBWI()) ||
-- (VT.getVectorNumElements() > 64 && Subtarget.hasBWI())))
-- return VT.getVectorNumElements();
-- // Split v64i1 vectors if we don't have v64i8 available.
-- if (VT == MVT::v64i1 && Subtarget.hasBWI() && !Subtarget.useAVX512Regs() &&
-- CC != CallingConv::X86_RegCall)
-- return 2;
-+ Subtarget.hasAVX512()) {
-+ unsigned NumElts = VT.getVectorNumElements();
-+
-+ MVT RegisterVT;
-+ unsigned NumRegisters;
-+ std::tie(RegisterVT, NumRegisters) =
-+ handleMaskRegisterForCallingConv(NumElts, CC, Subtarget);
-+ if (RegisterVT != MVT::INVALID_SIMPLE_VALUE_TYPE)
-+ return NumRegisters;
-+ }
-+
- // FIXME: Should we just make these types legal and custom split operations?
- if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !EnableOldKNLABI &&
- Subtarget.useAVX512Regs() && !Subtarget.hasBWI())
- return 1;
-+
- return TargetLowering::getNumRegistersForCallingConv(Context, CC, VT);
- }
-
-@@ -2140,8 +2172,8 @@ unsigned X86TargetLowering::getVectorTypeBreakdownForCallingConv(
- if (VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
- Subtarget.hasAVX512() &&
- (!isPowerOf2_32(VT.getVectorNumElements()) ||
-- (VT.getVectorNumElements() > 16 && !Subtarget.hasBWI()) ||
-- (VT.getVectorNumElements() > 64 && Subtarget.hasBWI()))) {
-+ (VT.getVectorNumElements() == 64 && !Subtarget.hasBWI()) ||
-+ VT.getVectorNumElements() > 64)) {
- RegisterVT = MVT::i8;
- IntermediateVT = MVT::i1;
- NumIntermediates = VT.getVectorNumElements();
-@@ -2151,7 +2183,7 @@ unsigned X86TargetLowering::getVectorTypeBreakdownForCallingConv(
- // Split v64i1 vectors if we don't have v64i8 available.
- if (VT == MVT::v64i1 && Subtarget.hasBWI() && !Subtarget.useAVX512Regs() &&
- CC != CallingConv::X86_RegCall) {
-- RegisterVT = MVT::v32i1;
-+ RegisterVT = MVT::v32i8;
- IntermediateVT = MVT::v32i1;
- NumIntermediates = 2;
- return 2;
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Enable-the-call-site-info-only-for-g-optimizations.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Enable-the-call-site-info-only-for-g-optimizations.patch
deleted file mode 100644
index 2e3872dc..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Enable-the-call-site-info-only-for-g-optimizations.patch
+++ /dev/null
@@ -1,550 +0,0 @@
-From 447cb2e1b2f0d8bdcfd8a0b39f47d28de50b5d82 Mon Sep 17 00:00:00 2001
-From: Djordje Todorovic <djordje.todorovic@syrmia.com>
-Date: Mon, 9 Mar 2020 11:02:35 +0100
-Subject: [PATCH] Enable the call site info only for -g + optimizations
-
-Emit call site info only in the case of '-g' + 'O>0' level.
-
-Differential Revision: https://reviews.llvm.org/D75175
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/c15c68abdc6f1afece637bdedba808676191a8e6]
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- clang/include/clang/Basic/CodeGenOptions.def | 2 ++
- clang/lib/CodeGen/BackendUtil.cpp | 1 +
- clang/lib/Frontend/CompilerInvocation.cpp | 4 +++-
- llvm/include/llvm/CodeGen/CommandFlags.inc | 7 +++++++
- llvm/include/llvm/Target/TargetOptions.h | 7 ++++++-
- llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 4 ++--
- llvm/lib/CodeGen/MachineFunction.cpp | 2 +-
- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 2 +-
- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 2 +-
- llvm/lib/Target/ARM/ARMISelLowering.cpp | 2 +-
- llvm/lib/Target/X86/X86ISelLowering.cpp | 2 +-
- llvm/test/CodeGen/MIR/Hexagon/bundled-call-site-info.mir | 2 +-
- llvm/test/CodeGen/X86/call-site-info-output.ll | 4 ++--
- llvm/test/DebugInfo/AArch64/call-site-info-output.ll | 2 +-
- llvm/test/DebugInfo/ARM/call-site-info-output.ll | 2 +-
- .../MIR/AArch64/dbgcall-site-interpret-movzxi.mir | 2 +-
- .../DebugInfo/MIR/AArch64/dbgcall-site-interpretation.mir | 2 +-
- llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir | 2 +-
- .../test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir | 2 +-
- .../test/DebugInfo/MIR/ARM/dbgcall-site-interpretation.mir | 2 +-
- .../DebugInfo/MIR/ARM/dbgcall-site-propagated-value.mir | 2 +-
- llvm/test/DebugInfo/MIR/ARM/if-coverter-call-site-info.mir | 2 +-
- .../MIR/Hexagon/dbgcall-site-instr-before-bundled-call.mir | 2 +-
- .../MIR/Hexagon/live-debug-values-bundled-entry-values.mir | 2 +-
- llvm/test/DebugInfo/MIR/SystemZ/call-site-lzer.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir | 2 +-
- .../test/DebugInfo/MIR/X86/dbgcall-site-copy-super-sub.mir | 2 +-
- .../test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir | 2 +-
- .../DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir | 2 +-
- .../DebugInfo/MIR/X86/dbgcall-site-two-fwd-reg-defs.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir | 4 ++--
- .../DebugInfo/MIR/X86/entry-value-of-modified-param.mir | 2 +-
- llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir | 2 +-
- .../DebugInfo/MIR/X86/propagate-entry-value-cross-bbs.mir | 2 +-
- .../test/DebugInfo/MIR/X86/unreachable-block-call-site.mir | 2 +-
- llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll | 2 +-
- llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll | 2 +-
- .../tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll | 2 +-
- 41 files changed, 58 insertions(+), 41 deletions(-)
-
-diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
-index 1ecae98b13b1..6a6a9465273f 100644
---- a/clang/include/clang/Basic/CodeGenOptions.def
-+++ b/clang/include/clang/Basic/CodeGenOptions.def
-@@ -64,6 +64,8 @@ CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new
- ///< pass manager.
- CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled.
- CODEGENOPT(EnableDebugEntryValues, 1, 0) ///< Emit call site parameter dbg info
-+CODEGENOPT(EmitCallSiteInfo, 1, 0) ///< Emit call site info only in the case of
-+ ///< '-g' + 'O>0' level.
- CODEGENOPT(IndirectTlsSegRefs, 1, 0) ///< Set when -mno-tls-direct-seg-refs
- ///< is specified.
- CODEGENOPT(DisableTailCalls , 1, 0) ///< Do not emit tail calls.
-diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
-index db8fd4166d7a..db09f9b641fe 100644
---- a/clang/lib/CodeGen/BackendUtil.cpp
-+++ b/clang/lib/CodeGen/BackendUtil.cpp
-@@ -482,6 +482,7 @@ static void initTargetOptions(llvm::TargetOptions &Options,
- Options.EmitAddrsig = CodeGenOpts.Addrsig;
- Options.EnableDebugEntryValues = CodeGenOpts.EnableDebugEntryValues;
- Options.ForceDwarfFrameSection = CodeGenOpts.ForceDwarfFrameSection;
-+ Options.EmitCallSiteInfo = CodeGenOpts.EmitCallSiteInfo;
-
- Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile;
- Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
-diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
-index 18fa06bf3c6d..2e73dcbdebe4 100644
---- a/clang/lib/Frontend/CompilerInvocation.cpp
-+++ b/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -789,8 +789,10 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
-
- llvm::Triple T(TargetOpts.Triple);
- if (Opts.OptimizationLevel > 0 && Opts.hasReducedDebugInfo() &&
-- llvm::is_contained(DebugEntryValueArchs, T.getArch()))
-+ llvm::is_contained(DebugEntryValueArchs, T.getArch())) {
- Opts.EnableDebugEntryValues = Args.hasArg(OPT_femit_debug_entry_values);
-+ Opts.EmitCallSiteInfo = true;
-+ }
-
- Opts.DisableO0ImplyOptNone = Args.hasArg(OPT_disable_O0_optnone);
- Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone);
-diff --git a/llvm/include/llvm/CodeGen/CommandFlags.inc b/llvm/include/llvm/CodeGen/CommandFlags.inc
-index 6475a5b19edb..36073fe9cc98 100644
---- a/llvm/include/llvm/CodeGen/CommandFlags.inc
-+++ b/llvm/include/llvm/CodeGen/CommandFlags.inc
-@@ -286,6 +286,12 @@ static cl::opt<bool>
- EnableAddrsig("addrsig", cl::desc("Emit an address-significance table"),
- cl::init(false));
-
-+static cl::opt<bool> EmitCallSiteInfo(
-+ "emit-call-site-info",
-+ cl::desc(
-+ "Emit call site debug information, if debug information is enabled."),
-+ cl::init(false));
-+
- static cl::opt<bool>
- EnableDebugEntryValues("debug-entry-values",
- cl::desc("Emit debug info about parameter's entry values"),
-@@ -349,6 +355,7 @@ static TargetOptions InitTargetOptionsFromCodeGenFlags() {
- Options.ExceptionModel = ExceptionModel;
- Options.EmitStackSizeSection = EnableStackSizeSection;
- Options.EmitAddrsig = EnableAddrsig;
-+ Options.EmitCallSiteInfo = EmitCallSiteInfo;
- Options.EnableDebugEntryValues = EnableDebugEntryValues;
- Options.ForceDwarfFrameSection = ForceDwarfFrameSection;
-
-diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
-index d27c7b0178f0..9378e290bed1 100644
---- a/llvm/include/llvm/Target/TargetOptions.h
-+++ b/llvm/include/llvm/Target/TargetOptions.h
-@@ -134,7 +134,8 @@ namespace llvm {
- EmulatedTLS(false), ExplicitEmulatedTLS(false), EnableIPRA(false),
- EmitStackSizeSection(false), EnableMachineOutliner(false),
- SupportsDefaultOutlining(false), EmitAddrsig(false),
-- EnableDebugEntryValues(false), ForceDwarfFrameSection(false) {}
-+ EmitCallSiteInfo(false), EnableDebugEntryValues(false),
-+ ForceDwarfFrameSection(false) {}
-
- /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
- /// option is specified on the command line, and should enable debugging
-@@ -281,6 +282,10 @@ namespace llvm {
- /// to selectively generate basic block sections.
- std::shared_ptr<MemoryBuffer> BBSectionsFuncListBuf;
-
-+ /// The flag enables call site info production. It is used only for debug
-+ /// info, and it is restricted only to optimized code. This can be used for
-+ /// something else, so that should be controlled in the frontend.
-+ unsigned EmitCallSiteInfo : 1;
- /// Emit debug info about parameter's entry values.
- unsigned EnableDebugEntryValues : 1;
-
-diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
-index 10157c746b46..f955bdc6186a 100644
---- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
-+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
-@@ -381,11 +381,11 @@ bool MIRParserImpl::initializeCallSiteInfo(
- CSInfo.emplace_back(Reg, ArgRegPair.ArgNo);
- }
-
-- if (TM.Options.EnableDebugEntryValues)
-+ if (TM.Options.EmitCallSiteInfo)
- MF.addCallArgsForwardingRegs(&*CallI, std::move(CSInfo));
- }
-
-- if (YamlMF.CallSitesInfo.size() && !TM.Options.EnableDebugEntryValues)
-+ if (YamlMF.CallSitesInfo.size() && !TM.Options.EmitCallSiteInfo)
- return error(Twine("Call site info provided but not used"));
- return false;
- }
-diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
-index 4612690644fe..c3795b7ed314 100644
---- a/llvm/lib/CodeGen/MachineFunction.cpp
-+++ b/llvm/lib/CodeGen/MachineFunction.cpp
-@@ -855,7 +855,7 @@ MachineFunction::CallSiteInfoMap::iterator
- MachineFunction::getCallSiteInfo(const MachineInstr *MI) {
- assert(MI->isCall() && "Call site info refers only to call instructions!");
-
-- if (!Target.Options.EnableDebugEntryValues)
-+ if (!Target.Options.EmitCallSiteInfo)
- return CallSitesInfo.end();
- return CallSitesInfo.find(MI);
- }
-diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
-index 0e4d783e3505..52099f24aca5 100644
---- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
-+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
-@@ -863,7 +863,7 @@ EmitSchedule(MachineBasicBlock::iterator &InsertPos) {
- MI = &*std::next(Before);
- }
-
-- if (MI->isCall() && DAG->getTarget().Options.EnableDebugEntryValues)
-+ if (MI->isCall() && DAG->getTarget().Options.EmitCallSiteInfo)
- MF.addCallArgsForwardingRegs(MI, DAG->getSDCallSiteInfo(Node));
-
- return MI;
-diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
-index 23f05eaad944..63ff3031a5e8 100644
---- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
-+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
-@@ -4132,7 +4132,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
- RegsToPass.emplace_back(VA.getLocReg(), Arg);
- RegsUsed.insert(VA.getLocReg());
- const TargetOptions &Options = DAG.getTarget().Options;
-- if (Options.EnableDebugEntryValues)
-+ if (Options.EmitCallSiteInfo)
- CSInfo.emplace_back(VA.getLocReg(), i);
- }
- } else {
-diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
-index 9f504b1eaa42..5589ba34a2ac 100644
---- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
-+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
-@@ -2222,7 +2222,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
- isThisReturn = true;
- }
- const TargetOptions &Options = DAG.getTarget().Options;
-- if (Options.EnableDebugEntryValues)
-+ if (Options.EmitCallSiteInfo)
- CSInfo.emplace_back(VA.getLocReg(), i);
- RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
- } else if (isByVal) {
-diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
-index d5de94aeb8a2..4808bdf6ddc2 100644
---- a/llvm/lib/Target/X86/X86ISelLowering.cpp
-+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
-@@ -4030,7 +4030,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
- } else if (VA.isRegLoc()) {
- RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
- const TargetOptions &Options = DAG.getTarget().Options;
-- if (Options.EnableDebugEntryValues)
-+ if (Options.EmitCallSiteInfo)
- CSInfo.emplace_back(VA.getLocReg(), I);
- if (isVarArg && IsWin64) {
- // Win64 ABI requires argument XMM reg to be copied to the corresponding
-diff --git a/llvm/test/CodeGen/MIR/Hexagon/bundled-call-site-info.mir b/llvm/test/CodeGen/MIR/Hexagon/bundled-call-site-info.mir
-index 5ffa0293a2e1..fec542223fc9 100644
---- a/llvm/test/CodeGen/MIR/Hexagon/bundled-call-site-info.mir
-+++ b/llvm/test/CodeGen/MIR/Hexagon/bundled-call-site-info.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=none -verify-machineinstrs -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=none -verify-machineinstrs -o - %s | FileCheck %s
-
- # Verify that it is possible to read and write MIR where a callSites entry
- # points to a call residing in a bundle. The offset should point to the call
-diff --git a/llvm/test/CodeGen/X86/call-site-info-output.ll b/llvm/test/CodeGen/X86/call-site-info-output.ll
-index 4b1e236aadfe..a0438f0c2b98 100644
---- a/llvm/test/CodeGen/X86/call-site-info-output.ll
-+++ b/llvm/test/CodeGen/X86/call-site-info-output.ll
-@@ -1,6 +1,6 @@
- ; Test call site info MIR printer and parser.Parser assertions and machine
- ; verifier will check the rest;
--; RUN: llc -debug-entry-values %s -stop-before=finalize-isel -o %t.mir
-+; RUN: llc -emit-call-site-info -debug-entry-values %s -stop-before=finalize-isel -o %t.mir
- ; RUN: cat %t.mir | FileCheck %s
- ; CHECK: name: fn2
- ; CHECK: callSites:
-@@ -10,7 +10,7 @@
- ; CHECK-NEXT: arg: 0, reg: '$edi'
- ; CHECK-NEXT: arg: 1, reg: '$esi'
- ; CHECK-NEXT: arg: 2, reg: '$edx'
--; RUN: llc -debug-entry-values %t.mir -run-pass=finalize-isel -o -| FileCheck %s --check-prefix=PARSER
-+; RUN: llc -emit-call-site-info -debug-entry-values %t.mir -run-pass=finalize-isel -o -| FileCheck %s --check-prefix=PARSER
- ; Verify that we are able to parse output mir and that we are getting the same result.
- ; PARSER: name: fn2
- ; PARSER: callSites:
-diff --git a/llvm/test/DebugInfo/AArch64/call-site-info-output.ll b/llvm/test/DebugInfo/AArch64/call-site-info-output.ll
-index d52d6962f3c4..17d9f7f18762 100644
---- a/llvm/test/DebugInfo/AArch64/call-site-info-output.ll
-+++ b/llvm/test/DebugInfo/AArch64/call-site-info-output.ll
-@@ -1,4 +1,4 @@
--; RUN: llc -mtriple aarch64-linux-gnu -debug-entry-values %s -o - -stop-before=finalize-isel | FileCheck %s
-+; RUN: llc -emit-call-site-info -mtriple aarch64-linux-gnu -debug-entry-values %s -o - -stop-before=finalize-isel | FileCheck %s
- ; Verify that Selection DAG knows how to recognize simple function parameter forwarding registers.
- ; Produced from:
- ; extern int fn1(int,int,int);
-diff --git a/llvm/test/DebugInfo/ARM/call-site-info-output.ll b/llvm/test/DebugInfo/ARM/call-site-info-output.ll
-index 9255a7d57dde..ed726dfe753f 100644
---- a/llvm/test/DebugInfo/ARM/call-site-info-output.ll
-+++ b/llvm/test/DebugInfo/ARM/call-site-info-output.ll
-@@ -1,4 +1,4 @@
--; RUN: llc -mtriple arm-linux-gnu -debug-entry-values %s -o - -stop-before=finalize-isel | FileCheck %s
-+; RUN: llc -emit-call-site-info -mtriple arm-linux-gnu -debug-entry-values %s -o - -stop-before=finalize-isel | FileCheck %s
- ; Verify that Selection DAG knows how to recognize simple function parameter forwarding registers.
- ; Produced from:
- ; extern int fn1(int,int,int);
-diff --git a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpret-movzxi.mir b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpret-movzxi.mir
-index dc7561ca6400..057779a90721 100644
---- a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpret-movzxi.mir
-+++ b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpret-movzxi.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
- #
- # Based on the following C reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpretation.mir b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpretation.mir
-index 0371ccef603e..d925bc395878 100644
---- a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpretation.mir
-+++ b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-interpretation.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
- # Following code is used for producing this test case. Note that
- # some of argument loading instruction are modified in order to
- # cover certain cases.
-diff --git a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir
-index 916a14022ba5..4a87dad3b9b5 100644
---- a/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir
-+++ b/llvm/test/DebugInfo/MIR/AArch64/dbgcall-site-orr-moves.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-after=livedebugvalues -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-
- # Based on the following C reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir b/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir
-index fbf9b3454689..d85f2d25391d 100644
---- a/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir
-+++ b/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -start-after=livedebugvalues -filetype=obj -o - %s \
-+# RUN: llc -emit-call-site-info -start-after=livedebugvalues -filetype=obj -o - %s \
- # RUN: | llvm-dwarfdump -v - | FileCheck %s
-
- # This tests for a crash in DwarfDebug's singular DBG_VALUE range promotion when
-diff --git a/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-interpretation.mir b/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-interpretation.mir
-index ce8dc97f0e72..0ae4e6ec485c 100644
---- a/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-interpretation.mir
-+++ b/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-interpretation.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple=arm-linux-gnueabi -debug-entry-values -filetype=obj -start-after=machineverifier %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -mtriple=arm-linux-gnueabi -debug-entry-values -filetype=obj -start-after=machineverifier %s -o -| llvm-dwarfdump -| FileCheck %s
- # Following code is used for producing this test case. Note that
- # some of argument loading instruction are modified in order to
- # cover certain cases.
-diff --git a/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-propagated-value.mir b/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-propagated-value.mir
-index 9001c8ba8eea..5b84d9e9627f 100644
---- a/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-propagated-value.mir
-+++ b/llvm/test/DebugInfo/MIR/ARM/dbgcall-site-propagated-value.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -o - %s | FileCheck %s
-
- # Based on the following C reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/ARM/if-coverter-call-site-info.mir b/llvm/test/DebugInfo/MIR/ARM/if-coverter-call-site-info.mir
-index aa7b54c1e5bb..11e9c4c90836 100644
---- a/llvm/test/DebugInfo/MIR/ARM/if-coverter-call-site-info.mir
-+++ b/llvm/test/DebugInfo/MIR/ARM/if-coverter-call-site-info.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple=arm-linux-gnu -debug-entry-values -run-pass if-converter %s -o -| FileCheck %s
-+# RUN: llc -emit-call-site-info -mtriple=arm-linux-gnu -debug-entry-values -run-pass if-converter %s -o -| FileCheck %s
-
- # Vefify that the call site info will be updated after the optimization.
- # This test case would previously trigger an assertion when
-diff --git a/llvm/test/DebugInfo/MIR/Hexagon/dbgcall-site-instr-before-bundled-call.mir b/llvm/test/DebugInfo/MIR/Hexagon/dbgcall-site-instr-before-bundled-call.mir
-index 8ae628af2c09..3ae23d4189bf 100644
---- a/llvm/test/DebugInfo/MIR/Hexagon/dbgcall-site-instr-before-bundled-call.mir
-+++ b/llvm/test/DebugInfo/MIR/Hexagon/dbgcall-site-instr-before-bundled-call.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple hexagon -debug-entry-values -start-after=machineverifier -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
-+# RUN: llc -mtriple hexagon -emit-call-site-info -debug-entry-values -start-after=machineverifier -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
-
- # Based on the following C reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir b/llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir
-index ff0a539dd15d..8bb0b3202acd 100644
---- a/llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir
-+++ b/llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -o - %s | FileCheck %s
-
- # Verify that the entry values for the input parameters are inserted after the
- # bundles which contains the registers' clobbering instructions (the calls to
-diff --git a/llvm/test/DebugInfo/MIR/SystemZ/call-site-lzer.mir b/llvm/test/DebugInfo/MIR/SystemZ/call-site-lzer.mir
-index 8a4e8b5632c2..3cf41467f7f9 100644
---- a/llvm/test/DebugInfo/MIR/SystemZ/call-site-lzer.mir
-+++ b/llvm/test/DebugInfo/MIR/SystemZ/call-site-lzer.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-after=livedebugvalues -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -o - %s | FileCheck %s
-
- # This test would previously trigger an assertion when trying to describe the
- # call site value for callee()'s float parameter.
-diff --git a/llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir b/llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir
-index e6fe5d2de878..4e5a07321d42 100644
---- a/llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
- # RUN: llvm-dwarfdump %t | FileCheck %s
- #
- # int global;
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir b/llvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir
-index c32a1155d038..edeef2c7aed4 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbg-call-site-spilled-arg.mir
-@@ -1,6 +1,6 @@
- # Check that llvm can describe a call site parameter which resides in a spill slot.
- #
--# RUN: llc -debug-entry-values -start-after=machineverifier -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=machineverifier -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
- #
- # Command:
- # $ ~/src/builds/llvm-project-master-RA/bin/clang -g -Xclang -femit-debug-entry-values -O2 -c -o spill.o spill.cc -mllvm -stop-before=machineverifier -o spill.mir
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-copy-super-sub.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-copy-super-sub.mir
-index a2d51a203512..01a2b887a60b 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-copy-super-sub.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-copy-super-sub.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-after=livedebugvalues -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-
- # Based on the following reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir
-index f9e9459f1abd..104bc0146798 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
- #
- # CHECK: DW_TAG_GNU_call_site
- # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo"
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir
-index 1bb70f6d4530..4d88fa9aab74 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
- # CHECK: DW_TAG_GNU_call_site
- # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo")
- # CHECK-NEXT: DW_AT_low_pc {{.*}}
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir
-index 235787573f51..81af598ba194 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -start-before=livedebugvalues -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -start-before=livedebugvalues -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-
- # Based on the following C++ code:
- # struct A { A(A &) {} };
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-two-fwd-reg-defs.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-two-fwd-reg-defs.mir
-index db0934c595c3..46adedd1be44 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-two-fwd-reg-defs.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-two-fwd-reg-defs.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -O1 -debug-entry-values -start-after=livedebugvalues -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
-+# RUN: llc -O1 -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
-
- # Based on the following C reproducer:
- #
-diff --git a/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir b/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir
-index 5d203029936e..1d7b64f169d1 100644
---- a/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
- #
- #extern void fn2(int);
- #
-diff --git a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir
-index e79be66cd4e3..c39bc4db50be 100644
---- a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir
-@@ -2,8 +2,8 @@
- # When the debugger tuning is set to gdb, use GNU opcodes.
- # For lldb, use the standard DWARF5 opcodes.
-
--# RUN: llc -debug-entry-values -debugger-tune=gdb -filetype=obj -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-GNU
--# RUN: llc -debug-entry-values -debugger-tune=lldb -filetype=obj -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5
-+# RUN: llc -emit-call-site-info -debug-entry-values -debugger-tune=gdb -filetype=obj -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-GNU
-+# RUN: llc -emit-call-site-info -debug-entry-values -debugger-tune=lldb -filetype=obj -mtriple=x86_64-unknown-unknown -start-after=machineverifier -o - %s | llvm-dwarfdump - | FileCheck %s -check-prefixes=CHECK-DWARF5
- #
- # extern void foo(int *a, int b, int c, int d, int e, int f);
- # extern int getVal();
-diff --git a/llvm/test/DebugInfo/MIR/X86/entry-value-of-modified-param.mir b/llvm/test/DebugInfo/MIR/X86/entry-value-of-modified-param.mir
-index 8d121c3a30b9..c7f15aaaa562 100644
---- a/llvm/test/DebugInfo/MIR/X86/entry-value-of-modified-param.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/entry-value-of-modified-param.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
- #
- #extern void fn1 (int, int, int);
- #
-diff --git a/llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir b/llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir
-index 2396daada876..aa8fdd7afd47 100644
---- a/llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
- #
- # The test case was artificially adjusted, in order to make proper diamond basic
- # block structure relevant to the debug entry values propagation.
-diff --git a/llvm/test/DebugInfo/MIR/X86/propagate-entry-value-cross-bbs.mir b/llvm/test/DebugInfo/MIR/X86/propagate-entry-value-cross-bbs.mir
-index 86b1cddaa462..c5af863954bf 100644
---- a/llvm/test/DebugInfo/MIR/X86/propagate-entry-value-cross-bbs.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/propagate-entry-value-cross-bbs.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
-+# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
- #
- #extern void fn1 (int, int, int);
- #__attribute__((noinline))
-diff --git a/llvm/test/DebugInfo/MIR/X86/unreachable-block-call-site.mir b/llvm/test/DebugInfo/MIR/X86/unreachable-block-call-site.mir
-index d282d796f6d7..ea9c12b5a192 100644
---- a/llvm/test/DebugInfo/MIR/X86/unreachable-block-call-site.mir
-+++ b/llvm/test/DebugInfo/MIR/X86/unreachable-block-call-site.mir
-@@ -1,4 +1,4 @@
--# RUN: llc -mtriple=x86_64-pc-linux -debug-entry-values -run-pass=unreachable-mbb-elimination -o - %s | FileCheck %s
-+# RUN: llc -mtriple=x86_64-pc-linux -emit-call-site-info -debug-entry-values -run-pass=unreachable-mbb-elimination -o - %s | FileCheck %s
-
- # Verify that the call site information for the call residing in the eliminated
- # block is removed. This test case would previously trigger an assertion when
-diff --git a/llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll b/llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll
-index b698f1cdbfe8..b8cd9574cc63 100644
---- a/llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll
-+++ b/llvm/test/DebugInfo/X86/dbgcall-site-64-bit-imms.ll
-@@ -1,4 +1,4 @@
--; RUN: llc -O1 -debug-entry-values -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-+; RUN: llc -O1 -emit-call-site-info -debug-entry-values -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-
- ; Verify that the 64-bit call site immediates are not truncated.
- ;
-diff --git a/llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll b/llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll
-index 9fe67f82a2b4..5d37774f55d6 100644
---- a/llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll
-+++ b/llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll
-@@ -1,4 +1,4 @@
--; RUN: llc -O3 -debug-entry-values -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-+; RUN: llc -O3 -emit-call-site-info -debug-entry-values -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
-
- target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- target triple = "x86_64-unknown-linux-gnu"
-diff --git a/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll b/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll
-index c304e9d768a5..d126757398ff 100644
---- a/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll
-+++ b/llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll
-@@ -1,4 +1,4 @@
--; RUN: llc -debug-entry-values %s -o - -filetype=obj \
-+; RUN: llc -emit-call-site-info -debug-entry-values %s -o - -filetype=obj \
- ; RUN: | llvm-dwarfdump -statistics - | FileCheck %s
- ;
- ; The LLVM IR file was generated on this source code by using
---
-2.33.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Replace-MCTargetOptionsCommandFlags.inc-and-CommandF.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Replace-MCTargetOptionsCommandFlags.inc-and-CommandF.patch
deleted file mode 100644
index 6b2db931..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-Replace-MCTargetOptionsCommandFlags.inc-and-CommandF.patch
+++ /dev/null
@@ -1,2243 +0,0 @@
-From fd7146658e3b4ce045dfb332c2edf216f76c1e1f Mon Sep 17 00:00:00 2001
-From: serge-sans-paille <sguelton@redhat.com>
-Date: Wed, 4 Mar 2020 00:47:43 +0100
-Subject: [PATCH] Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc
- by runtime registration
-
-MCTargetOptionsCommandFlags.inc and CommandFlags.inc are headers which contain
-cl::opt with static storage.
-These headers are meant to be incuded by tools to make it easier to parametrize
-codegen/mc.
-
-However, these headers are also included in at least two libraries: lldCommon
-and handle-llvm. As a result, when creating DYLIB, clang-cpp holds a reference
-to the options, and lldCommon holds another reference. Linking the two in a
-single executable, as zig does[0], results in a double registration.
-
-This patch explores an other approach: the .inc files are moved to regular
-files, and the registration happens on-demand through static declaration of
-options in the constructor of a static object.
-
-[0] https://bugzilla.redhat.com/show_bug.cgi?id=1756977#c5
-
-Differential Revision: https://reviews.llvm.org/D75579
-
-Upstream-Status: Backport
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- .../clang-fuzzer/handle-llvm/handle_llvm.cpp | 32 +-
- lld/Common/TargetOptionsCommandFlags.cpp | 25 +-
- llvm/include/llvm/CodeGen/CommandFlags.h | 149 +++++
- .../llvm/MC/MCTargetOptionsCommandFlags.h | 54 ++
- .../llvm/MC/MCTargetOptionsCommandFlags.inc | 65 --
- llvm/include/llvm/module.modulemap | 3 -
- llvm/lib/CodeGen/CMakeLists.txt | 1 +
- llvm/lib/CodeGen/CommandFlags.cpp | 588 ++++++++++++++++++
- llvm/lib/MC/CMakeLists.txt | 1 +
- llvm/lib/MC/MCTargetOptionsCommandFlags.cpp | 105 ++++
- llvm/tools/dsymutil/DwarfStreamer.cpp | 7 +-
- llvm/tools/gold/gold-plugin.cpp | 16 +-
- llvm/tools/llc/CMakeLists.txt | 1 +
- llvm/tools/llc/llc.cpp | 43 +-
- llvm/tools/lli/CMakeLists.txt | 1 +
- llvm/tools/lli/lli.cpp | 41 +-
- llvm/tools/llvm-dwp/llvm-dwp.cpp | 6 +-
- .../llvm-isel-fuzzer/llvm-isel-fuzzer.cpp | 17 +-
- llvm/tools/llvm-lto/CMakeLists.txt | 5 +-
- llvm/tools/llvm-lto/llvm-lto.cpp | 28 +-
- llvm/tools/llvm-lto2/CMakeLists.txt | 1 +
- llvm/tools/llvm-lto2/llvm-lto2.cpp | 20 +-
- .../llvm-mc-assemble-fuzzer/CMakeLists.txt | 1 +
- .../llvm-mc-assemble-fuzzer.cpp | 12 +-
- llvm/tools/llvm-mc/CMakeLists.txt | 1 +
- llvm/tools/llvm-mc/llvm-mc.cpp | 6 +-
- llvm/tools/llvm-mca/llvm-mca.cpp | 8 +-
- .../tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp | 16 +-
- llvm/tools/lto/CMakeLists.txt | 4 +-
- llvm/tools/lto/lto.cpp | 35 +-
- llvm/tools/opt/opt.cpp | 23 +-
- .../DebugInfo/DWARF/DwarfGenerator.cpp | 6 +-
- 32 files changed, 1088 insertions(+), 233 deletions(-)
- create mode 100644 llvm/include/llvm/CodeGen/CommandFlags.h
- create mode 100644 llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
- delete mode 100644 llvm/include/llvm/MC/MCTargetOptionsCommandFlags.inc
- create mode 100644 llvm/lib/CodeGen/CommandFlags.cpp
- create mode 100644 llvm/lib/MC/MCTargetOptionsCommandFlags.cpp
-
-diff --git a/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp b/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
-index d8ab14594185..aefb761cd70c 100644
---- a/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
-+++ b/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
-@@ -19,7 +19,7 @@
- #include "llvm/ADT/Triple.h"
- #include "llvm/Analysis/TargetLibraryInfo.h"
- #include "llvm/Analysis/TargetTransformInfo.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/CodeGen/MachineModuleInfo.h"
- #include "llvm/CodeGen/TargetPassConfig.h"
- #include "llvm/ExecutionEngine/JITEventListener.h"
-@@ -29,9 +29,9 @@
- #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
- #include "llvm/ExecutionEngine/SectionMemoryManager.h"
- #include "llvm/IR/IRPrintingPasses.h"
-+#include "llvm/IR/LLVMContext.h"
- #include "llvm/IR/LegacyPassManager.h"
- #include "llvm/IR/LegacyPassNameParser.h"
--#include "llvm/IR/LLVMContext.h"
- #include "llvm/IR/Module.h"
- #include "llvm/IR/Verifier.h"
- #include "llvm/IRReader/IRReader.h"
-@@ -42,12 +42,14 @@
- #include "llvm/Support/TargetRegistry.h"
- #include "llvm/Support/TargetSelect.h"
- #include "llvm/Target/TargetMachine.h"
--#include "llvm/Transforms/IPO/PassManagerBuilder.h"
- #include "llvm/Transforms/IPO.h"
-+#include "llvm/Transforms/IPO/PassManagerBuilder.h"
- #include "llvm/Transforms/Vectorize.h"
-
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- // Define a type for the functions that are compiled and executed
- typedef void (*LLVMFunc)(int*, int*, int*, int);
-
-@@ -100,15 +102,17 @@ static std::string OptLLVM(const std::string &IR, CodeGenOpt::Level OLvl) {
- ErrorAndExit("Could not parse IR");
-
- Triple ModuleTriple(M->getTargetTriple());
-- const TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ const TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- std::string E;
-- const Target *TheTarget = TargetRegistry::lookupTarget(MArch, ModuleTriple, E);
-- TargetMachine *Machine =
-- TheTarget->createTargetMachine(M->getTargetTriple(), getCPUStr(),
-- getFeaturesStr(), Options, getRelocModel(),
-- getCodeModel(), OLvl);
-+ const Target *TheTarget =
-+ TargetRegistry::lookupTarget(codegen::getMArch(), ModuleTriple, E);
-+ TargetMachine *Machine = TheTarget->createTargetMachine(
-+ M->getTargetTriple(), codegen::getCPUStr(), codegen::getFeaturesStr(),
-+ Options, codegen::getExplicitRelocModel(),
-+ codegen::getExplicitCodeModel(), OLvl);
- std::unique_ptr<TargetMachine> TM(Machine);
-- setFunctionAttributes(getCPUStr(), getFeaturesStr(), *M);
-+ codegen::setFunctionAttributes(codegen::getCPUStr(),
-+ codegen::getFeaturesStr(), *M);
-
- legacy::PassManager Passes;
-
-@@ -154,14 +158,14 @@ static void CreateAndRunJITFunc(const std::string &IR, CodeGenOpt::Level OLvl) {
-
- std::string ErrorMsg;
- EngineBuilder builder(std::move(M));
-- builder.setMArch(MArch);
-- builder.setMCPU(getCPUStr());
-- builder.setMAttrs(getFeatureList());
-+ builder.setMArch(codegen::getMArch());
-+ builder.setMCPU(codegen::getCPUStr());
-+ builder.setMAttrs(codegen::getFeatureList());
- builder.setErrorStr(&ErrorMsg);
- builder.setEngineKind(EngineKind::JIT);
- builder.setMCJITMemoryManager(std::make_unique<SectionMemoryManager>());
- builder.setOptLevel(OLvl);
-- builder.setTargetOptions(InitTargetOptionsFromCodeGenFlags());
-+ builder.setTargetOptions(codegen::InitTargetOptionsFromCodeGenFlags());
-
- std::unique_ptr<ExecutionEngine> EE(builder.create());
- if (!EE)
-diff --git a/lld/Common/TargetOptionsCommandFlags.cpp b/lld/Common/TargetOptionsCommandFlags.cpp
-index 0137feb63f37..9b166a3e130a 100644
---- a/lld/Common/TargetOptionsCommandFlags.cpp
-+++ b/lld/Common/TargetOptionsCommandFlags.cpp
-@@ -5,35 +5,26 @@
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- //===----------------------------------------------------------------------===//
--//
--// This file exists as a place for global variables defined in LLVM's
--// CodeGen/CommandFlags.inc. By putting the resulting object file in
--// an archive and linking with it, the definitions will automatically be
--// included when needed and skipped when already present.
--//
--//===----------------------------------------------------------------------===//
-
- #include "lld/Common/TargetOptionsCommandFlags.h"
-
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/Target/TargetOptions.h"
-
--// Define an externally visible version of
--// initTargetOptionsFromCodeGenFlags, so that its functionality can be
--// used without having to include llvm/CodeGen/CommandFlags.inc, which
--// would lead to multiple definitions of the command line flags.
-+static llvm::codegen::RegisterCodeGenFlags CGF;
-+
- llvm::TargetOptions lld::initTargetOptionsFromCodeGenFlags() {
-- return ::InitTargetOptionsFromCodeGenFlags();
-+ return llvm::codegen::InitTargetOptionsFromCodeGenFlags();
- }
-
- llvm::Optional<llvm::Reloc::Model> lld::getRelocModelFromCMModel() {
-- return getRelocModel();
-+ return llvm::codegen::getExplicitRelocModel();
- }
-
- llvm::Optional<llvm::CodeModel::Model> lld::getCodeModelFromCMModel() {
-- return getCodeModel();
-+ return llvm::codegen::getExplicitCodeModel();
- }
-
--std::string lld::getCPUStr() { return ::getCPUStr(); }
-+std::string lld::getCPUStr() { return llvm::codegen::getCPUStr(); }
-
--std::vector<std::string> lld::getMAttrs() { return ::MAttrs; }
-+std::vector<std::string> lld::getMAttrs() { return llvm::codegen::getMAttrs(); }
-diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
-new file mode 100644
-index 000000000000..cdec26879f73
---- /dev/null
-+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
-@@ -0,0 +1,149 @@
-+//===-- CommandFlags.h - Command Line Flags Interface -----------*- C++ -*-===//
-+//
-+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-+// See https://llvm.org/LICENSE.txt for license information.
-+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-+//
-+//===----------------------------------------------------------------------===//
-+//
-+// This file contains codegen-specific flags that are shared between different
-+// command line tools. The tools "llc" and "opt" both use this file to prevent
-+// flag duplication.
-+//
-+//===----------------------------------------------------------------------===//
-+
-+#include "llvm/ADT/StringExtras.h"
-+#include "llvm/IR/Instructions.h"
-+#include "llvm/IR/Intrinsics.h"
-+#include "llvm/IR/Module.h"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
-+#include "llvm/MC/SubtargetFeature.h"
-+#include "llvm/Support/CodeGen.h"
-+#include "llvm/Support/CommandLine.h"
-+#include "llvm/Support/Host.h"
-+#include "llvm/Target/TargetMachine.h"
-+#include "llvm/Target/TargetOptions.h"
-+#include <string>
-+
-+namespace llvm {
-+
-+namespace codegen {
-+
-+std::string getMArch();
-+
-+std::string getMCPU();
-+
-+std::vector<std::string> getMAttrs();
-+
-+Reloc::Model getRelocModel();
-+Optional<Reloc::Model> getExplicitRelocModel();
-+
-+ThreadModel::Model getThreadModel();
-+
-+CodeModel::Model getCodeModel();
-+Optional<CodeModel::Model> getExplicitCodeModel();
-+
-+llvm::ExceptionHandling getExceptionModel();
-+
-+CodeGenFileType getFileType();
-+Optional<CodeGenFileType> getExplicitFileType();
-+
-+CodeGenFileType getFileType();
-+
-+llvm::FramePointer::FP getFramePointerUsage();
-+
-+bool getEnableUnsafeFPMath();
-+
-+bool getEnableNoInfsFPMath();
-+
-+bool getEnableNoNaNsFPMath();
-+
-+bool getEnableNoSignedZerosFPMath();
-+
-+bool getEnableNoTrappingFPMath();
-+
-+llvm::FPDenormal::DenormalMode getDenormalFPMath();
-+
-+bool getEnableHonorSignDependentRoundingFPMath();
-+
-+llvm::FloatABI::ABIType getFloatABIForCalls();
-+
-+llvm::FPOpFusion::FPOpFusionMode getFuseFPOps();
-+
-+bool getDontPlaceZerosInBSS();
-+
-+bool getEnableGuaranteedTailCallOpt();
-+
-+bool getDisableTailCalls();
-+
-+bool getStackSymbolOrdering();
-+
-+unsigned getOverrideStackAlignment();
-+
-+bool getStackRealign();
-+
-+std::string getTrapFuncName();
-+
-+bool getUseCtors();
-+
-+bool getRelaxELFRelocations();
-+
-+bool getDataSections();
-+Optional<bool> getExplicitDataSections();
-+
-+bool getFunctionSections();
-+Optional<bool> getExplicitFunctionSections();
-+
-+std::string getBBSections();
-+
-+unsigned getTLSSize();
-+
-+bool getEmulatedTLS();
-+
-+bool getUniqueSectionNames();
-+
-+bool getUniqueBBSectionNames();
-+
-+llvm::EABI getEABIVersion();
-+
-+llvm::DebuggerKind getDebuggerTuningOpt();
-+
-+bool getEnableStackSizeSection();
-+
-+bool getEnableAddrsig();
-+
-+bool getEmitCallSiteInfo();
-+
-+bool getEnableDebugEntryValues();
-+
-+bool getForceDwarfFrameSection();
-+
-+/// Create this object with static storage to register codegen-related command
-+/// line options.
-+struct RegisterCodeGenFlags {
-+ RegisterCodeGenFlags();
-+};
-+
-+llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
-+
-+// Common utility function tightly tied to the options listed here. Initializes
-+// a TargetOptions object with CodeGen flags and returns it.
-+TargetOptions InitTargetOptionsFromCodeGenFlags();
-+
-+std::string getCPUStr();
-+
-+std::string getFeaturesStr();
-+
-+std::vector<std::string> getFeatureList();
-+
-+void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
-+
-+/// Set function attributes of function \p F based on CPU, Features, and command
-+/// line flags.
-+void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
-+
-+/// Set function attributes of functions in Module M based on CPU,
-+/// Features, and command line flags.
-+void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
-+} // namespace codegen
-+} // namespace llvm
-diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
-new file mode 100644
-index 000000000000..7a5edf78fdcc
---- /dev/null
-+++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
-@@ -0,0 +1,54 @@
-+//===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===//
-+//
-+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-+// See https://llvm.org/LICENSE.txt for license information.
-+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-+//
-+//===----------------------------------------------------------------------===//
-+//
-+// This file contains machine code-specific flags that are shared between
-+// different command line tools.
-+//
-+//===----------------------------------------------------------------------===//
-+
-+#ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
-+#define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
-+
-+#include "llvm/ADT/Optional.h"
-+#include "llvm/MC/MCTargetOptions.h"
-+#include "llvm/Support/CommandLine.h"
-+
-+namespace llvm {
-+
-+namespace mc {
-+
-+bool getRelaxAll();
-+Optional<bool> getExplicitRelaxAll();
-+
-+bool getIncrementalLinkerCompatible();
-+
-+int getDwarfVersion();
-+
-+bool getShowMCInst();
-+
-+bool getFatalWarnings();
-+
-+bool getNoWarn();
-+
-+bool getNoDeprecatedWarn();
-+
-+std::string getABIName();
-+
-+/// Create this object with static storage to register mc-related command
-+/// line options.
-+struct RegisterMCTargetOptionsFlags {
-+ RegisterMCTargetOptionsFlags();
-+};
-+
-+MCTargetOptions InitMCTargetOptionsFromFlags();
-+
-+} // namespace mc
-+
-+} // namespace llvm
-+
-+#endif
-diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.inc b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.inc
-deleted file mode 100644
-index 93e21b626eac..000000000000
---- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.inc
-+++ /dev/null
-@@ -1,65 +0,0 @@
--//===-- MCTargetOptionsCommandFlags.h --------------------------*- C++ -*-===//
--//
--// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
--// See https://llvm.org/LICENSE.txt for license information.
--// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--//
--//===----------------------------------------------------------------------===//
--//
--// This file contains machine code-specific flags that are shared between
--// different command line tools.
--//
--//===----------------------------------------------------------------------===//
--
--#ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
--#define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
--
--#include "llvm/MC/MCTargetOptions.h"
--#include "llvm/Support/CommandLine.h"
--using namespace llvm;
--
--static cl::opt<bool> RelaxAll("mc-relax-all",
-- cl::desc("When used with filetype=obj, "
-- "relax all fixups in the emitted object file"));
--
--static cl::opt<bool> IncrementalLinkerCompatible(
-- "incremental-linker-compatible",
-- cl::desc(
-- "When used with filetype=obj, "
-- "emit an object file which can be used with an incremental linker"));
--
--static cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
-- cl::init(0));
--
--static cl::opt<bool> ShowMCInst("asm-show-inst",
-- cl::desc("Emit internal instruction representation to "
-- "assembly file"));
--
--static cl::opt<bool> FatalWarnings("fatal-warnings",
-- cl::desc("Treat warnings as errors"));
--
--static cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
--static cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
--
--static cl::opt<bool> NoDeprecatedWarn("no-deprecated-warn",
-- cl::desc("Suppress all deprecated warnings"));
--
--static cl::opt<std::string>
--ABIName("target-abi", cl::Hidden,
-- cl::desc("The name of the ABI to be targeted from the backend."),
-- cl::init(""));
--
--static MCTargetOptions InitMCTargetOptionsFromFlags() {
-- MCTargetOptions Options;
-- Options.MCRelaxAll = RelaxAll;
-- Options.MCIncrementalLinkerCompatible = IncrementalLinkerCompatible;
-- Options.DwarfVersion = DwarfVersion;
-- Options.ShowMCInst = ShowMCInst;
-- Options.ABIName = ABIName;
-- Options.MCFatalWarnings = FatalWarnings;
-- Options.MCNoWarn = NoWarn;
-- Options.MCNoDeprecatedWarn = NoDeprecatedWarn;
-- return Options;
--}
--
--#endif
-diff --git a/llvm/include/llvm/module.modulemap b/llvm/include/llvm/module.modulemap
-index d281682ae003..d176b3dfd4be 100644
---- a/llvm/include/llvm/module.modulemap
-+++ b/llvm/include/llvm/module.modulemap
-@@ -29,7 +29,6 @@ module LLVM_Backend {
- exclude header "CodeGen/LinkAllCodegenComponents.h"
-
- // These are intended for (repeated) textual inclusion.
-- textual header "CodeGen/CommandFlags.inc"
- textual header "CodeGen/DIEValue.def"
- }
- }
-@@ -308,8 +307,6 @@ module LLVM_MC {
-
- umbrella "MC"
- module * { export * }
--
-- textual header "MC/MCTargetOptionsCommandFlags.inc"
- }
-
- // Used by llvm-tblgen
-diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
-index a3916b7c6242..c6be91247017 100644
---- a/llvm/lib/CodeGen/CMakeLists.txt
-+++ b/llvm/lib/CodeGen/CMakeLists.txt
-@@ -14,6 +14,7 @@ add_llvm_component_library(LLVMCodeGen
- CFIInstrInserter.cpp
- CodeGen.cpp
- CodeGenPrepare.cpp
-+ CommandFlags.cpp
- CriticalAntiDepBreaker.cpp
- DeadMachineInstructionElim.cpp
- DetectDeadLanes.cpp
-diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
-new file mode 100644
-index 000000000000..7acb84df582f
---- /dev/null
-+++ b/llvm/lib/CodeGen/CommandFlags.cpp
-@@ -0,0 +1,588 @@
-+//===-- CommandFlags.cpp - Command Line Flags Interface ---------*- C++ -*-===//
-+//
-+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-+// See https://llvm.org/LICENSE.txt for license information.
-+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-+//
-+//===----------------------------------------------------------------------===//
-+//
-+// This file contains codegen-specific flags that are shared between different
-+// command line tools. The tools "llc" and "opt" both use this file to prevent
-+// flag duplication.
-+//
-+//===----------------------------------------------------------------------===//
-+
-+#include "llvm/CodeGen/CommandFlags.h"
-+
-+using namespace llvm;
-+
-+#define CGOPT(TY, NAME) \
-+ static cl::opt<TY> *NAME##View; \
-+ TY codegen::get##NAME() { \
-+ assert(NAME##View && "RegisterCodeGenFlags not created."); \
-+ return *NAME##View; \
-+ }
-+
-+#define CGLIST(TY, NAME) \
-+ static cl::list<TY> *NAME##View; \
-+ std::vector<TY> codegen::get##NAME() { \
-+ assert(NAME##View && "RegisterCodeGenFlags not created."); \
-+ return *NAME##View; \
-+ }
-+
-+#define CGOPT_EXP(TY, NAME) \
-+ CGOPT(TY, NAME) \
-+ Optional<TY> codegen::getExplicit##NAME() { \
-+ if (NAME##View->getNumOccurrences()) { \
-+ TY res = *NAME##View; \
-+ return res; \
-+ } \
-+ return None; \
-+ }
-+
-+CGOPT(std::string, MArch)
-+CGOPT(std::string, MCPU)
-+CGLIST(std::string, MAttrs)
-+CGOPT_EXP(Reloc::Model, RelocModel)
-+CGOPT(ThreadModel::Model, ThreadModel)
-+CGOPT_EXP(CodeModel::Model, CodeModel)
-+CGOPT(ExceptionHandling, ExceptionModel)
-+CGOPT_EXP(CodeGenFileType, FileType)
-+CGOPT(FramePointer::FP, FramePointerUsage)
-+CGOPT(bool, EnableUnsafeFPMath)
-+CGOPT(bool, EnableNoInfsFPMath)
-+CGOPT(bool, EnableNoNaNsFPMath)
-+CGOPT(bool, EnableNoSignedZerosFPMath)
-+CGOPT(bool, EnableNoTrappingFPMath)
-+CGOPT(FPDenormal::DenormalMode, DenormalFPMath)
-+CGOPT(bool, EnableHonorSignDependentRoundingFPMath)
-+CGOPT(FloatABI::ABIType, FloatABIForCalls)
-+CGOPT(FPOpFusion::FPOpFusionMode, FuseFPOps)
-+CGOPT(bool, DontPlaceZerosInBSS)
-+CGOPT(bool, EnableGuaranteedTailCallOpt)
-+CGOPT(bool, DisableTailCalls)
-+CGOPT(bool, StackSymbolOrdering)
-+CGOPT(unsigned, OverrideStackAlignment)
-+CGOPT(bool, StackRealign)
-+CGOPT(std::string, TrapFuncName)
-+CGOPT(bool, UseCtors)
-+CGOPT(bool, RelaxELFRelocations)
-+CGOPT_EXP(bool, DataSections)
-+CGOPT_EXP(bool, FunctionSections)
-+CGOPT(std::string, BBSections)
-+CGOPT(unsigned, TLSSize)
-+CGOPT(bool, EmulatedTLS)
-+CGOPT(bool, UniqueSectionNames)
-+CGOPT(bool, UniqueBBSectionNames)
-+CGOPT(EABI, EABIVersion)
-+CGOPT(DebuggerKind, DebuggerTuningOpt)
-+CGOPT(bool, EnableStackSizeSection)
-+CGOPT(bool, EnableAddrsig)
-+CGOPT(bool, EmitCallSiteInfo)
-+CGOPT(bool, EnableDebugEntryValues)
-+CGOPT(bool, ForceDwarfFrameSection)
-+
-+codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
-+#define CGBINDOPT(NAME) \
-+ do { \
-+ NAME##View = std::addressof(NAME); \
-+ } while (0)
-+
-+ static cl::opt<std::string> MArch(
-+ "march", cl::desc("Architecture to generate code for (see --version)"));
-+ CGBINDOPT(MArch);
-+
-+ static cl::opt<std::string> MCPU(
-+ "mcpu", cl::desc("Target a specific cpu type (-mcpu=help for details)"),
-+ cl::value_desc("cpu-name"), cl::init(""));
-+ CGBINDOPT(MCPU);
-+
-+ static cl::list<std::string> MAttrs(
-+ "mattr", cl::CommaSeparated,
-+ cl::desc("Target specific attributes (-mattr=help for details)"),
-+ cl::value_desc("a1,+a2,-a3,..."));
-+ CGBINDOPT(MAttrs);
-+
-+ static cl::opt<Reloc::Model> RelocModel(
-+ "relocation-model", cl::desc("Choose relocation model"),
-+ cl::values(
-+ clEnumValN(Reloc::Static, "static", "Non-relocatable code"),
-+ clEnumValN(Reloc::PIC_, "pic",
-+ "Fully relocatable, position independent code"),
-+ clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
-+ "Relocatable external references, non-relocatable code"),
-+ clEnumValN(
-+ Reloc::ROPI, "ropi",
-+ "Code and read-only data relocatable, accessed PC-relative"),
-+ clEnumValN(
-+ Reloc::RWPI, "rwpi",
-+ "Read-write data relocatable, accessed relative to static base"),
-+ clEnumValN(Reloc::ROPI_RWPI, "ropi-rwpi",
-+ "Combination of ropi and rwpi")));
-+ CGBINDOPT(RelocModel);
-+
-+ static cl::opt<ThreadModel::Model> ThreadModel(
-+ "thread-model", cl::desc("Choose threading model"),
-+ cl::init(ThreadModel::POSIX),
-+ cl::values(
-+ clEnumValN(ThreadModel::POSIX, "posix", "POSIX thread model"),
-+ clEnumValN(ThreadModel::Single, "single", "Single thread model")));
-+ CGBINDOPT(ThreadModel);
-+
-+ static cl::opt<CodeModel::Model> CodeModel(
-+ "code-model", cl::desc("Choose code model"),
-+ cl::values(clEnumValN(CodeModel::Tiny, "tiny", "Tiny code model"),
-+ clEnumValN(CodeModel::Small, "small", "Small code model"),
-+ clEnumValN(CodeModel::Kernel, "kernel", "Kernel code model"),
-+ clEnumValN(CodeModel::Medium, "medium", "Medium code model"),
-+ clEnumValN(CodeModel::Large, "large", "Large code model")));
-+ CGBINDOPT(CodeModel);
-+
-+ static cl::opt<ExceptionHandling> ExceptionModel(
-+ "exception-model", cl::desc("exception model"),
-+ cl::init(ExceptionHandling::None),
-+ cl::values(
-+ clEnumValN(ExceptionHandling::None, "default",
-+ "default exception handling model"),
-+ clEnumValN(ExceptionHandling::DwarfCFI, "dwarf",
-+ "DWARF-like CFI based exception handling"),
-+ clEnumValN(ExceptionHandling::SjLj, "sjlj",
-+ "SjLj exception handling"),
-+ clEnumValN(ExceptionHandling::ARM, "arm", "ARM EHABI exceptions"),
-+ clEnumValN(ExceptionHandling::WinEH, "wineh",
-+ "Windows exception model"),
-+ clEnumValN(ExceptionHandling::Wasm, "wasm",
-+ "WebAssembly exception handling")));
-+ CGBINDOPT(ExceptionModel);
-+
-+ static cl::opt<CodeGenFileType> FileType(
-+ "filetype", cl::init(CGFT_AssemblyFile),
-+ cl::desc(
-+ "Choose a file type (not all types are supported by all targets):"),
-+ cl::values(
-+ clEnumValN(CGFT_AssemblyFile, "asm", "Emit an assembly ('.s') file"),
-+ clEnumValN(CGFT_ObjectFile, "obj",
-+ "Emit a native object ('.o') file"),
-+ clEnumValN(CGFT_Null, "null",
-+ "Emit nothing, for performance testing")));
-+ CGBINDOPT(FileType);
-+
-+ static cl::opt<FramePointer::FP> FramePointerUsage(
-+ "frame-pointer",
-+ cl::desc("Specify frame pointer elimination optimization"),
-+ cl::init(FramePointer::None),
-+ cl::values(
-+ clEnumValN(FramePointer::All, "all",
-+ "Disable frame pointer elimination"),
-+ clEnumValN(FramePointer::NonLeaf, "non-leaf",
-+ "Disable frame pointer elimination for non-leaf frame"),
-+ clEnumValN(FramePointer::None, "none",
-+ "Enable frame pointer elimination")));
-+ CGBINDOPT(FramePointerUsage);
-+
-+ static cl::opt<bool> EnableUnsafeFPMath(
-+ "enable-unsafe-fp-math",
-+ cl::desc("Enable optimizations that may decrease FP precision"),
-+ cl::init(false));
-+ CGBINDOPT(EnableUnsafeFPMath);
-+
-+ static cl::opt<bool> EnableNoInfsFPMath(
-+ "enable-no-infs-fp-math",
-+ cl::desc("Enable FP math optimizations that assume no +-Infs"),
-+ cl::init(false));
-+ CGBINDOPT(EnableNoInfsFPMath);
-+
-+ static cl::opt<bool> EnableNoNaNsFPMath(
-+ "enable-no-nans-fp-math",
-+ cl::desc("Enable FP math optimizations that assume no NaNs"),
-+ cl::init(false));
-+ CGBINDOPT(EnableNoNaNsFPMath);
-+
-+ static cl::opt<bool> EnableNoSignedZerosFPMath(
-+ "enable-no-signed-zeros-fp-math",
-+ cl::desc("Enable FP math optimizations that assume "
-+ "the sign of 0 is insignificant"),
-+ cl::init(false));
-+ CGBINDOPT(EnableNoSignedZerosFPMath);
-+
-+ static cl::opt<bool> EnableNoTrappingFPMath(
-+ "enable-no-trapping-fp-math",
-+ cl::desc("Enable setting the FP exceptions build "
-+ "attribute not to use exceptions"),
-+ cl::init(false));
-+ CGBINDOPT(EnableNoTrappingFPMath);
-+
-+ static cl::opt<FPDenormal::DenormalMode> DenormalFPMath(
-+ "denormal-fp-math",
-+ cl::desc(
-+ "Select which denormal numbers the code is permitted to require"),
-+ cl::init(FPDenormal::IEEE),
-+ cl::values(
-+ clEnumValN(FPDenormal::IEEE, "ieee", "IEEE 754 denormal numbers"),
-+ clEnumValN(FPDenormal::PreserveSign, "preserve-sign",
-+ "the sign of a flushed-to-zero number is preserved "
-+ "in the sign of 0"),
-+ clEnumValN(FPDenormal::PositiveZero, "positive-zero",
-+ "denormals are flushed to positive zero")));
-+ CGBINDOPT(DenormalFPMath);
-+
-+ static cl::opt<bool> EnableHonorSignDependentRoundingFPMath(
-+ "enable-sign-dependent-rounding-fp-math", cl::Hidden,
-+ cl::desc("Force codegen to assume rounding mode can change dynamically"),
-+ cl::init(false));
-+ CGBINDOPT(EnableHonorSignDependentRoundingFPMath);
-+
-+ static cl::opt<FloatABI::ABIType> FloatABIForCalls(
-+ "float-abi", cl::desc("Choose float ABI type"),
-+ cl::init(FloatABI::Default),
-+ cl::values(clEnumValN(FloatABI::Default, "default",
-+ "Target default float ABI type"),
-+ clEnumValN(FloatABI::Soft, "soft",
-+ "Soft float ABI (implied by -soft-float)"),
-+ clEnumValN(FloatABI::Hard, "hard",
-+ "Hard float ABI (uses FP registers)")));
-+ CGBINDOPT(FloatABIForCalls);
-+
-+ static cl::opt<FPOpFusion::FPOpFusionMode> FuseFPOps(
-+ "fp-contract", cl::desc("Enable aggressive formation of fused FP ops"),
-+ cl::init(FPOpFusion::Standard),
-+ cl::values(
-+ clEnumValN(FPOpFusion::Fast, "fast",
-+ "Fuse FP ops whenever profitable"),
-+ clEnumValN(FPOpFusion::Standard, "on", "Only fuse 'blessed' FP ops."),
-+ clEnumValN(FPOpFusion::Strict, "off",
-+ "Only fuse FP ops when the result won't be affected.")));
-+ CGBINDOPT(FuseFPOps);
-+
-+ static cl::opt<bool> DontPlaceZerosInBSS(
-+ "nozero-initialized-in-bss",
-+ cl::desc("Don't place zero-initialized symbols into bss section"),
-+ cl::init(false));
-+ CGBINDOPT(DontPlaceZerosInBSS);
-+
-+ static cl::opt<bool> EnableGuaranteedTailCallOpt(
-+ "tailcallopt",
-+ cl::desc(
-+ "Turn fastcc calls into tail calls by (potentially) changing ABI."),
-+ cl::init(false));
-+ CGBINDOPT(EnableGuaranteedTailCallOpt);
-+
-+ static cl::opt<bool> DisableTailCalls(
-+ "disable-tail-calls", cl::desc("Never emit tail calls"), cl::init(false));
-+ CGBINDOPT(DisableTailCalls);
-+
-+ static cl::opt<bool> StackSymbolOrdering(
-+ "stack-symbol-ordering", cl::desc("Order local stack symbols."),
-+ cl::init(true));
-+ CGBINDOPT(StackSymbolOrdering);
-+
-+ static cl::opt<unsigned> OverrideStackAlignment(
-+ "stack-alignment", cl::desc("Override default stack alignment"),
-+ cl::init(0));
-+ CGBINDOPT(OverrideStackAlignment);
-+
-+ static cl::opt<bool> StackRealign(
-+ "stackrealign",
-+ cl::desc("Force align the stack to the minimum alignment"),
-+ cl::init(false));
-+ CGBINDOPT(StackRealign);
-+
-+ static cl::opt<std::string> TrapFuncName(
-+ "trap-func", cl::Hidden,
-+ cl::desc("Emit a call to trap function rather than a trap instruction"),
-+ cl::init(""));
-+ CGBINDOPT(TrapFuncName);
-+
-+ static cl::opt<bool> UseCtors("use-ctors",
-+ cl::desc("Use .ctors instead of .init_array."),
-+ cl::init(false));
-+ CGBINDOPT(UseCtors);
-+
-+ static cl::opt<bool> RelaxELFRelocations(
-+ "relax-elf-relocations",
-+ cl::desc(
-+ "Emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL on x86-64 ELF"),
-+ cl::init(false));
-+ CGBINDOPT(RelaxELFRelocations);
-+
-+ static cl::opt<bool> DataSections(
-+ "data-sections", cl::desc("Emit data into separate sections"),
-+ cl::init(false));
-+ CGBINDOPT(DataSections);
-+
-+ static cl::opt<bool> FunctionSections(
-+ "function-sections", cl::desc("Emit functions into separate sections"),
-+ cl::init(false));
-+ CGBINDOPT(FunctionSections);
-+
-+ static cl::opt<std::string> BBSections(
-+ "basicblock-sections",
-+ cl::desc("Emit basic blocks into separate sections"),
-+ cl::value_desc("all | <function list (file)> | labels | none"),
-+ cl::init("none"));
-+ CGBINDOPT(BBSections);
-+
-+ static cl::opt<unsigned> TLSSize(
-+ "tls-size", cl::desc("Bit size of immediate TLS offsets"), cl::init(0));
-+ CGBINDOPT(TLSSize);
-+
-+ static cl::opt<bool> EmulatedTLS(
-+ "emulated-tls", cl::desc("Use emulated TLS model"), cl::init(false));
-+ CGBINDOPT(EmulatedTLS);
-+
-+ static cl::opt<bool> UniqueSectionNames(
-+ "unique-section-names", cl::desc("Give unique names to every section"),
-+ cl::init(true));
-+ CGBINDOPT(UniqueSectionNames);
-+
-+ static cl::opt<bool> UniqueBBSectionNames(
-+ "unique-bb-section-names",
-+ cl::desc("Give unique names to every basic block section"),
-+ cl::init(false));
-+ CGBINDOPT(UniqueBBSectionNames);
-+
-+ static cl::opt<EABI> EABIVersion(
-+ "meabi", cl::desc("Set EABI type (default depends on triple):"),
-+ cl::init(EABI::Default),
-+ cl::values(
-+ clEnumValN(EABI::Default, "default", "Triple default EABI version"),
-+ clEnumValN(EABI::EABI4, "4", "EABI version 4"),
-+ clEnumValN(EABI::EABI5, "5", "EABI version 5"),
-+ clEnumValN(EABI::GNU, "gnu", "EABI GNU")));
-+ CGBINDOPT(EABIVersion);
-+
-+ static cl::opt<DebuggerKind> DebuggerTuningOpt(
-+ "debugger-tune", cl::desc("Tune debug info for a particular debugger"),
-+ cl::init(DebuggerKind::Default),
-+ cl::values(
-+ clEnumValN(DebuggerKind::GDB, "gdb", "gdb"),
-+ clEnumValN(DebuggerKind::LLDB, "lldb", "lldb"),
-+ clEnumValN(DebuggerKind::SCE, "sce", "SCE targets (e.g. PS4)")));
-+ CGBINDOPT(DebuggerTuningOpt);
-+
-+ static cl::opt<bool> EnableStackSizeSection(
-+ "stack-size-section",
-+ cl::desc("Emit a section containing stack size metadata"),
-+ cl::init(false));
-+ CGBINDOPT(EnableStackSizeSection);
-+
-+ static cl::opt<bool> EnableAddrsig(
-+ "addrsig", cl::desc("Emit an address-significance table"),
-+ cl::init(false));
-+ CGBINDOPT(EnableAddrsig);
-+
-+ static cl::opt<bool> EmitCallSiteInfo(
-+ "emit-call-site-info",
-+ cl::desc(
-+ "Emit call site debug information, if debug information is enabled."),
-+ cl::init(false));
-+ CGBINDOPT(EmitCallSiteInfo);
-+
-+ static cl::opt<bool> EnableDebugEntryValues(
-+ "debug-entry-values",
-+ cl::desc("Emit debug info about parameter's entry values"),
-+ cl::init(false));
-+ CGBINDOPT(EnableDebugEntryValues);
-+
-+ static cl::opt<bool> ForceDwarfFrameSection(
-+ "force-dwarf-frame-section",
-+ cl::desc("Always emit a debug frame section."), cl::init(false));
-+ CGBINDOPT(ForceDwarfFrameSection);
-+
-+#undef CGBINDOPT
-+
-+ mc::RegisterMCTargetOptionsFlags();
-+}
-+
-+llvm::BasicBlockSection
-+codegen::getBBSectionsMode(llvm::TargetOptions &Options) {
-+ if (getBBSections() == "all")
-+ return BasicBlockSection::All;
-+ else if (getBBSections() == "labels")
-+ return BasicBlockSection::Labels;
-+ else if (getBBSections() == "none")
-+ return BasicBlockSection::None;
-+ else {
-+ ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
-+ MemoryBuffer::getFile(getBBSections());
-+ if (!MBOrErr) {
-+ errs() << "Error loading basic block sections function list file: "
-+ << MBOrErr.getError().message() << "\n";
-+ } else {
-+ Options.BBSectionsFuncListBuf = std::move(*MBOrErr);
-+ }
-+ return BasicBlockSection::List;
-+ }
-+}
-+
-+// Common utility function tightly tied to the options listed here. Initializes
-+// a TargetOptions object with CodeGen flags and returns it.
-+TargetOptions codegen::InitTargetOptionsFromCodeGenFlags() {
-+ TargetOptions Options;
-+ Options.AllowFPOpFusion = getFuseFPOps();
-+ Options.UnsafeFPMath = getEnableUnsafeFPMath();
-+ Options.NoInfsFPMath = getEnableNoInfsFPMath();
-+ Options.NoNaNsFPMath = getEnableNoNaNsFPMath();
-+ Options.NoSignedZerosFPMath = getEnableNoSignedZerosFPMath();
-+ Options.NoTrappingFPMath = getEnableNoTrappingFPMath();
-+ Options.FPDenormalMode = getDenormalFPMath();
-+ Options.HonorSignDependentRoundingFPMathOption =
-+ getEnableHonorSignDependentRoundingFPMath();
-+ if (getFloatABIForCalls() != FloatABI::Default)
-+ Options.FloatABIType = getFloatABIForCalls();
-+ Options.NoZerosInBSS = getDontPlaceZerosInBSS();
-+ Options.GuaranteedTailCallOpt = getEnableGuaranteedTailCallOpt();
-+ Options.StackAlignmentOverride = getOverrideStackAlignment();
-+ Options.StackSymbolOrdering = getStackSymbolOrdering();
-+ Options.UseInitArray = !getUseCtors();
-+ Options.RelaxELFRelocations = getRelaxELFRelocations();
-+ Options.DataSections = getDataSections();
-+ Options.FunctionSections = getFunctionSections();
-+ Options.BBSections = getBBSectionsMode(Options);
-+ Options.UniqueSectionNames = getUniqueSectionNames();
-+ Options.UniqueBBSectionNames = getUniqueBBSectionNames();
-+ Options.TLSSize = getTLSSize();
-+ Options.EmulatedTLS = getEmulatedTLS();
-+ Options.ExplicitEmulatedTLS = EmulatedTLSView->getNumOccurrences() > 0;
-+ Options.ExceptionModel = getExceptionModel();
-+ Options.EmitStackSizeSection = getEnableStackSizeSection();
-+ Options.EmitAddrsig = getEnableAddrsig();
-+ Options.EmitCallSiteInfo = getEmitCallSiteInfo();
-+ Options.EnableDebugEntryValues = getEnableDebugEntryValues();
-+ Options.ForceDwarfFrameSection = getForceDwarfFrameSection();
-+
-+ Options.MCOptions = mc::InitMCTargetOptionsFromFlags();
-+
-+ Options.ThreadModel = getThreadModel();
-+ Options.EABIVersion = getEABIVersion();
-+ Options.DebuggerTuning = getDebuggerTuningOpt();
-+
-+ return Options;
-+}
-+
-+std::string codegen::getCPUStr() {
-+ // If user asked for the 'native' CPU, autodetect here. If autodection fails,
-+ // this will set the CPU to an empty string which tells the target to
-+ // pick a basic default.
-+ if (getMCPU() == "native")
-+ return std::string(sys::getHostCPUName());
-+
-+ return getMCPU();
-+}
-+
-+std::string codegen::getFeaturesStr() {
-+ SubtargetFeatures Features;
-+
-+ // If user asked for the 'native' CPU, we need to autodetect features.
-+ // This is necessary for x86 where the CPU might not support all the
-+ // features the autodetected CPU name lists in the target. For example,
-+ // not all Sandybridge processors support AVX.
-+ if (getMCPU() == "native") {
-+ StringMap<bool> HostFeatures;
-+ if (sys::getHostCPUFeatures(HostFeatures))
-+ for (auto &F : HostFeatures)
-+ Features.AddFeature(F.first(), F.second);
-+ }
-+
-+ for (auto const &MAttr : getMAttrs())
-+ Features.AddFeature(MAttr);
-+
-+ return Features.getString();
-+}
-+
-+std::vector<std::string> codegen::getFeatureList() {
-+ SubtargetFeatures Features;
-+
-+ // If user asked for the 'native' CPU, we need to autodetect features.
-+ // This is necessary for x86 where the CPU might not support all the
-+ // features the autodetected CPU name lists in the target. For example,
-+ // not all Sandybridge processors support AVX.
-+ if (getMCPU() == "native") {
-+ StringMap<bool> HostFeatures;
-+ if (sys::getHostCPUFeatures(HostFeatures))
-+ for (auto &F : HostFeatures)
-+ Features.AddFeature(F.first(), F.second);
-+ }
-+
-+ for (auto const &MAttr : getMAttrs())
-+ Features.AddFeature(MAttr);
-+
-+ return Features.getFeatures();
-+}
-+
-+void codegen::renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val) {
-+ B.addAttribute(Name, Val ? "true" : "false");
-+}
-+
-+#define HANDLE_BOOL_ATTR(CL, AttrName) \
-+ do { \
-+ if (CL->getNumOccurrences() > 0 && !F.hasFnAttribute(AttrName)) \
-+ renderBoolStringAttr(NewAttrs, AttrName, *CL); \
-+ } while (0)
-+
-+/// Set function attributes of function \p F based on CPU, Features, and command
-+/// line flags.
-+void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
-+ Function &F) {
-+ auto &Ctx = F.getContext();
-+ AttributeList Attrs = F.getAttributes();
-+ AttrBuilder NewAttrs;
-+
-+ if (!CPU.empty() && !F.hasFnAttribute("target-cpu"))
-+ NewAttrs.addAttribute("target-cpu", CPU);
-+ if (!Features.empty()) {
-+ // Append the command line features to any that are already on the function.
-+ StringRef OldFeatures =
-+ F.getFnAttribute("target-features").getValueAsString();
-+ if (OldFeatures.empty())
-+ NewAttrs.addAttribute("target-features", Features);
-+ else {
-+ SmallString<256> Appended(OldFeatures);
-+ Appended.push_back(',');
-+ Appended.append(Features);
-+ NewAttrs.addAttribute("target-features", Appended);
-+ }
-+ }
-+ if (FramePointerUsageView->getNumOccurrences() > 0 &&
-+ !F.hasFnAttribute("frame-pointer")) {
-+ if (getFramePointerUsage() == FramePointer::All)
-+ NewAttrs.addAttribute("frame-pointer", "all");
-+ else if (getFramePointerUsage() == FramePointer::NonLeaf)
-+ NewAttrs.addAttribute("frame-pointer", "non-leaf");
-+ else if (getFramePointerUsage() == FramePointer::None)
-+ NewAttrs.addAttribute("frame-pointer", "none");
-+ }
-+ if (DisableTailCallsView->getNumOccurrences() > 0)
-+ NewAttrs.addAttribute("disable-tail-calls",
-+ toStringRef(getDisableTailCalls()));
-+ if (getStackRealign())
-+ NewAttrs.addAttribute("stackrealign");
-+
-+ HANDLE_BOOL_ATTR(EnableUnsafeFPMathView, "unsafe-fp-math");
-+ HANDLE_BOOL_ATTR(EnableNoInfsFPMathView, "no-infs-fp-math");
-+ HANDLE_BOOL_ATTR(EnableNoNaNsFPMathView, "no-nans-fp-math");
-+ HANDLE_BOOL_ATTR(EnableNoSignedZerosFPMathView, "no-signed-zeros-fp-math");
-+
-+ if (TrapFuncNameView->getNumOccurrences() > 0)
-+ for (auto &B : F)
-+ for (auto &I : B)
-+ if (auto *Call = dyn_cast<CallInst>(&I))
-+ if (const auto *F = Call->getCalledFunction())
-+ if (F->getIntrinsicID() == Intrinsic::debugtrap ||
-+ F->getIntrinsicID() == Intrinsic::trap)
-+ Call->addAttribute(
-+ AttributeList::FunctionIndex,
-+ Attribute::get(Ctx, "trap-func-name", getTrapFuncName()));
-+
-+ // Let NewAttrs override Attrs.
-+ F.setAttributes(
-+ Attrs.addAttributes(Ctx, AttributeList::FunctionIndex, NewAttrs));
-+}
-+
-+/// Set function attributes of functions in Module M based on CPU,
-+/// Features, and command line flags.
-+void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
-+ Module &M) {
-+ for (Function &F : M)
-+ setFunctionAttributes(CPU, Features, F);
-+}
-diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt
-index de2e47d8d9b2..ab809daf5273 100644
---- a/llvm/lib/MC/CMakeLists.txt
-+++ b/llvm/lib/MC/CMakeLists.txt
-@@ -44,6 +44,7 @@ add_llvm_component_library(LLVMMC
- MCSymbol.cpp
- MCSymbolELF.cpp
- MCTargetOptions.cpp
-+ MCTargetOptionsCommandFlags.cpp
- MCValue.cpp
- MCWasmObjectTargetWriter.cpp
- MCWasmStreamer.cpp
-diff --git a/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp b/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp
-new file mode 100644
-index 000000000000..3ca34061241a
---- /dev/null
-+++ b/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp
-@@ -0,0 +1,105 @@
-+//===-- MCTargetOptionsCommandFlags.cpp --------------------------*- C++
-+//-*-===//
-+//
-+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-+// See https://llvm.org/LICENSE.txt for license information.
-+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-+//
-+//===----------------------------------------------------------------------===//
-+//
-+// This file contains machine code-specific flags that are shared between
-+// different command line tools.
-+//
-+//===----------------------------------------------------------------------===//
-+
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
-+
-+using namespace llvm;
-+
-+#define MCOPT(TY, NAME) \
-+ static cl::opt<TY> *NAME##View; \
-+ TY llvm::mc::get##NAME() { \
-+ assert(NAME##View && "RegisterMCTargetOptionsFlags not created."); \
-+ return *NAME##View; \
-+ }
-+
-+#define MCOPT_EXP(TY, NAME) \
-+ MCOPT(TY, NAME) \
-+ Optional<TY> llvm::mc::getExplicit##NAME() { \
-+ if (NAME##View->getNumOccurrences()) { \
-+ TY res = *NAME##View; \
-+ return res; \
-+ } \
-+ return None; \
-+ }
-+
-+MCOPT_EXP(bool, RelaxAll)
-+MCOPT(bool, IncrementalLinkerCompatible)
-+MCOPT(int, DwarfVersion)
-+MCOPT(bool, ShowMCInst)
-+MCOPT(bool, FatalWarnings)
-+MCOPT(bool, NoWarn)
-+MCOPT(bool, NoDeprecatedWarn)
-+MCOPT(std::string, ABIName)
-+
-+llvm::mc::RegisterMCTargetOptionsFlags::RegisterMCTargetOptionsFlags() {
-+#define MCBINDOPT(NAME) \
-+ do { \
-+ NAME##View = std::addressof(NAME); \
-+ } while (0)
-+
-+ static cl::opt<bool> RelaxAll(
-+ "mc-relax-all", cl::desc("When used with filetype=obj, relax all fixups "
-+ "in the emitted object file"));
-+ MCBINDOPT(RelaxAll);
-+
-+ static cl::opt<bool> IncrementalLinkerCompatible(
-+ "incremental-linker-compatible",
-+ cl::desc(
-+ "When used with filetype=obj, "
-+ "emit an object file which can be used with an incremental linker"));
-+ MCBINDOPT(IncrementalLinkerCompatible);
-+
-+ static cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
-+ cl::init(0));
-+ MCBINDOPT(DwarfVersion);
-+
-+ static cl::opt<bool> ShowMCInst(
-+ "asm-show-inst",
-+ cl::desc("Emit internal instruction representation to assembly file"));
-+ MCBINDOPT(ShowMCInst);
-+
-+ static cl::opt<bool> FatalWarnings("fatal-warnings",
-+ cl::desc("Treat warnings as errors"));
-+ MCBINDOPT(FatalWarnings);
-+
-+ static cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
-+ static cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"),
-+ cl::aliasopt(NoWarn));
-+ MCBINDOPT(NoWarn);
-+
-+ static cl::opt<bool> NoDeprecatedWarn(
-+ "no-deprecated-warn", cl::desc("Suppress all deprecated warnings"));
-+ MCBINDOPT(NoDeprecatedWarn);
-+
-+ static cl::opt<std::string> ABIName(
-+ "target-abi", cl::Hidden,
-+ cl::desc("The name of the ABI to be targeted from the backend."),
-+ cl::init(""));
-+ MCBINDOPT(ABIName);
-+
-+#undef MCBINDOPT
-+}
-+
-+MCTargetOptions llvm::mc::InitMCTargetOptionsFromFlags() {
-+ MCTargetOptions Options;
-+ Options.MCRelaxAll = getRelaxAll();
-+ Options.MCIncrementalLinkerCompatible = getIncrementalLinkerCompatible();
-+ Options.DwarfVersion = getDwarfVersion();
-+ Options.ShowMCInst = getShowMCInst();
-+ Options.ABIName = getABIName();
-+ Options.MCFatalWarnings = getFatalWarnings();
-+ Options.MCNoWarn = getNoWarn();
-+ Options.MCNoDeprecatedWarn = getNoDeprecatedWarn();
-+ return Options;
-+}
-diff --git a/llvm/tools/dsymutil/DwarfStreamer.cpp b/llvm/tools/dsymutil/DwarfStreamer.cpp
-index 3e132c29eada..eb068effbc71 100644
---- a/llvm/tools/dsymutil/DwarfStreamer.cpp
-+++ b/llvm/tools/dsymutil/DwarfStreamer.cpp
-@@ -13,13 +13,16 @@
- #include "llvm/DWARFLinker/DWARFLinkerCompileUnit.h"
- #include "llvm/DebugInfo/DWARF/DWARFContext.h"
- #include "llvm/MC/MCTargetOptions.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
- #include "llvm/Support/LEB128.h"
- #include "llvm/Support/TargetRegistry.h"
- #include "llvm/Target/TargetMachine.h"
- #include "llvm/Target/TargetOptions.h"
-
- namespace llvm {
-+
-+static mc::RegisterMCTargetOptionsFlags MOF;
-+
- namespace dsymutil {
-
- /// Retrieve the section named \a SecName in \a Obj.
-@@ -61,7 +64,7 @@ bool DwarfStreamer::init(Triple TheTriple) {
- if (!MRI)
- return error(Twine("no register info for target ") + TripleName, Context);
-
-- MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ MCTargetOptions MCOptions = mc::InitMCTargetOptionsFromFlags();
- MAI.reset(TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
- if (!MAI)
- return error("no asm info for target " + TripleName, Context);
-diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
-index 406079dad307..95e72b861197 100644
---- a/llvm/tools/gold/gold-plugin.cpp
-+++ b/llvm/tools/gold/gold-plugin.cpp
-@@ -14,7 +14,7 @@
- #include "llvm/ADT/Statistic.h"
- #include "llvm/Bitcode/BitcodeReader.h"
- #include "llvm/Bitcode/BitcodeWriter.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/Config/config.h" // plugin-api.h requires HAVE_STDINT_H
- #include "llvm/IR/Constants.h"
- #include "llvm/IR/DiagnosticPrinter.h"
-@@ -50,6 +50,8 @@
- using namespace llvm;
- using namespace lto;
-
-+static codegen::RegisterCodeGenFlags CodeGenFlags;
-+
- // FIXME: Remove when binutils 2.31 (containing gold 1.16) is the minimum
- // required version.
- typedef enum ld_plugin_status (*ld_plugin_get_wrap_symbols)(
-@@ -842,21 +844,21 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite,
- ThinBackend Backend;
-
- Conf.CPU = options::mcpu;
-- Conf.Options = InitTargetOptionsFromCodeGenFlags();
-+ Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags();
-
- // Disable the new X86 relax relocations since gold might not support them.
- // FIXME: Check the gold version or add a new option to enable them.
- Conf.Options.RelaxELFRelocations = false;
-
- // Toggle function/data sections.
-- if (FunctionSections.getNumOccurrences() == 0)
-+ if (!codegen::getExplicitFunctionSections())
- Conf.Options.FunctionSections = SplitSections;
-- if (DataSections.getNumOccurrences() == 0)
-+ if (!codegen::getExplicitDataSections())
- Conf.Options.DataSections = SplitSections;
-
-- Conf.MAttrs = MAttrs;
-- Conf.RelocModel = RelocationModel;
-- Conf.CodeModel = getCodeModel();
-+ Conf.MAttrs = codegen::getMAttrs();
-+ Conf.RelocModel = codegen::getExplicitRelocModel();
-+ Conf.CodeModel = codegen::getExplicitCodeModel();
- Conf.CGOptLevel = getCGOptLevel();
- Conf.DisableVerify = options::DisableVerify;
- Conf.OptLevel = options::OptLevel;
-diff --git a/llvm/tools/llc/CMakeLists.txt b/llvm/tools/llc/CMakeLists.txt
-index 880deefa539c..479bc6b55b27 100644
---- a/llvm/tools/llc/CMakeLists.txt
-+++ b/llvm/tools/llc/CMakeLists.txt
-@@ -26,4 +26,5 @@ add_llvm_tool(llc
- intrinsics_gen
- SUPPORT_PLUGINS
- )
-+
- export_executable_symbols(llc)
-diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
-index b35f8e853c30..4c41ed292fdc 100644
---- a/llvm/tools/llc/llc.cpp
-+++ b/llvm/tools/llc/llc.cpp
-@@ -15,7 +15,7 @@
- #include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/Triple.h"
- #include "llvm/Analysis/TargetLibraryInfo.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
- #include "llvm/CodeGen/LinkAllCodegenComponents.h"
- #include "llvm/CodeGen/MIRParser/MIRParser.h"
-@@ -55,6 +55,8 @@
- #include <memory>
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- // General options for llc. Other pass-specific options are specified
- // within the corresponding llc passes, and target-specific options
- // and back-end code generation options are specified with the target machine.
-@@ -202,7 +204,7 @@ static std::unique_ptr<ToolOutputFile> GetOutputStream(const char *TargetName,
- else
- OutputFilename = IFN;
-
-- switch (FileType) {
-+ switch (codegen::getFileType()) {
- case CGFT_AssemblyFile:
- if (TargetName[0] == 'c') {
- if (TargetName[1] == 0)
-@@ -229,7 +231,7 @@ static std::unique_ptr<ToolOutputFile> GetOutputStream(const char *TargetName,
-
- // Decide if we need "binary" output.
- bool Binary = false;
-- switch (FileType) {
-+ switch (codegen::getFileType()) {
- case CGFT_AssemblyFile:
- break;
- case CGFT_ObjectFile:
-@@ -395,14 +397,16 @@ static int compileModule(char **argv, LLVMContext &Context) {
- std::unique_ptr<Module> M;
- std::unique_ptr<MIRParser> MIR;
- Triple TheTriple;
-- std::string CPUStr = getCPUStr(), FeaturesStr = getFeaturesStr();
-+ std::string CPUStr = codegen::getCPUStr(),
-+ FeaturesStr = codegen::getFeaturesStr();
-
- // Set attributes on functions as loaded from MIR from command line arguments.
- auto setMIRFunctionAttributes = [&CPUStr, &FeaturesStr](Function &F) {
-- setFunctionAttributes(CPUStr, FeaturesStr, F);
-+ codegen::setFunctionAttributes(CPUStr, FeaturesStr, F);
- };
-
-- bool SkipModule = MCPU == "help" ||
-+ auto MAttrs = codegen::getMAttrs();
-+ bool SkipModule = codegen::getMCPU() == "help" ||
- (!MAttrs.empty() && MAttrs.front() == "help");
-
- // If user just wants to list available options, skip module loading
-@@ -433,8 +437,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
-
- // Get the target specific parser.
- std::string Error;
-- const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple,
-- Error);
-+ const Target *TheTarget =
-+ TargetRegistry::lookupTarget(codegen::getMArch(), TheTriple, Error);
- if (!TheTarget) {
- WithColor::error(errs(), argv[0]) << Error;
- return 1;
-@@ -452,7 +456,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
- case '3': OLvl = CodeGenOpt::Aggressive; break;
- }
-
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- Options.DisableIntegratedAS = NoIntegratedAssembler;
- Options.MCOptions.ShowMCEncoding = ShowMCEncoding;
- Options.MCOptions.MCUseDwarfDirectory = EnableDwarfDirectory;
-@@ -462,8 +466,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
- Options.MCOptions.SplitDwarfFile = SplitDwarfFile;
-
- std::unique_ptr<TargetMachine> Target(TheTarget->createTargetMachine(
-- TheTriple.getTriple(), CPUStr, FeaturesStr, Options, getRelocModel(),
-- getCodeModel(), OLvl));
-+ TheTriple.getTriple(), CPUStr, FeaturesStr, Options, codegen::getExplicitRelocModel(),
-+ codegen::getExplicitCodeModel(), OLvl));
-
- assert(Target && "Could not allocate target machine!");
-
-@@ -474,8 +478,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
- return 0;
-
- assert(M && "Should have exited if we didn't have a module!");
-- if (FloatABIForCalls != FloatABI::Default)
-- Options.FloatABIType = FloatABIForCalls;
-+ if (codegen::getFloatABIForCalls() != FloatABI::Default)
-+ Options.FloatABIType = codegen::getFloatABIForCalls();
-
- // Figure out where we are going to send the output.
- std::unique_ptr<ToolOutputFile> Out =
-@@ -522,10 +526,9 @@ static int compileModule(char **argv, LLVMContext &Context) {
-
- // Override function attributes based on CPUStr, FeaturesStr, and command line
- // flags.
-- setFunctionAttributes(CPUStr, FeaturesStr, *M);
-+ codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M);
-
-- if (RelaxAll.getNumOccurrences() > 0 &&
-- FileType != CGFT_ObjectFile)
-+ if (mc::getExplicitRelaxAll() && codegen::getFileType() != CGFT_ObjectFile)
- WithColor::warning(errs(), argv[0])
- << ": warning: ignoring -mc-relax-all because filetype != obj";
-
-@@ -536,7 +539,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
- // so we can memcmp the contents in CompileTwice mode
- SmallVector<char, 0> Buffer;
- std::unique_ptr<raw_svector_ostream> BOS;
-- if ((FileType != CGFT_AssemblyFile &&
-+ if ((codegen::getFileType() != CGFT_AssemblyFile &&
- !Out->os().supportsSeeking()) ||
- CompileTwice) {
- BOS = std::make_unique<raw_svector_ostream>(Buffer);
-@@ -575,9 +578,9 @@ static int compileModule(char **argv, LLVMContext &Context) {
- TPC.setInitialized();
- PM.add(createPrintMIRPass(*OS));
- PM.add(createFreeMachineFunctionPass());
-- } else if (Target->addPassesToEmitFile(PM, *OS,
-- DwoOut ? &DwoOut->os() : nullptr,
-- FileType, NoVerify, MMIWP)) {
-+ } else if (Target->addPassesToEmitFile(
-+ PM, *OS, DwoOut ? &DwoOut->os() : nullptr,
-+ codegen::getFileType(), NoVerify, MMIWP)) {
- WithColor::warning(errs(), argv[0])
- << "target does not support generation of this"
- << " file type!\n";
-diff --git a/llvm/tools/lli/CMakeLists.txt b/llvm/tools/lli/CMakeLists.txt
-index db163ad131e8..bc6ef213b8fd 100644
---- a/llvm/tools/lli/CMakeLists.txt
-+++ b/llvm/tools/lli/CMakeLists.txt
-@@ -53,4 +53,5 @@ add_llvm_tool(lli
- DEPENDS
- intrinsics_gen
- )
-+
- export_executable_symbols(lli)
-diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
-index 0efd0df2c12b..b6a4e3f2833c 100644
---- a/llvm/tools/lli/lli.cpp
-+++ b/llvm/tools/lli/lli.cpp
-@@ -16,7 +16,7 @@
- #include "llvm/ADT/StringExtras.h"
- #include "llvm/ADT/Triple.h"
- #include "llvm/Bitcode/BitcodeReader.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/CodeGen/LinkAllCodegenComponents.h"
- #include "llvm/Config/llvm-config.h"
- #include "llvm/ExecutionEngine/GenericValue.h"
-@@ -67,6 +67,8 @@
-
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- #define DEBUG_TYPE "lli"
-
- namespace {
-@@ -410,13 +412,13 @@ int main(int argc, char **argv, char * const *envp) {
-
- std::string ErrorMsg;
- EngineBuilder builder(std::move(Owner));
-- builder.setMArch(MArch);
-- builder.setMCPU(getCPUStr());
-- builder.setMAttrs(getFeatureList());
-- if (RelocModel.getNumOccurrences())
-- builder.setRelocationModel(RelocModel);
-- if (CMModel.getNumOccurrences())
-- builder.setCodeModel(CMModel);
-+ builder.setMArch(codegen::getMArch());
-+ builder.setMCPU(codegen::getCPUStr());
-+ builder.setMAttrs(codegen::getFeatureList());
-+ if (auto RM = codegen::getExplicitRelocModel())
-+ builder.setRelocationModel(RM.getValue());
-+ if (auto CM = codegen::getExplicitCodeModel())
-+ builder.setCodeModel(CM.getValue());
- builder.setErrorStr(&ErrorMsg);
- builder.setEngineKind(ForceInterpreter
- ? EngineKind::Interpreter
-@@ -448,9 +450,9 @@ int main(int argc, char **argv, char * const *envp) {
-
- builder.setOptLevel(getOptLevel());
-
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-- if (FloatABIForCalls != FloatABI::Default)
-- Options.FloatABIType = FloatABIForCalls;
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-+ if (codegen::getFloatABIForCalls() != FloatABI::Default)
-+ Options.FloatABIType = codegen::getFloatABIForCalls();
-
- builder.setTargetOptions(Options);
-
-@@ -762,18 +764,15 @@ int runOrcLazyJIT(const char *ProgName) {
- TT.empty() ? ExitOnErr(orc::JITTargetMachineBuilder::detectHost())
- : orc::JITTargetMachineBuilder(Triple(TT)));
-
-- if (!MArch.empty())
-- Builder.getJITTargetMachineBuilder()->getTargetTriple().setArchName(MArch);
-+ if (!codegen::getMArch().empty())
-+ Builder.getJITTargetMachineBuilder()->getTargetTriple().setArchName(
-+ codegen::getMArch());
-
- Builder.getJITTargetMachineBuilder()
-- ->setCPU(getCPUStr())
-- .addFeatures(getFeatureList())
-- .setRelocationModel(RelocModel.getNumOccurrences()
-- ? Optional<Reloc::Model>(RelocModel)
-- : None)
-- .setCodeModel(CMModel.getNumOccurrences()
-- ? Optional<CodeModel::Model>(CMModel)
-- : None);
-+ ->setCPU(codegen::getCPUStr())
-+ .addFeatures(codegen::getFeatureList())
-+ .setRelocationModel(codegen::getExplicitRelocModel())
-+ .setCodeModel(codegen::getExplicitCodeModel());
-
- Builder.setLazyCompileFailureAddr(
- pointerToJITTargetAddress(exitOnLazyCallThroughFailure));
-diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
-index 23513ef8fb4e..8cfd433d5da3 100644
---- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
-+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
-@@ -27,7 +27,7 @@
- #include "llvm/MC/MCObjectWriter.h"
- #include "llvm/MC/MCRegisterInfo.h"
- #include "llvm/MC/MCStreamer.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
- #include "llvm/Object/Decompressor.h"
- #include "llvm/Object/ObjectFile.h"
- #include "llvm/Support/DataExtractor.h"
-@@ -46,6 +46,8 @@
- using namespace llvm;
- using namespace llvm::object;
-
-+static mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags;
-+
- cl::OptionCategory DwpCategory("Specific Options");
- static cl::list<std::string> InputFiles(cl::Positional, cl::ZeroOrMore,
- cl::desc("<input files>"),
-@@ -676,7 +678,7 @@ int main(int argc, char **argv) {
- if (!MRI)
- return error(Twine("no register info for target ") + TripleName, Context);
-
-- MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ MCTargetOptions MCOptions = llvm::mc::InitMCTargetOptionsFromFlags();
- std::unique_ptr<MCAsmInfo> MAI(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
- if (!MAI)
-diff --git a/llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp b/llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp
-index b71ed4a70566..627e9ab4c03f 100644
---- a/llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp
-+++ b/llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp
-@@ -14,7 +14,7 @@
- #include "llvm/Analysis/TargetLibraryInfo.h"
- #include "llvm/Bitcode/BitcodeReader.h"
- #include "llvm/Bitcode/BitcodeWriter.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/FuzzMutate/FuzzerCLI.h"
- #include "llvm/FuzzMutate/IRMutator.h"
- #include "llvm/FuzzMutate/Operations.h"
-@@ -35,6 +35,8 @@
-
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- static cl::opt<char>
- OptLevel("O",
- cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
-@@ -133,14 +135,15 @@ extern "C" LLVM_ATTRIBUTE_USED int LLVMFuzzerInitialize(int *argc,
- // Get the target specific parser.
- std::string Error;
- const Target *TheTarget =
-- TargetRegistry::lookupTarget(MArch, TheTriple, Error);
-+ TargetRegistry::lookupTarget(codegen::getMArch(), TheTriple, Error);
- if (!TheTarget) {
- errs() << argv[0] << ": " << Error;
- return 1;
- }
-
- // Set up the pipeline like llc does.
-- std::string CPUStr = getCPUStr(), FeaturesStr = getFeaturesStr();
-+ std::string CPUStr = codegen::getCPUStr(),
-+ FeaturesStr = codegen::getFeaturesStr();
-
- CodeGenOpt::Level OLvl = CodeGenOpt::Default;
- switch (OptLevel) {
-@@ -154,10 +157,10 @@ extern "C" LLVM_ATTRIBUTE_USED int LLVMFuzzerInitialize(int *argc,
- case '3': OLvl = CodeGenOpt::Aggressive; break;
- }
-
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-- TM.reset(TheTarget->createTargetMachine(TheTriple.getTriple(), CPUStr,
-- FeaturesStr, Options, getRelocModel(),
-- getCodeModel(), OLvl));
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-+ TM.reset(TheTarget->createTargetMachine(
-+ TheTriple.getTriple(), CPUStr, FeaturesStr, Options,
-+ codegen::getExplicitRelocModel(), codegen::getExplicitCodeModel(), OLvl));
- assert(TM && "Could not allocate target machine!");
-
- // Make sure we print the summary and the current unit when LLVM errors out.
-diff --git a/llvm/tools/llvm-lto/CMakeLists.txt b/llvm/tools/llvm-lto/CMakeLists.txt
-index 69868fb870c0..5128e713eecf 100644
---- a/llvm/tools/llvm-lto/CMakeLists.txt
-+++ b/llvm/tools/llvm-lto/CMakeLists.txt
-@@ -5,6 +5,7 @@ set(LLVM_LINK_COMPONENTS
- AllTargetsInfos
- BitReader
- BitWriter
-+ CodeGen
- Core
- IRReader
- LTO
-@@ -17,7 +18,5 @@ set(LLVM_LINK_COMPONENTS
- add_llvm_tool(llvm-lto
- llvm-lto.cpp
-
-- DEPENDS
-- intrinsics_gen
-+ DEPENDS intrinsics_gen
- )
--
-diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
-index b47e68e82850..7886426e8945 100644
---- a/llvm/tools/llvm-lto/llvm-lto.cpp
-+++ b/llvm/tools/llvm-lto/llvm-lto.cpp
-@@ -21,7 +21,7 @@
- #include "llvm/ADT/Twine.h"
- #include "llvm/Bitcode/BitcodeReader.h"
- #include "llvm/Bitcode/BitcodeWriter.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/IR/DiagnosticInfo.h"
- #include "llvm/IR/DiagnosticPrinter.h"
- #include "llvm/IR/LLVMContext.h"
-@@ -62,6 +62,8 @@
-
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- static cl::opt<char>
- OptLevel("O", cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
- "(default = '-O2')"),
-@@ -521,7 +523,7 @@ public:
- ThinLTOCodeGenerator ThinGenerator;
-
- ThinLTOProcessing(const TargetOptions &Options) {
-- ThinGenerator.setCodePICModel(getRelocModel());
-+ ThinGenerator.setCodePICModel(codegen::getExplicitRelocModel());
- ThinGenerator.setTargetOptions(Options);
- ThinGenerator.setCacheDir(ThinLTOCacheDir);
- ThinGenerator.setCachePruningInterval(ThinLTOCachePruningInterval);
-@@ -873,7 +875,7 @@ int main(int argc, char **argv) {
- InitializeAllAsmParsers();
-
- // set up the TargetOptions for the machine
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-
- if (ListSymbolsOnly) {
- listSymbols(Options);
-@@ -929,7 +931,7 @@ int main(int argc, char **argv) {
- if (UseDiagnosticHandler)
- CodeGen.setDiagnosticHandler(handleDiagnostics, nullptr);
-
-- CodeGen.setCodePICModel(getRelocModel());
-+ CodeGen.setCodePICModel(codegen::getExplicitRelocModel());
- CodeGen.setFreestanding(EnableFreestanding);
-
- CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF);
-@@ -980,22 +982,18 @@ int main(int argc, char **argv) {
- CodeGen.addMustPreserveSymbol(KeptDSOSyms[i]);
-
- // Set cpu and attrs strings for the default target/subtarget.
-- CodeGen.setCpu(MCPU.c_str());
-+ CodeGen.setCpu(codegen::getMCPU().c_str());
-
- CodeGen.setOptLevel(OptLevel - '0');
-
-- std::string attrs;
-- for (unsigned i = 0; i < MAttrs.size(); ++i) {
-- if (i > 0)
-- attrs.append(",");
-- attrs.append(MAttrs[i]);
-- }
--
-- if (!attrs.empty())
-+ auto MAttrs = codegen::getMAttrs();
-+ if (!MAttrs.empty()) {
-+ std::string attrs = join(MAttrs, ",");
- CodeGen.setAttr(attrs);
-+ }
-
-- if (FileType.getNumOccurrences())
-- CodeGen.setFileType(FileType);
-+ if (auto FT = codegen::getExplicitFileType())
-+ CodeGen.setFileType(FT.getValue());
-
- if (!OutputFilename.empty()) {
- if (!CodeGen.optimize(DisableVerify, DisableInline, DisableGVNLoadPRE,
-diff --git a/llvm/tools/llvm-lto2/CMakeLists.txt b/llvm/tools/llvm-lto2/CMakeLists.txt
-index fa2d8624fd94..4d3364175b04 100644
---- a/llvm/tools/llvm-lto2/CMakeLists.txt
-+++ b/llvm/tools/llvm-lto2/CMakeLists.txt
-@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
- AllTargetsDescs
- AllTargetsInfos
- BitReader
-+ CodeGen
- Core
- Linker
- LTO
-diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
-index 67a677dd45fb..142ba605aa2a 100644
---- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
-+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
-@@ -16,7 +16,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "llvm/Bitcode/BitcodeReader.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/IR/DiagnosticPrinter.h"
- #include "llvm/LTO/Caching.h"
- #include "llvm/LTO/LTO.h"
-@@ -29,6 +29,8 @@
- using namespace llvm;
- using namespace lto;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- static cl::opt<char>
- OptLevel("O", cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
- "(default = '-O2')"),
-@@ -217,12 +219,12 @@ static int run(int argc, char **argv) {
- exit(1);
- };
-
-- Conf.CPU = MCPU;
-- Conf.Options = InitTargetOptionsFromCodeGenFlags();
-- Conf.MAttrs = MAttrs;
-- if (auto RM = getRelocModel())
-- Conf.RelocModel = *RM;
-- Conf.CodeModel = getCodeModel();
-+ Conf.CPU = codegen::getMCPU();
-+ Conf.Options = codegen::InitTargetOptionsFromCodeGenFlags();
-+ Conf.MAttrs = codegen::getMAttrs();
-+ if (auto RM = codegen::getExplicitRelocModel())
-+ Conf.RelocModel = RM.getValue();
-+ Conf.CodeModel = codegen::getExplicitCodeModel();
-
- Conf.DebugPassManager = DebugPassManager;
-
-@@ -264,8 +266,8 @@ static int run(int argc, char **argv) {
- return 1;
- }
-
-- if (FileType.getNumOccurrences())
-- Conf.CGFileType = FileType;
-+ if (auto FT = codegen::getExplicitFileType())
-+ Conf.CGFileType = FT.getValue();
-
- Conf.OverrideTriple = OverrideTriple;
- Conf.DefaultTriple = DefaultTriple;
-diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt b/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt
-index fb6befd3c54a..6bbc502e2eee 100644
---- a/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt
-+++ b/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt
-@@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS
- MCParser
- Support
- )
-+
- add_llvm_fuzzer(llvm-mc-assemble-fuzzer
- llvm-mc-assemble-fuzzer.cpp
- )
-diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
-index 6c5961f7027c..29699c634bfa 100644
---- a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
-+++ b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
-@@ -9,7 +9,6 @@
- //===----------------------------------------------------------------------===//
-
- #include "llvm-c/Target.h"
--#include "llvm/MC/SubtargetFeature.h"
- #include "llvm/MC/MCAsmBackend.h"
- #include "llvm/MC/MCAsmInfo.h"
- #include "llvm/MC/MCCodeEmitter.h"
-@@ -24,15 +23,16 @@
- #include "llvm/MC/MCSectionMachO.h"
- #include "llvm/MC/MCStreamer.h"
- #include "llvm/MC/MCSubtargetInfo.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
--#include "llvm/Support/MemoryBuffer.h"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
-+#include "llvm/MC/SubtargetFeature.h"
- #include "llvm/Support/CommandLine.h"
- #include "llvm/Support/FileUtilities.h"
--#include "llvm/Support/raw_ostream.h"
-+#include "llvm/Support/MemoryBuffer.h"
- #include "llvm/Support/SourceMgr.h"
--#include "llvm/Support/TargetSelect.h"
- #include "llvm/Support/TargetRegistry.h"
-+#include "llvm/Support/TargetSelect.h"
- #include "llvm/Support/ToolOutputFile.h"
-+#include "llvm/Support/raw_ostream.h"
-
- using namespace llvm;
-
-@@ -161,7 +161,7 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) {
- abort();
- }
-
-- MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ MCTargetOptions MCOptions = mc::InitMCTargetOptionsFromFlags();
- std::unique_ptr<MCAsmInfo> MAI(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
- if (!MAI) {
-diff --git a/llvm/tools/llvm-mc/CMakeLists.txt b/llvm/tools/llvm-mc/CMakeLists.txt
-index 15c6dda1b258..94add70b6943 100644
---- a/llvm/tools/llvm-mc/CMakeLists.txt
-+++ b/llvm/tools/llvm-mc/CMakeLists.txt
-@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
- AllTargetsDescs
- AllTargetsDisassemblers
- AllTargetsInfos
-+ CodeGen
- MC
- MCParser
- Support
-diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
-index 6aa347d98be2..8c1b3cf2cab0 100644
---- a/llvm/tools/llvm-mc/llvm-mc.cpp
-+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
-@@ -25,7 +25,7 @@
- #include "llvm/MC/MCRegisterInfo.h"
- #include "llvm/MC/MCStreamer.h"
- #include "llvm/MC/MCSubtargetInfo.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
- #include "llvm/Support/CommandLine.h"
- #include "llvm/Support/Compression.h"
- #include "llvm/Support/FileUtilities.h"
-@@ -41,6 +41,8 @@
-
- using namespace llvm;
-
-+static mc::RegisterMCTargetOptionsFlags MOF;
-+
- static cl::opt<std::string>
- InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
-
-@@ -317,7 +319,7 @@ int main(int argc, char **argv) {
- cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
-
- cl::ParseCommandLineOptions(argc, argv, "llvm machine code playground\n");
-- const MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ const MCTargetOptions MCOptions = mc::InitMCTargetOptionsFromFlags();
- setDwarfDebugFlags(argc, argv);
-
- setDwarfDebugProducer();
-diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
-index fff5906bb59b..eca86768aa5c 100644
---- a/llvm/tools/llvm-mca/llvm-mca.cpp
-+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
-@@ -39,7 +39,7 @@
- #include "llvm/MC/MCObjectFileInfo.h"
- #include "llvm/MC/MCRegisterInfo.h"
- #include "llvm/MC/MCSubtargetInfo.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
- #include "llvm/MCA/CodeEmitter.h"
- #include "llvm/MCA/Context.h"
- #include "llvm/MCA/InstrBuilder.h"
-@@ -62,6 +62,8 @@
-
- using namespace llvm;
-
-+static mc::RegisterMCTargetOptionsFlags MOF;
-+
- static cl::OptionCategory ToolOptions("Tool Options");
- static cl::OptionCategory ViewOptions("View Options");
-
-@@ -353,7 +355,7 @@ int main(int argc, char **argv) {
- std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
- assert(MRI && "Unable to create target register info!");
-
-- MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ MCTargetOptions MCOptions = mc::InitMCTargetOptionsFromFlags();
- std::unique_ptr<MCAsmInfo> MAI(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
- assert(MAI && "Unable to create target asm info!");
-@@ -443,7 +445,7 @@ int main(int argc, char **argv) {
- TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx));
-
- std::unique_ptr<MCAsmBackend> MAB(TheTarget->createMCAsmBackend(
-- *STI, *MRI, InitMCTargetOptionsFromFlags()));
-+ *STI, *MRI, mc::InitMCTargetOptionsFromFlags()));
-
- for (const std::unique_ptr<mca::CodeRegion> &Region : Regions) {
- // Skip empty code regions.
-diff --git a/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp b/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
-index cd6c7d380cc6..e353e333f580 100644
---- a/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
-+++ b/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
-@@ -12,7 +12,7 @@
-
- #include "llvm/Bitcode/BitcodeReader.h"
- #include "llvm/Bitcode/BitcodeWriter.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/FuzzMutate/FuzzerCLI.h"
- #include "llvm/FuzzMutate/IRMutator.h"
- #include "llvm/IR/Verifier.h"
-@@ -24,6 +24,8 @@
-
- using namespace llvm;
-
-+static codegen::RegisterCodeGenFlags CGF;
-+
- static cl::opt<std::string>
- TargetTripleStr("mtriple", cl::desc("Override target triple for module"));
-
-@@ -124,7 +126,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
-
- M->setTargetTriple(TM->getTargetTriple().normalize());
- M->setDataLayout(TM->createDataLayout());
-- setFunctionAttributes(TM->getTargetCPU(), TM->getTargetFeatureString(), *M);
-+ codegen::setFunctionAttributes(TM->getTargetCPU(),
-+ TM->getTargetFeatureString(), *M);
-
- // Create pass pipeline
- //
-@@ -214,16 +217,17 @@ extern "C" LLVM_ATTRIBUTE_USED int LLVMFuzzerInitialize(
-
- std::string Error;
- const Target *TheTarget =
-- TargetRegistry::lookupTarget(MArch, TargetTriple, Error);
-+ TargetRegistry::lookupTarget(codegen::getMArch(), TargetTriple, Error);
- if (!TheTarget) {
- errs() << *argv[0] << ": " << Error;
- exit(1);
- }
-
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- TM.reset(TheTarget->createTargetMachine(
-- TargetTriple.getTriple(), getCPUStr(), getFeaturesStr(),
-- Options, getRelocModel(), getCodeModel(), CodeGenOpt::Default));
-+ TargetTriple.getTriple(), codegen::getCPUStr(), codegen::getFeaturesStr(),
-+ Options, codegen::getExplicitRelocModel(),
-+ codegen::getExplicitCodeModel(), CodeGenOpt::Default));
- assert(TM && "Could not allocate target machine!");
-
- // Check that pass pipeline is specified and correct
-diff --git a/llvm/tools/lto/CMakeLists.txt b/llvm/tools/lto/CMakeLists.txt
-index b86e4abd01a7..2963f97cad88 100644
---- a/llvm/tools/lto/CMakeLists.txt
-+++ b/llvm/tools/lto/CMakeLists.txt
-@@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS
- AllTargetsInfos
- BitReader
- Core
-+ CodeGen
- LTO
- MC
- MCDisassembler
-@@ -20,7 +21,8 @@ set(SOURCES
-
- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
-
--add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen)
-+add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS
-+ intrinsics_gen)
-
- install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
- DESTINATION include/llvm-c
-diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp
-index 9933af94de1e..6d207b76685f 100644
---- a/llvm/tools/lto/lto.cpp
-+++ b/llvm/tools/lto/lto.cpp
-@@ -15,7 +15,7 @@
- #include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/StringExtras.h"
- #include "llvm/Bitcode/BitcodeReader.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/IR/DiagnosticInfo.h"
- #include "llvm/IR/DiagnosticPrinter.h"
- #include "llvm/IR/LLVMContext.h"
-@@ -28,6 +28,10 @@
- #include "llvm/Support/TargetSelect.h"
- #include "llvm/Support/raw_ostream.h"
-
-+using namespace llvm;
-+
-+static codegen::RegisterCodeGenFlags CGF;
-+
- // extra command-line flags needed for LTOCodeGenerator
- static cl::opt<char>
- OptLevel("O",
-@@ -154,14 +158,9 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LTOModule, lto_module_t)
- // Convert the subtarget features into a string to pass to LTOCodeGenerator.
- static void lto_add_attrs(lto_code_gen_t cg) {
- LTOCodeGenerator *CG = unwrap(cg);
-- if (MAttrs.size()) {
-- std::string attrs;
-- for (unsigned i = 0; i < MAttrs.size(); ++i) {
-- if (i > 0)
-- attrs.append(",");
-- attrs.append(MAttrs[i]);
-- }
--
-+ auto MAttrs = codegen::getMAttrs();
-+ if (!MAttrs.empty()) {
-+ std::string attrs = join(MAttrs, ",");
- CG->setAttr(attrs);
- }
-
-@@ -219,7 +218,7 @@ lto_module_is_object_file_in_memory_for_target(const void* mem,
-
- lto_module_t lto_module_create(const char* path) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M =
- LTOModule::createFromFile(*LTOContext, StringRef(path), Options);
- if (!M)
-@@ -229,7 +228,7 @@ lto_module_t lto_module_create(const char* path) {
-
- lto_module_t lto_module_create_from_fd(int fd, const char *path, size_t size) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M = LTOModule::createFromOpenFile(
- *LTOContext, fd, StringRef(path), size, Options);
- if (!M)
-@@ -242,7 +241,7 @@ lto_module_t lto_module_create_from_fd_at_offset(int fd, const char *path,
- size_t map_size,
- off_t offset) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M = LTOModule::createFromOpenFileSlice(
- *LTOContext, fd, StringRef(path), map_size, offset, Options);
- if (!M)
-@@ -252,7 +251,7 @@ lto_module_t lto_module_create_from_fd_at_offset(int fd, const char *path,
-
- lto_module_t lto_module_create_from_memory(const void* mem, size_t length) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M =
- LTOModule::createFromBuffer(*LTOContext, mem, length, Options);
- if (!M)
-@@ -264,7 +263,7 @@ lto_module_t lto_module_create_from_memory_with_path(const void* mem,
- size_t length,
- const char *path) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M = LTOModule::createFromBuffer(
- *LTOContext, mem, length, Options, StringRef(path));
- if (!M)
-@@ -275,7 +274,7 @@ lto_module_t lto_module_create_from_memory_with_path(const void* mem,
- lto_module_t lto_module_create_in_local_context(const void *mem, size_t length,
- const char *path) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-
- // Create a local context. Ownership will be transferred to LTOModule.
- std::unique_ptr<LLVMContext> Context = std::make_unique<LLVMContext>();
-@@ -294,7 +293,7 @@ lto_module_t lto_module_create_in_codegen_context(const void *mem,
- const char *path,
- lto_code_gen_t cg) {
- lto_initialize();
-- llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ llvm::TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
- ErrorOr<std::unique_ptr<LTOModule>> M = LTOModule::createFromBuffer(
- unwrap(cg)->getContext(), mem, length, Options, StringRef(path));
- return wrap(M->release());
-@@ -336,7 +335,7 @@ void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg,
- static lto_code_gen_t createCodeGen(bool InLocalContext) {
- lto_initialize();
-
-- TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-
- LibLTOCodeGenerator *CodeGen =
- InLocalContext ? new LibLTOCodeGenerator(std::make_unique<LLVMContext>())
-@@ -484,7 +483,7 @@ void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg,
- thinlto_code_gen_t thinlto_create_codegen(void) {
- lto_initialize();
- ThinLTOCodeGenerator *CodeGen = new ThinLTOCodeGenerator();
-- CodeGen->setTargetOptions(InitTargetOptionsFromCodeGenFlags());
-+ CodeGen->setTargetOptions(codegen::InitTargetOptionsFromCodeGenFlags());
- CodeGen->setFreestanding(EnableFreestanding);
-
- if (OptLevel.getNumOccurrences()) {
-diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
-index 75a6cdc3892b..8d619ef76b7a 100644
---- a/llvm/tools/opt/opt.cpp
-+++ b/llvm/tools/opt/opt.cpp
-@@ -22,7 +22,7 @@
- #include "llvm/Analysis/TargetLibraryInfo.h"
- #include "llvm/Analysis/TargetTransformInfo.h"
- #include "llvm/Bitcode/BitcodeWriterPass.h"
--#include "llvm/CodeGen/CommandFlags.inc"
-+#include "llvm/CodeGen/CommandFlags.h"
- #include "llvm/CodeGen/TargetPassConfig.h"
- #include "llvm/Config/llvm-config.h"
- #include "llvm/IR/DataLayout.h"
-@@ -61,6 +61,8 @@
- using namespace llvm;
- using namespace opt_tool;
-
-+static codegen::RegisterCodeGenFlags CFG;
-+
- // The OptimizationList is automatically populated with registered Passes by the
- // PassNameParser.
- //
-@@ -470,16 +472,17 @@ static TargetMachine* GetTargetMachine(Triple TheTriple, StringRef CPUStr,
- StringRef FeaturesStr,
- const TargetOptions &Options) {
- std::string Error;
-- const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple,
-- Error);
-+ const Target *TheTarget =
-+ TargetRegistry::lookupTarget(codegen::getMArch(), TheTriple, Error);
- // Some modules don't specify a triple, and this is okay.
- if (!TheTarget) {
- return nullptr;
- }
-
-- return TheTarget->createTargetMachine(TheTriple.getTriple(), CPUStr,
-- FeaturesStr, Options, getRelocModel(),
-- getCodeModel(), GetCodeGenOptLevel());
-+ return TheTarget->createTargetMachine(
-+ TheTriple.getTriple(), codegen::getCPUStr(), codegen::getFeaturesStr(),
-+ Options, codegen::getExplicitRelocModel(),
-+ codegen::getExplicitCodeModel(), GetCodeGenOptLevel());
- }
-
- #ifdef BUILD_EXAMPLES
-@@ -659,11 +662,11 @@ int main(int argc, char **argv) {
- Triple ModuleTriple(M->getTargetTriple());
- std::string CPUStr, FeaturesStr;
- TargetMachine *Machine = nullptr;
-- const TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
-+ const TargetOptions Options = codegen::InitTargetOptionsFromCodeGenFlags();
-
- if (ModuleTriple.getArch()) {
-- CPUStr = getCPUStr();
-- FeaturesStr = getFeaturesStr();
-+ CPUStr = codegen::getCPUStr();
-+ FeaturesStr = codegen::getFeaturesStr();
- Machine = GetTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options);
- } else if (ModuleTriple.getArchName() != "unknown" &&
- ModuleTriple.getArchName() != "") {
-@@ -676,7 +679,7 @@ int main(int argc, char **argv) {
-
- // Override function attributes based on CPUStr, FeaturesStr, and command line
- // flags.
-- setFunctionAttributes(CPUStr, FeaturesStr, *M);
-+ codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M);
-
- // If the output is set to be emitted to standard out, and standard out is a
- // console, print out a warning message and refuse to do it. We don't
-diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
-index 472d4dd6ad1e..32d1d3c91ff2 100644
---- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
-+++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
-@@ -25,7 +25,7 @@
- #include "llvm/MC/MCRegisterInfo.h"
- #include "llvm/MC/MCStreamer.h"
- #include "llvm/MC/MCSubtargetInfo.h"
--#include "llvm/MC/MCTargetOptionsCommandFlags.inc"
-+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
- #include "llvm/PassAnalysisSupport.h"
- #include "llvm/Support/TargetRegistry.h"
- #include "llvm/Support/raw_ostream.h"
-@@ -36,6 +36,8 @@
- using namespace llvm;
- using namespace dwarf;
-
-+mc::RegisterMCTargetOptionsFlags MOF;
-+
- namespace {} // end anonymous namespace
-
- //===----------------------------------------------------------------------===//
-@@ -410,7 +412,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
- TripleName,
- inconvertibleErrorCode());
-
-- MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
-+ MCTargetOptions MCOptions = mc::InitMCTargetOptionsFromFlags();
- MAI.reset(TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
- if (!MAI)
- return make_error<StringError>("no asm info for target " + TripleName,
---
-2.33.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-basic-block-sections-support.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-basic-block-sections-support.patch
deleted file mode 100644
index f90a79ae..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-basic-block-sections-support.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-From d51fdb9f2986747a56c593fa057d531720b39deb Mon Sep 17 00:00:00 2001
-From: Sriraman Tallam <tmsriram@google.com>
-Date: Fri, 13 Mar 2020 15:58:57 -0700
-Subject: [PATCH] Basic Block Sections Support.
-
-This is the first in a series of patches to enable Basic Block Sections
-in LLVM.
-
-We introduce a new compiler option, -fbasicblock-sections=, which places every
-basic block in a unique ELF text section in the object file along with a
-symbol labeling the basic block. The linker can then order the basic block
-sections in any arbitrary sequence which when done correctly can encapsulate
-block layout, function layout and function splitting optimizations. However,
-there are a couple of challenges to be addressed for this to be feasible:
-
-1) The compiler must not allow any implicit fall-through between any two
- adjacent basic blocks as they could be reordered at link time to be
- non-adjacent. In other words, the compiler must make a fall-through
- between adjacent basic blocks explicit by retaining the direct jump
- instruction that jumps to the next basic block. These branches can only
- be removed later by the linker after the blocks have been reordered.
-2) All inter-basic block branch targets would now need to be resolved by
- the linker as they cannot be calculated during compile time. This is
- done using static relocations which bloats the size of the object files.
- Further, the compiler tries to use short branch instructions on some ISAs
- for branch offsets that can be accommodated in one byte. This is not
- possible with basic block sections as the offset is not determined at
- compile time, and long branch instructions have to be used everywhere.
-3) Each additional section bloats object file sizes by tens of bytes. The
- number of basic blocks can be potentially very large compared to the
- size of functions and can bloat object sizes significantly. Option
- fbasicblock-sections= also takes a file path which can be used to
- specify a subset of basic blocks that needs unique sections to keep
- the bloats small.
-4) Debug Info and CFI need special handling and will be presented as
- separate patches.
-
-Basic Block Labels
-
-With -fbasicblock-sections=labels, or when a basic block is placed in a
-unique section, it is labelled with a symbol. This allows easy mapping of
-virtual addresses from PMU profiles back to the corresponding basic blocks.
-Since the number of basic blocks is large, the labeling bloats the symbol
-table sizes and the string table sizes significantly. While the binary size
-does increase, it does not affect performance as the symbol table is not
-loaded in memory during run-time. The string table size bloat is kept very
-minimal using a unary naming scheme that uses string suffix compression.
-The basic blocks for function foo are named "a.BB.foo", "aa.BB.foo", ...
-This turns out to be very good for string table sizes and the bloat in the
-string table size for a very large binary is ~8 %. The naming also allows
-using the --symbol-ordering-file option in LLD to arbitrarily reorder the
-sections.
-
-Differential Revision: https://reviews.llvm.org/D68063
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/4dfe92e46542be46d634a7ec24da2f2f889623d0]
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- llvm/include/llvm/CodeGen/CommandFlags.inc | 34 ++++++++++++++++++++++
- llvm/include/llvm/Target/TargetMachine.h | 14 +++++++++
- llvm/include/llvm/Target/TargetOptions.h | 31 ++++++++++++++++++--
- 3 files changed, 76 insertions(+), 3 deletions(-)
-
-diff --git a/llvm/include/llvm/CodeGen/CommandFlags.inc b/llvm/include/llvm/CodeGen/CommandFlags.inc
-index 8739b644873d..6475a5b19edb 100644
---- a/llvm/include/llvm/CodeGen/CommandFlags.inc
-+++ b/llvm/include/llvm/CodeGen/CommandFlags.inc
-@@ -238,6 +238,12 @@ static cl::opt<bool>
- cl::desc("Emit functions into separate sections"),
- cl::init(false));
-
-+static cl::opt<std::string>
-+ BBSections("basicblock-sections",
-+ cl::desc("Emit basic blocks into separate sections"),
-+ cl::value_desc("all | <function list (file)> | labels | none"),
-+ cl::init("none"));
-+
- static cl::opt<unsigned> TLSSize("tls-size",
- cl::desc("Bit size of immediate TLS offsets"),
- cl::init(0));
-@@ -251,6 +257,11 @@ static cl::opt<bool>
- cl::desc("Give unique names to every section"),
- cl::init(true));
-
-+static cl::opt<bool> UniqueBBSectionNames(
-+ "unique-bb-section-names",
-+ cl::desc("Give unique names to every basic block section"),
-+ cl::init(false));
-+
- static cl::opt<llvm::EABI>
- EABIVersion("meabi", cl::desc("Set EABI type (default depends on triple):"),
- cl::init(EABI::Default),
-@@ -285,6 +296,27 @@ static cl::opt<bool>
- cl::desc("Always emit a debug frame section."),
- cl::init(false));
-
-+static llvm::BasicBlockSection
-+getBBSectionsMode(llvm::TargetOptions &Options) {
-+ if (BBSections == "all")
-+ return BasicBlockSection::All;
-+ else if (BBSections == "labels")
-+ return BasicBlockSection::Labels;
-+ else if (BBSections == "none")
-+ return BasicBlockSection::None;
-+ else {
-+ ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
-+ MemoryBuffer::getFile(BBSections);
-+ if (!MBOrErr) {
-+ errs() << "Error loading basic block sections function list file: "
-+ << MBOrErr.getError().message() << "\n";
-+ } else {
-+ Options.BBSectionsFuncListBuf = std::move(*MBOrErr);
-+ }
-+ return BasicBlockSection::List;
-+ }
-+}
-+
- // Common utility function tightly tied to the options listed here. Initializes
- // a TargetOptions object with CodeGen flags and returns it.
- static TargetOptions InitTargetOptionsFromCodeGenFlags() {
-@@ -308,7 +340,9 @@ static TargetOptions InitTargetOptionsFromCodeGenFlags() {
- Options.RelaxELFRelocations = RelaxELFRelocations;
- Options.DataSections = DataSections;
- Options.FunctionSections = FunctionSections;
-+ Options.BBSections = getBBSectionsMode(Options);
- Options.UniqueSectionNames = UniqueSectionNames;
-+ Options.UniqueBBSectionNames = UniqueBBSectionNames;
- Options.TLSSize = TLSSize;
- Options.EmulatedTLS = EmulatedTLS;
- Options.ExplicitEmulatedTLS = EmulatedTLS.getNumOccurrences() > 0;
-diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
-index 176ae39b17a7..4a1f3377f31d 100644
---- a/llvm/include/llvm/Target/TargetMachine.h
-+++ b/llvm/include/llvm/Target/TargetMachine.h
-@@ -242,6 +242,9 @@ public:
-
- bool getUniqueSectionNames() const { return Options.UniqueSectionNames; }
-
-+ /// Return true if unique basic block section names must be generated.
-+ bool getUniqueBBSectionNames() const { return Options.UniqueBBSectionNames; }
-+
- /// Return true if data objects should be emitted into their own section,
- /// corresponds to -fdata-sections.
- bool getDataSections() const {
-@@ -254,6 +257,17 @@ public:
- return Options.FunctionSections;
- }
-
-+ /// If basic blocks should be emitted into their own section,
-+ /// corresponding to -fbasicblock-sections.
-+ llvm::BasicBlockSection getBBSectionsType() const {
-+ return Options.BBSections;
-+ }
-+
-+ /// Get the list of functions and basic block ids that need unique sections.
-+ const MemoryBuffer *getBBSectionsFuncListBuf() const {
-+ return Options.BBSectionsFuncListBuf.get();
-+ }
-+
- /// Get a \c TargetIRAnalysis appropriate for the target.
- ///
- /// This is used to construct the new pass manager's target IR analysis pass,
-diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
-index 84c6ee2a6387..d27c7b0178f0 100644
---- a/llvm/include/llvm/Target/TargetOptions.h
-+++ b/llvm/include/llvm/Target/TargetOptions.h
-@@ -16,8 +16,11 @@
-
- #include "llvm/MC/MCTargetOptions.h"
-
-+#include <memory>
-+
- namespace llvm {
- class MachineFunction;
-+ class MemoryBuffer;
- class Module;
-
- namespace FloatABI {
-@@ -63,6 +66,18 @@ namespace llvm {
- };
- }
-
-+ enum class BasicBlockSection {
-+ All, // Use Basic Block Sections for all basic blocks. A section
-+ // for every basic block can significantly bloat object file sizes.
-+ List, // Get list of functions & BBs from a file. Selectively enables
-+ // basic block sections for a subset of basic blocks which can be
-+ // used to control object size bloats from creating sections.
-+ Labels, // Do not use Basic Block Sections but label basic blocks. This
-+ // is useful when associating profile counts from virtual addresses
-+ // to basic blocks.
-+ None // Do not use Basic Block Sections.
-+ };
-+
- enum class EABI {
- Unknown,
- Default, // Default means not specified
-@@ -114,9 +129,9 @@ namespace llvm {
- EnableFastISel(false), EnableGlobalISel(false), UseInitArray(false),
- DisableIntegratedAS(false), RelaxELFRelocations(false),
- FunctionSections(false), DataSections(false),
-- UniqueSectionNames(true), TrapUnreachable(false),
-- NoTrapAfterNoreturn(false), TLSSize(0), EmulatedTLS(false),
-- ExplicitEmulatedTLS(false), EnableIPRA(false),
-+ UniqueSectionNames(true), UniqueBBSectionNames(false),
-+ TrapUnreachable(false), NoTrapAfterNoreturn(false), TLSSize(0),
-+ EmulatedTLS(false), ExplicitEmulatedTLS(false), EnableIPRA(false),
- EmitStackSizeSection(false), EnableMachineOutliner(false),
- SupportsDefaultOutlining(false), EmitAddrsig(false),
- EnableDebugEntryValues(false), ForceDwarfFrameSection(false) {}
-@@ -224,6 +239,9 @@ namespace llvm {
-
- unsigned UniqueSectionNames : 1;
-
-+ /// Use unique names for basic block sections.
-+ unsigned UniqueBBSectionNames : 1;
-+
- /// Emit target-specific trap instruction for 'unreachable' IR instructions.
- unsigned TrapUnreachable : 1;
-
-@@ -256,6 +274,13 @@ namespace llvm {
- /// Emit address-significance table.
- unsigned EmitAddrsig : 1;
-
-+ /// Emit basic blocks into separate sections.
-+ BasicBlockSection BBSections = BasicBlockSection::None;
-+
-+ /// Memory Buffer that contains information on sampled basic blocks and used
-+ /// to selectively generate basic block sections.
-+ std::shared_ptr<MemoryBuffer> BBSectionsFuncListBuf;
-+
- /// Emit debug info about parameter's entry values.
- unsigned EnableDebugEntryValues : 1;
-
---
-2.33.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch
deleted file mode 100644
index 7e6c4f92..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 3632f727dfd786a8eca50bd01219669bbe7b0df9 Mon Sep 17 00:00:00 2001
-From: haonanya <haonan.yang@intel.com>
-Date: Tue, 11 May 2021 11:13:02 +0800
-Subject: [PATCH 1/3] Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR
- doesn't require image support
-
-Upstream-Status: Backport [Taken from opencl-clang patches, https://github.com/intel/opencl-clang/blob/ocl-open-120/patches/clang/0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch]
-
-Signed-off-by: haonanya <haonan.yang@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/Frontend/InitPreprocessor.cpp | 3 ---
- clang/test/Preprocessor/predefined-macros.c | 2 --
- 2 files changed, 5 deletions(-)
-
-diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
-index c64a912ce919..c60972c96e5d 100644
---- a/clang/lib/Frontend/InitPreprocessor.cpp
-+++ b/clang/lib/Frontend/InitPreprocessor.cpp
-@@ -1121,9 +1121,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- // OpenCL definitions.
- if (LangOpts.OpenCL) {
- TI.getOpenCLFeatureDefines(LangOpts, Builder);
--
-- if (TI.getTriple().isSPIR())
-- Builder.defineMacro("__IMAGE_SUPPORT__");
- }
-
- if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
-diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c
-index e406b9a70570..88606518c7de 100644
---- a/clang/test/Preprocessor/predefined-macros.c
-+++ b/clang/test/Preprocessor/predefined-macros.c
-@@ -188,14 +188,12 @@
-
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR
--// CHECK-SPIR-DAG: #define __IMAGE_SUPPORT__ 1
- // CHECK-SPIR-DAG: #define __SPIR__ 1
- // CHECK-SPIR-DAG: #define __SPIR32__ 1
- // CHECK-SPIR-NOT: #define __SPIR64__ 1
-
- // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir64-unknown-unknown \
- // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR64
--// CHECK-SPIR64-DAG: #define __IMAGE_SUPPORT__ 1
- // CHECK-SPIR64-DAG: #define __SPIR__ 1
- // CHECK-SPIR64-DAG: #define __SPIR64__ 1
- // CHECK-SPIR64-NOT: #define __SPIR32__ 1
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch
deleted file mode 100644
index 4f7d3e51..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 06cf750d2ef892eaa4f0ff5d0a9e9e5c49697264 Mon Sep 17 00:00:00 2001
-From: Raphael Isemann <teemperor@gmail.com>
-Date: Thu, 1 Apr 2021 18:41:44 +0200
-Subject: [PATCH 2/3] Avoid calling ParseCommandLineOptions in BackendUtil if
- possible
-
-Calling `ParseCommandLineOptions` should only be called from `main` as the
-CommandLine setup code isn't thread-safe. As BackendUtil is part of the
-generic Clang FrontendAction logic, a process which has several threads executing
-Clang FrontendActions will randomly crash in the unsafe setup code.
-
-This patch avoids calling the function unless either the debug-pass option or
-limit-float-precision option is set. Without these two options set the
-`ParseCommandLineOptions` call doesn't do anything beside parsing
-the command line `clang` which doesn't set any options.
-
-See also D99652 where LLDB received a workaround for this crash.
-
-Reviewed By: JDevlieghere
-
-Differential Revision: https://reviews.llvm.org/D99740
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-120/patches/clang/0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/CodeGen/BackendUtil.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
-index 52bcd971dc8c..f9f891247530 100644
---- a/clang/lib/CodeGen/BackendUtil.cpp
-+++ b/clang/lib/CodeGen/BackendUtil.cpp
-@@ -850,7 +850,15 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) {
- BackendArgs.push_back("-limit-float-precision");
- BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str());
- }
-+ // Check for the default "clang" invocation that won't set any cl::opt values.
-+ // Skip trying to parse the command line invocation to avoid the issues
-+ // described below.
-+ if (BackendArgs.size() == 1)
-+ return;
- BackendArgs.push_back(nullptr);
-+ // FIXME: The command line parser below is not thread-safe and shares a global
-+ // state, so this call might crash or overwrite the options of another Clang
-+ // instance in the same process.
- llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1,
- BackendArgs.data());
- }
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0003-Support-cl_ext_float_atomics.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0003-Support-cl_ext_float_atomics.patch
deleted file mode 100644
index 99dbb81c..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0003-Support-cl_ext_float_atomics.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From f1a24eeb89342186c6c718e02dd394775620799f Mon Sep 17 00:00:00 2001
-From: haonanya <haonan.yang@intel.com>
-Date: Wed, 28 Jul 2021 14:20:08 +0800
-Subject: [PATCH 3/3] Support cl_ext_float_atomics
-
-Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-120/patches/clang/0003-OpenCL-Support-cl_ext_float_atomics.patch]
-
-Signed-off-by: haonanya <haonan.yang@intel.com>
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- clang/lib/Headers/opencl-c-base.h | 19 +++
- clang/lib/Headers/opencl-c.h | 195 ++++++++++++++++++++++++++
- clang/test/Headers/opencl-c-header.cl | 72 ++++++++++
- 3 files changed, 286 insertions(+)
-
-diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
-index e8dcd70377e5..c8b6d36029ec 100644
---- a/clang/lib/Headers/opencl-c-base.h
-+++ b/clang/lib/Headers/opencl-c-base.h
-@@ -21,6 +21,25 @@
- #define cl_khr_subgroup_shuffle 1
- #define cl_khr_subgroup_shuffle_relative 1
- #define cl_khr_subgroup_clustered_reduce 1
-+#define cl_ext_float_atomics
-+#ifdef cl_khr_fp16
-+#define __opencl_c_ext_fp16_global_atomic_load_store 1
-+#define __opencl_c_ext_fp16_local_atomic_load_store 1
-+#define __opencl_c_ext_fp16_global_atomic_add 1
-+#define __opencl_c_ext_fp16_local_atomic_add 1
-+#define __opencl_c_ext_fp16_global_atomic_min_max 1
-+#define __opencl_c_ext_fp16_local_atomic_min_max 1
-+#endif
-+#ifdef __opencl_c_fp64
-+#define __opencl_c_ext_fp64_global_atomic_add 1
-+#define __opencl_c_ext_fp64_local_atomic_add 1
-+#define __opencl_c_ext_fp64_global_atomic_min_max 1
-+#define __opencl_c_ext_fp64_local_atomic_min_max 1
-+#endif
-+#define __opencl_c_ext_fp32_global_atomic_add 1
-+#define __opencl_c_ext_fp32_local_atomic_add 1
-+#define __opencl_c_ext_fp32_global_atomic_min_max 1
-+#define __opencl_c_ext_fp32_local_atomic_min_max 1
- #endif // defined(__SPIR__)
- #endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-
-diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
-index ab665628c8e1..6676da858d2a 100644
---- a/clang/lib/Headers/opencl-c.h
-+++ b/clang/lib/Headers/opencl-c.h
-@@ -13531,6 +13531,201 @@ intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uint
- intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
- #endif
-
-+#if defined(cl_ext_float_atomics)
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_max(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_min_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_max(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_min_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp32_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_min_max)
-+float __ovld atomic_fetch_min(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_max(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_min_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_max_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_min_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_max_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp64_global_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_max(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_min_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_max(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_min_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp64_global_atomic_min_max) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_min_max)
-+double __ovld atomic_fetch_min(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_max(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_min_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_max_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_min_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_max_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+
-+#if defined(__opencl_c_ext_fp32_global_atomic_add)
-+float __ovld atomic_fetch_add(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_sub(volatile __global atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_add_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile __global atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp32_local_atomic_add)
-+float __ovld atomic_fetch_add(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_sub(volatile __local atomic_float *object,
-+ float operand);
-+float __ovld atomic_fetch_add_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile __local atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp32_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp32_local_atomic_add)
-+float __ovld atomic_fetch_add(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_sub(volatile atomic_float *object, float operand);
-+float __ovld atomic_fetch_add_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_sub_explicit(volatile atomic_float *object,
-+ float operand, memory_order order);
-+float __ovld atomic_fetch_add_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+float __ovld atomic_fetch_sub_explicit(volatile atomic_float *object,
-+ float operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+
-+#if defined(__opencl_c_ext_fp64_global_atomic_add)
-+double __ovld atomic_fetch_add(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_sub(volatile __global atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_add_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile __global atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp64_local_atomic_add)
-+double __ovld atomic_fetch_add(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_sub(volatile __local atomic_double *object,
-+ double operand);
-+double __ovld atomic_fetch_add_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile __local atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+#if defined(__opencl_c_ext_fp64_global_atomic_add) || \
-+ defined(__opencl_c_ext_fp64_local_atomic_add)
-+double __ovld atomic_fetch_add(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_sub(volatile atomic_double *object, double operand);
-+double __ovld atomic_fetch_add_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_sub_explicit(volatile atomic_double *object,
-+ double operand, memory_order order);
-+double __ovld atomic_fetch_add_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+double __ovld atomic_fetch_sub_explicit(volatile atomic_double *object,
-+ double operand, memory_order order,
-+ memory_scope scope);
-+#endif
-+
-+#endif // cl_ext_float_atomics
-+
- // atomic_store()
-
- void __ovld atomic_store(volatile atomic_int *object, int desired);
-diff --git a/clang/test/Headers/opencl-c-header.cl b/clang/test/Headers/opencl-c-header.cl
-index 13a3b62481ec..2c02d14f25c3 100644
---- a/clang/test/Headers/opencl-c-header.cl
-+++ b/clang/test/Headers/opencl-c-header.cl
-@@ -124,6 +124,36 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
- #if cl_khr_subgroup_clustered_reduce != 1
- #error "Incorrectly defined cl_khr_subgroup_clustered_reduce"
- #endif
-+#if __opencl_c_ext_fp16_global_atomic_load_store != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_load_store"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_load_store != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_load_store"
-+#endif
-+#if __opencl_c_ext_fp16_global_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp32_global_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_global_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp32_local_atomic_add != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_local_atomic_add"
-+#endif
-+#if __opencl_c_ext_fp16_global_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_global_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp32_global_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_global_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp16_local_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp16_local_atomic_min_max"
-+#endif
-+#if __opencl_c_ext_fp32_local_atomic_min_max != 1
-+#error "Incorrectly defined __opencl_c_ext_fp32_local_atomic_min_max"
-+#endif
-
- #else
-
-@@ -148,6 +178,48 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
- #ifdef cl_khr_subgroup_clustered_reduce
- #error "Incorrect cl_khr_subgroup_clustered_reduce define"
- #endif
-+#ifdef __opencl_c_ext_fp16_global_atomic_load_store
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_load_store defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_load_store
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_load_store defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp32_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_global_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp64_global_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp32_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_local_atomic_add
-+#error "Incorrectly __opencl_c_ext_fp64_local_atomic_add defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp16_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp32_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_global_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp64_global_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp16_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp16_local_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp32_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp32_local_atomic_min_max defined"
-+#endif
-+#ifdef __opencl_c_ext_fp64_local_atomic_min_max
-+#error "Incorrectly __opencl_c_ext_fp64_local_atomic_min_max defined"
-+#endif
-
- #endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
-
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0004-ispc-12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0004-ispc-12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch
deleted file mode 100644
index fb15d19c..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0004-ispc-12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 0c4ba4947d1630f2e13fc260399f0892b2c9b323 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 10:55:13 +0800
-Subject: [PATCH 1/2] This patch is needed for ISPC for Gen only
-
-1. Transformation of add to or is not safe for VC backend.
-2. bswap intrinsics is not supported in VC backend yet.
-
-Upstream-Status: Backport [Taken from ispc, https://github.com/ispc/ispc/blob/v1.16.1/llvm_patches/12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 10 +++++++---
- .../lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 9 ++++++---
- 2 files changed, 13 insertions(+), 6 deletions(-)
-
-diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
-index bacb8689892a..f3d0120db256 100644
---- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
-+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
-@@ -15,6 +15,7 @@
- #include "llvm/ADT/APInt.h"
- #include "llvm/ADT/STLExtras.h"
- #include "llvm/ADT/SmallVector.h"
-+#include "llvm/ADT/Triple.h"
- #include "llvm/Analysis/InstructionSimplify.h"
- #include "llvm/Analysis/ValueTracking.h"
- #include "llvm/IR/Constant.h"
-@@ -1363,9 +1364,12 @@ Instruction *InstCombinerImpl::visitAdd(BinaryOperator &I) {
- }
- }
-
-- // A+B --> A|B iff A and B have no bits set in common.
-- if (haveNoCommonBitsSet(LHS, RHS, DL, &AC, &I, &DT))
-- return BinaryOperator::CreateOr(LHS, RHS);
-+ // Disable this transformation for ISPC SPIR-V
-+ if (!Triple(I.getModule()->getTargetTriple()).isSPIR()) {
-+ // A+B --> A|B iff A and B have no bits set in common.
-+ if (haveNoCommonBitsSet(LHS, RHS, DL, &AC, &I, &DT))
-+ return BinaryOperator::CreateOr(LHS, RHS);
-+ }
-
- // add (select X 0 (sub n A)) A --> select X A n
- {
-diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
-index 68c4156af2c4..b145b863ca84 100644
---- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
-+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
-@@ -2584,9 +2584,12 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
- if (Instruction *FoldedLogic = foldBinOpIntoSelectOrPhi(I))
- return FoldedLogic;
-
-- if (Instruction *BSwap = matchBSwapOrBitReverse(I, /*MatchBSwaps*/ true,
-- /*MatchBitReversals*/ false))
-- return BSwap;
-+ // Disable this transformation for ISPC SPIR-V
-+ if (!Triple(I.getModule()->getTargetTriple()).isSPIR()) {
-+ if (Instruction *BSwap = matchBSwapOrBitReverse(I, /*MatchBSwaps*/ true,
-+ /*MatchBitReversals*/ false))
-+ return BSwap;
-+ }
-
- if (Instruction *Funnel = matchFunnelShift(I, *this))
- return Funnel;
---
-2.17.1
-
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0005-ispc-12_0_fix_for_2111.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0005-ispc-12_0_fix_for_2111.patch
deleted file mode 100644
index 4951a63d..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm12-0005-ispc-12_0_fix_for_2111.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 913e07ea5acf2148e3748b45ddfe3fac3b2d051c Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Fri, 27 Aug 2021 10:56:57 +0800
-Subject: [PATCH 2/2] This patch is a fix for #2111
-
-It ensures that shuffle is lowered for this particular case correctly.
-
-Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/9ab99f773fec7da4183495a3fdc655a797d3bea2]
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- llvm/lib/Target/X86/X86ISelLowering.cpp | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
-index 6b816c710f98..3121b0e818ac 100644
---- a/llvm/lib/Target/X86/X86ISelLowering.cpp
-+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
-@@ -43192,9 +43192,10 @@ static SDValue combineHorizOpWithShuffle(SDNode *N, SelectionDAG &DAG,
- ShuffleVectorSDNode::commuteMask(ShuffleMask1);
- }
- if ((Op00 == Op10) && (Op01 == Op11)) {
-- SmallVector<int, 4> ShuffleMask;
-- ShuffleMask.append(ShuffleMask0.begin(), ShuffleMask0.end());
-- ShuffleMask.append(ShuffleMask1.begin(), ShuffleMask1.end());
-+ const int Map[4] = {0, 2, 1, 3};
-+ SmallVector<int, 4> ShuffleMask(
-+ {Map[ShuffleMask0[0]], Map[ShuffleMask1[0]], Map[ShuffleMask0[1]],
-+ Map[ShuffleMask1[1]]});
- SDLoc DL(N);
- MVT ShufVT = VT.isFloatingPoint() ? MVT::v4f64 : MVT::v4i64;
- SDValue Res = DAG.getNode(Opcode, DL, VT, Op00, Op01);
---
-2.17.1
-
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 9701aca6..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
+++ /dev/null
@@ -1,45 +0,0 @@
-FILESEXTRAPATHS:prepend:intel-x86-common := "${THISDIR}/files:"
-
-SPIRV_SRCREV = "fe4d6b767363a1995ccbfca27f79efb10dcfe110"
-
-SRC_URI_LLVM10_PATCHES = " \
- file://llvm10-0001-llvm-spirv-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
- file://llvm10-0002-Fix-building-in-tree-with-cmake-DLLVM_LINK_LLVM_DYLI.patch;patchdir=llvm/projects/llvm-spirv \
- file://llvm10-0003-Add-support-for-cl_ext_float_atomics-in-SPIRVWriter.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-0001-OpenCL-3.0-support.patch \
- file://llvm10-0002-Add-cl_khr_extended_subgroup-extensions.patch \
- file://llvm10-0003-Memory-leak-fix-for-Managed-Static-Mutex.patch \
- file://llvm10-0004-Remove-repo-name-in-LLVM-IR.patch \
- file://llvm10-0005-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch \
- file://llvm10-0006-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch \
- file://llvm10-0007-support-cl_ext_float_atomics.patch \
- file://llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch \
- file://llvm10-0009-ispc-10_0_fix_for_1788.patch \
- file://llvm10-0010-ispc-10_0_fix_for_1793.patch \
- file://llvm10-0011-ispc-10_0_fix_for_1844.patch \
- file://llvm10-0012-ispc-10_0_i8_shuffle_avx512_i8_i16.patch \
- file://llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch \
- file://llvm10-0014-ispc-10_0_packed_load_store_avx512skx.patch \
- file://llvm10-0015-ispc-10_0_vXi1calling_avx512_i8_i16.patch \
- file://llvm10-basic-block-sections-support.patch \
- file://llvm10-Enable-the-call-site-info-only-for-g-optimizations.patch \
- file://llvm10-Replace-MCTargetOptionsCommandFlags.inc-and-CommandF.patch \
- "
-
-SRC_URI_LLVM12_PATCHES = " \
- file://llvm12-0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR-since-SPIR-d.patch \
- file://llvm12-0002-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch \
- file://llvm12-0003-Support-cl_ext_float_atomics.patch \
- file://llvm12-0004-ispc-12_0_disable-A-B-A-B-and-BSWAP-in-InstCombine.patch \
- file://llvm12-0005-ispc-12_0_fix_for_2111.patch \
- "
-
-
-SPIRV_LLVM10_SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator.git;protocol=https;branch=llvm_release_100;destsuffix=git/llvm/projects/llvm-spirv;name=spirv"
-
-SRC_URI:append:intel-x86-common = "${@bb.utils.contains('LLVMVERSION', '10.0.1', ' ${SPIRV_LLVM10_SRC_URI} ${SRC_URI_LLVM10_PATCHES} ', '', d)}"
-SRC_URI:append:intel-x86-common = "${@bb.utils.contains('LLVMVERSION', '12.0.0', ' ${SRC_URI_LLVM12_PATCHES} ', '', d)}"
-
-SRCREV_spirv = "${@bb.utils.contains_any('LLVMVERSION', [ '13.0.0', '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 456dc5cd..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,4 +1,4 @@
-From 47ae5d13ad021076f5a79f245e33bcb228b0a0da Mon Sep 17 00:00:00 2001
+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.
@@ -8,26 +8,26 @@ 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 929b981fe..57cd3d4b3 100644
+index ed85a37c52..f7c9e79137 100644
--- a/shared/source/built_ins/kernels/CMakeLists.txt
+++ b/shared/source/built_ins/kernels/CMakeLists.txt
-@@ -100,9 +100,9 @@ if(NOT NEO_DISABLE_BUILTINS_COMPILATION)
+@@ -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}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type} --revision_id ${REVISION_ID}
-+ COMMAND cpp_generate_tool --file ${BINARY_OUTPUT}.gen --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --platform ${family_name_with_type} --revision_id ${REVISION_ID}
+- 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
)
- endforeach()
- set(BUILTINS_COMMANDS ${BUILTINS_COMMANDS} PARENT_SCOPE)
-@@ -144,9 +144,9 @@ if(NOT NEO_DISABLE_BUILTINS_COMPILATION)
+ list(APPEND BUILTINS_COMMANDS "${OUTPUT_FILE_CPP}")
+ else()
+@@ -159,9 +159,9 @@ function(generate_cpp_spirv builtin)
)
add_custom_command(
OUTPUT ${OUTPUT_FILE_CPP}
@@ -37,8 +37,15 @@ index 929b981fe..57cd3d4b3 100644
- DEPENDS ${GENERATED_SPV_INPUT} $<TARGET_FILE:cpp_generate_tool>
+ DEPENDS ${GENERATED_SPV_INPUT} cpp_generate_tool
)
- endfunction()
+ 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 "")
+ )
+ endif()
+-apply_macro_for_each_core_type("SUPPORTED")
+\ No newline at end of file
++apply_macro_for_each_core_type("SUPPORTED")
--
-2.32.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.40.21182.bb b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb
index bca3c767..60125171 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_21.40.21182.bb
+++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.05.28454.6.bb
@@ -4,25 +4,25 @@ 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.md;md5=983b0c493ea3dc3c21a90ff743bf90e4 \
- file://third_party/opencl_headers/LICENSE;md5=dcefc90f4c3c689ec0c2489064e7273b"
+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=master \
- "
+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 \
+ "
-SRC_URI:append:class-target = "file://allow-to-find-cpp-generation-tool.patch"
-
-SRCREV = "3269e719a3ee7bcd97c50ec2cfe78fc8674adec0"
+SRCREV = "23a9725e62c8181193c90e5e5207507a1f136587"
S = "${WORKDIR}/git"
-DEPENDS += " intel-graphics-compiler gmmlib"
-DEPENDS:append:class-target = " intel-compute-runtime-native libva"
+DEPENDS += " intel-graphics-compiler gmmlib libva qemu-native"
RDEPENDS:${PN} += " intel-graphics-compiler gmmlib"
-inherit cmake pkgconfig
+inherit cmake pkgconfig qemu
COMPATIBLE_HOST = '(x86_64).*-linux'
COMPATIBLE_HOST:libc-musl = "null"
@@ -35,18 +35,23 @@ EXTRA_OECMAKE = " \
-DNEO_DISABLE_LD_LLD=ON \
-DNEO_DISABLE_LD_GOLD=ON \
"
-EXTRA_OECMAKE:append:class-native = " -DNEO_DISABLE_BUILTINS_COMPILATION=ON"
EXTRA_OECMAKE:append:class-target = " \
- -Dcloc_cmd_prefix=ocloc \
- "
+ -Docloc_cmd_prefix=ocloc \
+ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \
+ "
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}/
+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} += " \
@@ -56,6 +61,4 @@ FILES:${PN} += " \
FILES:${PN}-dev = "${includedir}"
-BBCLASSEXTEND = "native nativesdk"
-
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
index a6af0ef3..377081fd 100644
--- 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
@@ -1,4 +1,4 @@
-From 6f6997066040c5f33bf05ffde36a9800dcde1fcf Mon Sep 17 00:00:00 2001
+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
@@ -14,22 +14,22 @@ Upstream-Status: Inappropriate
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
- IGC/VectorCompiler/lib/BiF/CMakeLists.txt | 2 +-
+ IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
-index 5d9a901d7..66e59e399 100644
---- a/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
-+++ b/IGC/VectorCompiler/lib/BiF/CMakeLists.txt
-@@ -88,7 +88,7 @@ function(vc_embed_bif RES_FILE CMCL_SRC_PATH BIF_NAME PTR_BIT_SIZE)
- add_custom_command(OUTPUT ${BIF_OPT_BC_PATH}
- COMMAND ${LLVM_OPT_EXE} --O2 -o ${BIF_OPT_BC_NAME} ${BIF_CMCL_BC_NAME}
- COMMENT "vc_embed_bif: running opt with O2: ${BIF_CMCL_BC_NAME} -> ${BIF_OPT_BC_NAME}"
-- DEPENDS opt ${BIF_CMCL_BC_PATH})
-+ DEPENDS ${BIF_CMCL_BC_PATH})
- add_custom_command(
- OUTPUT ${BIF_CPP_PATH}
- COMMAND ${PYTHON_EXECUTABLE} ${RESOURCE_EMBEDDER_SCRIPT} ${BIF_OPT_BC_NAME} ${BIF_CPP_NAME}
+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.32.0
+2.43.2
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-llvm_deps.cmake-don-t-copy-header-file-when-building.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-llvm_deps.cmake-don-t-copy-header-file-when-building.patch
deleted file mode 100644
index d62f47ca..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-llvm_deps.cmake-don-t-copy-header-file-when-building.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 3d99559779d628704568879a2ee51e968e66d005 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Tue, 5 Oct 2021 00:11:26 +0800
-Subject: [PATCH] llvm_deps.cmake: don't copy header file when building
-
-We build in pre-built mode and this header shouldn't be copied in
-that case.
-
-Upstream-Status: Pending
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- external/llvm/llvm_deps.cmake | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/external/llvm/llvm_deps.cmake b/external/llvm/llvm_deps.cmake
-index 425d3766f..e43804f77 100644
---- a/external/llvm/llvm_deps.cmake
-+++ b/external/llvm/llvm_deps.cmake
-@@ -46,9 +46,9 @@ if(IGC_OPTION__LLVM_LLD)
- include(llvm_lld_source_hook)
- if(NOT EXISTS "${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o" AND ${IGC_OPTION__LLVM_PREFERRED_VERSION} GREATER_EQUAL "12.0.0")
- # Need to copy one header from unwind package for LLD (only for building from sources)
-- file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
-- file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
-- DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
-+ #file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
-+ #file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
-+ # DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
- endif()
- endif()
-
---
-2.32.0
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch
index 7dd36aec..650130a8 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch
+++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch
@@ -1,7 +1,7 @@
-From c2b7f30dd56568482b1b7c2f22bafdf68736fc88 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 3/5] Improve Reproducibility for src package
+Subject: [PATCH] Improve Reproducibility for src package
Improve reproducibility for intel-graphics-compiler-src package.
needs to pass build path as environment variable to the build.
@@ -9,12 +9,13 @@ 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 65dbb4934..8cd607a69 100644
+index 6be467587..930c386a6 100644
--- a/visa/CMakeLists.txt
+++ b/visa/CMakeLists.txt
@@ -123,8 +123,11 @@ endif()
@@ -31,6 +32,3 @@ index 65dbb4934..8cd607a69 100644
ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser)
set(CISAScanner_dependencies)
---
-2.20.1
-
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0004-find-external-llvm-tblgen.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0004-find-external-llvm-tblgen.patch
deleted file mode 100644
index 79f79976..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0004-find-external-llvm-tblgen.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From c9fe51ec555fadd098cfc98804ce91b1cf3029d4 Mon Sep 17 00:00:00 2001
-From: Dongwon Kim <dongwon.kim@intel.com>
-Date: Thu, 19 Aug 2021 08:28:03 -0700
-Subject: [PATCH 4/5] find external llvm-tblgen
-
-Upstream-Status: Pending
-Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
----
- IGC/cmake/igc_llvm.cmake | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/IGC/cmake/igc_llvm.cmake b/IGC/cmake/igc_llvm.cmake
-index 541793f21..bc82922b1 100644
---- a/IGC/cmake/igc_llvm.cmake
-+++ b/IGC/cmake/igc_llvm.cmake
-@@ -24,7 +24,10 @@ set(CMAKE_MODULE_PATH
- ${CMAKE_MODULE_PATH}
- )
-
--set(LLVM_TABLEGEN_EXE "llvm-tblgen")
-+find_program(LLVM_TABLEGEN_EXE "llvm-tblgen")
-+if(LLVM_TABLEGEN_EXE-NOTFOUND)
-+ message(FATAL_ERROR "[VC] llvm-tblgen is not found")
-+endif()
-
- include(AddLLVM)
- include(TableGen)
---
-2.20.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.8744.bb b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
deleted file mode 100644
index 8a09934d..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.8744.bb
+++ /dev/null
@@ -1,63 +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=4a985f2545dd5a846e205b1e60a51cd9 \
- file://NOTICES.txt;md5=db621145dfb627436bc90ad600386801"
-
-SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https;name=igc;branch=master \
- git://github.com/intel/vc-intrinsics.git;protocol=https;destsuffix=git/vc-intrinsics;name=vc;branch=master \
- file://0001-llvm_deps.cmake-don-t-copy-header-file-when-building.patch \
- file://0003-Improve-Reproducibility-for-src-package.patch \
- file://0004-find-external-llvm-tblgen.patch \
- file://0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch \
- "
-
-SRCREV_igc = "3ba8dde8c414a0e47df58b1bba12a64f8ba2089e"
-SRCREV_vc = "e5ad7e02aa4aa21a3cd7b3e5d1f3ec9b95f58872"
-
-# Used to replace with relative path in reproducibility patch
-export B
-
-S = "${WORKDIR}/git"
-
-inherit cmake pkgconfig
-
-CXXFLAGS:append = " -Wno-error=nonnull"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST:libc-musl = "null"
-
-DEPENDS += " flex-native bison-native clang opencl-clang"
-DEPENDS:append:class-target = " clang-cross-x86_64 intel-graphics-compiler-native"
-
-RDEPENDS:${PN} += "opencl-clang"
-
-PACKAGECONFIG ??= "vc"
-PACKAGECONFIG[vc] = "-DIGC_BUILD__VC_ENABLED=ON -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR=ON -DIGC_OPTION__USE_KHRONOS_SPIRV_TRANSLATOR_IN_VC=ON -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Prebuilds,-DIGC_BUILD__VC_ENABLED=OFF,"
-
-EXTRA_OECMAKE = " \
- -DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} \
- -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
- -DVC_INTRINSICS_SRC="${S}/vc-intrinsics" \
- -DIGC_OPTION__LLVM_MODE=Prebuilds \
- "
-
-do_install:append:class-native () {
- install -d ${D}${bindir}
- install ${B}/IGC/Release/elf_packager ${D}${bindir}/
- if ${@bb.utils.contains('PACKAGECONFIG', 'vc', 'true', 'false', d)}; then
- install ${B}/IGC/Release/CMCLTranslatorTool ${D}${bindir}/
- fi
-}
-
-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.inc b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
index 1d9b4d51..31a3fb21 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
@@ -6,6 +6,8 @@ LICENSE = "NCSA"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
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 \
"
S = "${WORKDIR}/git"
@@ -16,9 +18,17 @@ DEPENDS:append:class-target = " opencl-clang-native"
COMPATIBLE_HOST = '(x86_64).*-linux'
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=${LLVMVERSION} \
+ "
+
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 e08f2278..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require opencl-clang.inc
-
-SRC_URI:append = " 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"
-
-BRANCH = "ocl-open-100"
-
-SRCREV = "c8cd72e32b6abc18ce6da71c357ea45ba78b52f0"
-
-EXTRA_OECMAKE += "\
- -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
- -DCMAKE_SKIP_RPATH=TRUE \
- "
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 d0b2acfb..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-require opencl-clang.inc
-
-SRCREV = "8fc6b059248dc6c9c40c7cbe5fedcc6ebb951983"
-
-DEPENDS += " spirv-llvm-translator"
-
-BRANCH = "ocl-open-120"
-
-EXTRA_OECMAKE += "\
- -DCMAKE_SKIP_RPATH=TRUE \
- -DPREFERRED_LLVM_VERSION="12.0.0" \
- "
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_13.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_13.0.0.bb
deleted file mode 100644
index 7ca7895e..00000000
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_13.0.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require opencl-clang.inc
-
-SRC_URI:append = " file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
- "
-SRCREV = "0f36f940b25b8e7661cfaf8a7c11fdbb7d853223"
-
-BRANCH = "ocl-open-130"
-
-DEPENDS += " spirv-llvm-translator"
-
-EXTRA_OECMAKE += "\
- -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
- -DCMAKE_SKIP_RPATH=TRUE \
- -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \
- "
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 d98a9ddf..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://Readme.md;beginline=1;endline=7;md5=3b2db19c3b0877bb312b7adbcb815adc"
-
-SRC_URI = "git://github.com/intel/vc-intrinsics.git;protocol=https;;branch=master \
- "
-SRCREV = "a2f2f10dc61c8161c57cf33ed606c8e3ccf3a921"
-
-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.4.2.bb b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.0.0.bb
index 1115f4c0..70177c28 100644
--- a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2021.4.2.bb
+++ b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.0.0.bb
@@ -5,33 +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/4;lfs=0 \
+SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=releases/2024/0;lfs=0 \
"
-SRCREV = "6c4462759e8974c0ce5b36ad22972a1c6ded76a8"
+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
+
+SETUPTOOLS_SETUP_PATH = "${WORKDIR}/git/tools/mo"
RDEPENDS:${PN} += " \
- python3-numpy \
- python3-protobuf \
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+)+))"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$"
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2141.0.0.0.bb b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb
index c403ab66..bdf32576 100644
--- a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2141.0.0.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb
@@ -10,11 +10,9 @@ COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
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 pkgconfig-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"
@@ -31,9 +29,10 @@ SYSTEMD_SERVICE:${PN} = "lms.service"
SRC_URI = "git://github.com/intel/lms.git;branch=master;protocol=https \
"
-SRCREV = "8cb5489623025d80b56acd79d9c8ddadf9b29e97"
+SRCREV = "388f115b2aeb3ea11499971c65f828daefd32c47"
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
@@ -42,5 +41,4 @@ do_install:append() {
RDEPENDS:${PN} += "ace"
-# This CVE is for Lan Management System software and not this lms.
-CVE_CHECK_WHITELIST += "CVE-2018-1000535"
+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.6.bb b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.6.bb
index 813591fb..df242cdf 100644
--- a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.4.6.bb
+++ b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.6.bb
@@ -7,13 +7,16 @@ 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/;branch=master;protocol=https \
+ file://0001-Makefile-Fix-build-Issue.patch \
"
-SRCREV = "dddba484b23562d421cdaf1703dabc602e1968e7"
+SRCREV = "3990ce2391e5c07293758c056e09e4f2453691b4"
S = "${WORKDIR}/git"
inherit pkgconfig autotools systemd gtk-doc
@@ -28,7 +31,7 @@ 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"
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/clang-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
index 5f3c7d0b..f452dc50 100644
--- a/dynamic-layers/clang-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
@@ -1,6 +1,6 @@
-From 3f3f81bde7d9d80921515ed0bf7fe36e69319bc4 Mon Sep 17 00:00:00 2001
+From 16a2c22339287122d2c25d8bb33a5a51b4e6ee51 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 30 Jun 2021 13:47:41 +0800
+Date: Thu, 24 Feb 2022 20:01:11 +0530
Subject: [PATCH] cmake: don't build for 32-bit targets
Error log:
@@ -16,14 +16,14 @@ Upstream-Status: Inappropriate
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
- cmake/GenerateBuiltins.cmake | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ cmake/GenerateBuiltins.cmake | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake
-index 15a74788..db30f809 100644
+index f84494ed..d90cb1ec 100644
--- a/cmake/GenerateBuiltins.cmake
+++ b/cmake/GenerateBuiltins.cmake
-@@ -249,7 +249,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi
+@@ -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.
@@ -32,7 +32,7 @@ index 15a74788..db30f809 100644
endif()
endif()
-@@ -331,7 +331,7 @@ function (generate_target_builtins resultList)
+@@ -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})
@@ -41,24 +41,12 @@ index 15a74788..db30f809 100644
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}})
-@@ -392,7 +392,7 @@ function (generate_common_builtins resultList)
+@@ -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" "wasm32")
+ foreach (arch "x86" "arm" "wasm")
builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch})
-@@ -405,7 +405,7 @@ function (generate_common_builtins resultList)
- endforeach()
- endforeach()
- if (GENX_ENABLED)
-- foreach (bit 32 64)
-+ foreach (bit 64)
- builtin_genx_to_cpp(${bit} res_genx_${bit})
- list(APPEND tmpList ${res_genx_${bit}} )
- if(MSVC)
---
-2.17.1
-
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.6.2.bb b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb
index 5580f838..8bade9f4 100644
--- a/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.6.2.bb
+++ b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb
@@ -1,31 +1,10 @@
-# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
-# The following is the difference between the old and the new license text.
-# Please update the LICENSE value if needed, and summarize the changes in
-# the commit message via 'License-Update:' tag.
-# (example: 'License-Update: copyright years updated.')
-#
-# The changes:
-#
-# --- LICENSE
-# +++ LICENSE
-# @@ -1,6 +1,6 @@
-# MIT License
-#
-# -Copyright (c) 2019 Intel Corporation
-# +Copyright (C) 2019-2021 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
-#
-#
-
SUMMARY = "oneAPI Level Zero Specification Headers and Loader"
HOMEPAGE = "https://github.com/oneapi-src/level-zero"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=97957beb2f7808ffa247e5d93e6442cc"
SRC_URI = "git://github.com/oneapi-src/level-zero.git;protocol=https;branch=master"
-SRCREV = "7afa8a6dda56d4baef950c0a9d5ef8d8b0e14c4e"
+SRCREV = "1685d01497428ca4d8b99200972b64685424d5c9"
S = "${WORKDIR}/git"
inherit cmake
@@ -51,3 +30,4 @@ FILES:${PN}-loader = "${libdir}"
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/compiler/intel-oneapi-compiler_2021.4.0-3561.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/compiler/intel-oneapi-compiler_2021.4.0-3561.bb
deleted file mode 100644
index a1080dbd..00000000
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/compiler/intel-oneapi-compiler_2021.4.0-3561.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "Intel® oneAPI DPC++/C++ Compiler & Intel® C++ Compiler Classic runtime common files"
-DESCRIPTION = "Intel® C++ Compiler Classic generates applications\
- that can run on Intel® 64 architecture and the IA-32 architecture.\
- Intel® oneAPI Data Parallel C++ (DPC++) is an open alternative \
- to single-architecture proprietary languages. It allows developers to reuse \
- code across hardware targets (CPUs and accelerators such as GPUs and FPGAs) \
- and also perform custom tuning for a specific accelerator."
-HOMEPAGE = "https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/introducing-the-intel-c-compiler-classic.html"
-
-LICENSE="EULA"
-
-LIC_FILES_CHKSUM = " \
- file://opt/intel/oneapi/lib/licensing/compiler/Intel%20Developer%20Tools%20EULA;md5=504ce70b21e83ed3eadf647715fe8693 \
- file://opt/intel/oneapi/lib/licensing/compiler/openmp/third-party-programs.txt;md5=da72b17a4a1efef54faf14df4a703282 \
- file://opt/intel/oneapi/lib/licensing/compiler/c/third-party-programs.txt;md5=e68c504274cfdae7628970517223a823 \
- "
-
-SRC_URI = " \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-compilers-${PV}_amd64.deb;subdir=${BPN};name=runtime-compilers \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-compilers-common-${PV}_all.deb;subdir=${BPN};name=common-compilers \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-dpcpp-cpp-${PV}_amd64.deb;subdir=${BPN};name=runtime-dpcpp-cpp \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-dpcpp-cpp-common-${PV}_all.deb;subdir=${BPN};name=common-dpcpp-cpp \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-openmp-${PV}_amd64.deb;subdir=${BPN};name=runtime-openmp \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-openmp-common-${PV}_all.deb;subdir=${BPN};name=common-openmp \
- "
-
-SRC_URI[runtime-compilers.sha256sum] = "37ee9277b8b7b5486ec2a44cb66575b94dcc2b927f1825f88cdf2c1de54de656"
-SRC_URI[common-compilers.sha256sum] = "9d446a793e2a3b5749c949b8985c6cc05125df107458cd9640e39e32650f9365"
-SRC_URI[runtime-dpcpp-cpp.sha256sum] = "894c9d0efe069a2a2757338ce6b005f560e34319d3f6321f794733937f85718b"
-SRC_URI[common-dpcpp-cpp.sha256sum] = "ff8303b4b4da9f03302cef00fb275c875a3876f34c242813707d461ad4c9628d"
-SRC_URI[runtime-openmp.sha256sum] = "65dca00697b93a31df401de73ad38e2e65d8bcc662b2d2a8ad561551fbde0620"
-SRC_URI[common-openmp.sha256sum] = "53a59a72051760bcf04186beaa17656082eacec2ecaee86bfde7f6e7560457bf"
-
-S = "${WORKDIR}/${BPN}"
-
-inherit bin_package update-alternatives
-
-ALTERNATIVE:${PN} = "Intel_FPGA_SSG_Emulator.icd"
-ALTERNATIVE_LINK_NAME[Intel_FPGA_SSG_Emulator.icd] = "/etc/OpenCL/vendors/intel64-fpgaemu.icd"
-ALTERNATIVE_TARGET[Intel_FPGA_SSG_Emulator.icd] = "/opt/intel/oneapi/lib/etc/Intel_FPGA_SSG_Emulator.icd"
-ALTERNATIVE_PRIORITY[Intel_FPGA_SSG_Emulator.icd] = "328736233"
-
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-RDEPENDS:${PN} += "perl elfutils opencl-icd-loader level-zero-loader zlib tbb libelf setup-intel-oneapi-env"
-INSANE_SKIP:${PN} += "textrel dev-so"
-
-# The libomptarget.rtl.x86_64.so library is not supported on Yocto 3.1+ due to using obsolete libffi.so.6
-do_install:append () {
- rm -f ${D}/opt/intel/oneapi/lib/libomptarget.rtl.x86_64.so
- echo "/opt/intel/oneapi/lib/emu/libintelocl_emu.so" > ${D}/opt/intel/oneapi/lib/etc/Intel_FPGA_SSG_Emulator.icd
-}
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_3.13.2.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb
index 42acbeb8..fb341b01 100644
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_3.13.2.bb
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb
@@ -6,25 +6,25 @@ 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=86f6028ba2138fe41ac5c121d0a3518e \
+ 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 = "d7157470e089098b9c7323f608835ed50453e606"
+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_ISPC_SUPPORT=OFF \
-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/ipp/intel-oneapi-ipp_2021.4.0-459.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.4.0-459.bb
deleted file mode 100644
index db2684e1..00000000
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.4.0-459.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-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"
-
-LIC_FILES_CHKSUM = " \
- file://opt/intel/oneapi/lib/licensing/ipp/license.txt;md5=4867389dfbeb11811d66cdcbcc8712a6 \
- file://opt/intel/oneapi/lib/licensing/ipp/third-party-programs.txt;md5=6cd9ad51f3b5cdfd4a355fa5599a6c03 \
- "
-
-SRC_URI = " \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-ipp-${PV}_amd64.deb;subdir=${BPN};name=runtime \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-ipp-common-${PV}_all.deb;subdir=${BPN};name=common \
- "
-
-SRC_URI[runtime.sha256sum] = "f983271c26792ea0cecdb294aebdb4619e630496643af32086597be782df85a3"
-SRC_URI[common.sha256sum] = "46808f3e3eb2bb9d9b4169cd00be319b246f0ab2ba590925e776ef45d37d617f"
-
-S = "${WORKDIR}/${BPN}"
-
-COMPATIBLE_HOST:libc-musl = "null"
-
-inherit bin_package
-
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-RDEPENDS:${PN} += "tbb setup-intel-oneapi-env"
-INSANE_SKIP:${PN} += "ldflags dev-so"
-
-# Some libraries are linking against the unversioned lib and there's no soname entry.
-# Workaround errors like:
-# Problem: conflicting requests
-# - nothing provides libippcore_tl_omp.so()(64bit) needed by intel-oneapi-ipp-2021.3.0+333-r0.skylake_64
-do_install:append () {
- install -m 755 ${D}/opt/intel/oneapi/lib/intel64/libippcore_tl_omp.so.10.3 ${D}/opt/intel/oneapi/lib/intel64/libippcore_tl_omp.so
- install -m 755 ${D}/opt/intel/oneapi/lib/intel64/libippcore_tl_tbb.so.10.3 ${D}/opt/intel/oneapi/lib/intel64/libippcore_tl_tbb.so
- install -m 755 ${D}/opt/intel/oneapi/lib/intel64/libippi_tl_omp.so.10.3 ${D}/opt/intel/oneapi/lib/intel64/libippi_tl_omp.so
- install -m 755 ${D}/opt/intel/oneapi/lib/intel64/libippi_tl_tbb.so.10.3 ${D}/opt/intel/oneapi/lib/intel64/libippi_tl_tbb.so
-}
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2021.4.0-640.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2021.4.0-640.bb
deleted file mode 100644
index add4c806..00000000
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2021.4.0-640.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-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"
-
-LIC_FILES_CHKSUM = " \
- file://opt/intel/oneapi/lib/licensing/mkl/license.txt;md5=4867389dfbeb11811d66cdcbcc8712a6 \
- file://opt/intel/oneapi/lib/licensing/mkl/third-party-programs-benchmarks.txt;md5=cb98e1a1f14c05ea85a979ea8982e7a4 \
- file://opt/intel/oneapi/lib/licensing/mkl/third-party-programs-ipp.txt;md5=a4b2bf15e38f5c1267cdafed18bc0b09 \
- file://opt/intel/oneapi/lib/licensing/mkl/third-party-programs-openmp.txt;md5=6b3c1aa2a11393060074c0346ce21e49 \
- file://opt/intel/oneapi/lib/licensing/mkl/third-party-programs-safestring.txt;md5=c3aeee91c6d35a0f0753aed6c2633b82 \
- file://opt/intel/oneapi/lib/licensing/mkl/third-party-programs.txt;md5=980965cf1f086d40998ca4981968b6a4 \
- "
-
-SRC_URI = " \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-${PV}_amd64.deb;subdir=${BPN};name=runtime \
- https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-common-${PV}_all.deb;subdir=${BPN};name=common \
- "
-
-SRC_URI[runtime.sha256sum] = "0ff97d07e6db5d55edf9a744b0b0ee0ea75866e80ab5510f596c57d5535c20d4"
-SRC_URI[common.sha256sum] = "70ecfe07b2f888f66938a0e207aa8cb0637eb8d4deb659f6f6d924b8ee70a76e"
-
-S = "${WORKDIR}/${BPN}"
-
-inherit bin_package
-
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-RDEPENDS:${PN} += "tbb intel-oneapi-compiler setup-intel-oneapi-env"
-INSANE_SKIP:${PN} = "ldflags textrel 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_1.4.1.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb
index 24ead8c6..4ea6ffbe 100644
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_1.4.1.bb
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb
@@ -7,13 +7,14 @@ HOMEPAGE = "https://www.openimagedenoise.org/"
LICENSE = "Apache-2.0 & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
- file://mkl-dnn/LICENSE;md5=3c6ff4426dbd618bcfd552ac4a7c1c56 \
- file://mkl-dnn/src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \
- file://mkl-dnn/src/cpu/x64/jit_utils/jitprofiling/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \
+ 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] = "9088966685a78adf24b8de075d66e4c0019bd7b2b9d29c6e45aaf35d294e3f6f"
+SRC_URI = "https://github.com/OpenImageDenoise/${BPN}/releases/download/v${PV}/${BP}.src.tar.gz\
+ "
+SRC_URI[sha256sum] = "ce144ba582ff36563d9442ee07fa2a4d249bc85aa93e5b25fc527ff4ee755ed6"
inherit cmake
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_1.1.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb
index 30ae4f48..a2d709a1 100644
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_1.1.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb
@@ -20,15 +20,22 @@ S = "${WORKDIR}/git"
SRC_URI = "git://github.com/openvkl/openvkl.git;protocol=https;branch=master \
"
-SRCREV = "b2cfd8ab94420489e2ed9a25fb0d512c2577e5de"
+SRCREV = "8c6ba526813b871a624cb9d73d4cbb689ac7f4ce"
COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
-DEPENDS = "ispc-native rkcommon embree"
+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_2.8.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb
index b6b789c2..3e03dcc2 100644
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_2.8.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb
@@ -6,7 +6,8 @@ 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=d0b3d9b55b2ccd6a3bffc374cf2d5563"
+ file://third-party-programs.txt;md5=e37b77e3bd997abccc359c710fb1f1db \
+ "
inherit pkgconfig cmake
@@ -14,16 +15,18 @@ S = "${WORKDIR}/git"
SRC_URI = "git://github.com/ospray/ospray.git;protocol=https;branch=master \
"
-SRCREV = "fe4b3806f8626b22defbeda172609aa7c8c74a2e"
+SRCREV = "f2a61c2eb58ccd666e34abfdb0fd7049ea073194"
COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST:libc-musl = "null"
-DEPENDS = "rkcommon ispc-native openvkl embree"
+DEPENDS = "rkcommon ispc ispc-native openvkl embree"
EXTRA_OECMAKE += " \
-DISPC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/ispc \
- -DOSPRAY_APPS_BENCHMARK=OFF \
- -DOSPRAY_APPS_TESTING=OFF \
+ -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF \
+ -DOSPRAY_ENABLE_APPS_TESTING=OFF \
+ -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF \
"
PACKAGES =+ "${PN}-apps"
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.8.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb
index 3c15527c..fe6b23ea 100644
--- a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.8.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb
@@ -12,7 +12,7 @@ S = "${WORKDIR}/git"
SRC_URI = "git://github.com/ospray/rkcommon.git;protocol=https;branch=master \
"
-SRCREV = "27a18810ab7a8832a75bb136ade3ea9c32583e16"
+SRCREV = "7ebfa0765ea590767202b328e7da38102c2f5a15"
DEPENDS = "tbb"
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_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch
index 7fede93c..11305e83 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch
+++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch
@@ -1,48 +1,50 @@
-
+Subject: [PATCH] [PATCH]: ignore static asserts and null define for os and ut
+ builds
Upstream-Status: Backport
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-
+Signed-off-by: Teoh Suh Haw <suh.haw.teoh@intel.com>
+---
MdePkg/Include/Base.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
-index 2da08b0c78..072eefdb94 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
-@@ -810,6 +814,8 @@ typedef UINTN *BASE_LIST;
+@@ -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");
-@@ -823,6 +829,8 @@ STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specifi
+@@ -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
-@@ -843,9 +851,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");
@@ -50,8 +52,8 @@ index 2da08b0c78..072eefdb94 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.31.0.windows.1
+--
+2.37.3
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0387.bb b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb
index 0ab2f231..c4743d1c 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0387.bb
+++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb
@@ -15,14 +15,16 @@ LICENSE = "BSD-3-Clause | BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=72b9da60da6219d612ce30b746a0fe71 \
file://edk2/License.txt;md5=6123e5bf044a66db96c4ce88a36b2d08"
-SRC_URI = "git://github.com/intel/ipmctl.git;protocol=https;branch=development;name=ipmctl; \
+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 = "3cbc9f7f231f6f03895e0ff8ab797d22075e09b7"
-#tag: edk2-stable202108
-SRCREV_edk2 = "7b4a99be8a39c12d3a7fc4b8db9f0eab4ac688d5"
+SRCREV_ipmctl = "c75bd840ea7820c8f93a5488fcff75d08beedd51"
+#tag edk2-stable202302
+SRCREV_edk2 = "f80f052277c88a67c55e107b550f504eeea947d3"
+SRCREV_FORMAT = "ipmctl_edk2"
S = "${WORKDIR}/git"
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 3c265652..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-dont-install-licenses-and-version-file.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 419070322898381885b0ffa286905a3b08a23aa6 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 | 8 ++------
- ngraph/test/runtime/CMakeLists.txt | 2 ++
- 2 files changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt
-index a05ca3b15c..9bc507b4c7 100644
---- a/ngraph/CMakeLists.txt
-+++ b/ngraph/CMakeLists.txt
-@@ -272,7 +272,7 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE)
- install(EXPORT ngraphTargets
- FILE ngraphTargets.cmake
- NAMESPACE ngraph::
-- DESTINATION "deployment_tools/ngraph/cmake"
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph
- COMPONENT ngraph_dev)
- endif()
-
-@@ -286,7 +286,7 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE)
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake
-- DESTINATION "deployment_tools/ngraph/cmake"
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph
- COMPONENT ngraph_dev)
- endif()
-
-@@ -337,7 +337,3 @@ add_subdirectory(test)
- if (NGRAPH_PYTHON_BUILD_ENABLE)
- add_subdirectory(python)
- endif()
--
--install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
-- DESTINATION "deployment_tools/ngraph"
-- COMPONENT ngraph)
-diff --git a/ngraph/test/runtime/CMakeLists.txt b/ngraph/test/runtime/CMakeLists.txt
-index be84499ee0..f65357b751 100644
---- a/ngraph/test/runtime/CMakeLists.txt
-+++ b/ngraph/test/runtime/CMakeLists.txt
-@@ -66,3 +66,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.32.0
-
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 b16135ee..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-inference-engine-use-system-installed-packages.patch
+++ /dev/null
@@ -1,333 +0,0 @@
-From 47ff7f056d219a8a9f02a8b533e1d32972b84589 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Thu, 8 Apr 2021 14:19:51 +0800
-Subject: [PATCH] inference-engine: use system installed packages
-
-Use installed versions of ade, protobuf, zlib and tbb.
-
-Don't fetch pybind11 at runtime and use the one that we have fetched while
-running do_fetch.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- cmake/dependencies.cmake | 19 --------
- inference-engine/CMakeLists.txt | 6 +--
- inference-engine/cmake/dependencies.cmake | 45 -------------------
- inference-engine/cmake/ie_parallel.cmake | 2 +-
- .../templates/InferenceEngineConfig.cmake.in | 10 -----
- inference-engine/samples/CMakeLists.txt | 3 +-
- .../src/inference_engine/CMakeLists.txt | 4 +-
- .../common_test_utils/CMakeLists.txt | 4 +-
- .../unit_test_utils/CMakeLists.txt | 3 +-
- inference-engine/thirdparty/CMakeLists.txt | 5 +--
- ngraph/python/CMakeLists.txt | 12 +----
- tests/fuzz/src/CMakeLists.txt | 1 -
- thirdparty/CMakeLists.txt | 1 -
- thirdparty/cnpy/CMakeLists.txt | 4 +-
- 14 files changed, 14 insertions(+), 105 deletions(-)
-
-diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
-index 6cb15a077e..74d4ac4124 100644
---- a/cmake/dependencies.cmake
-+++ b/cmake/dependencies.cmake
-@@ -7,23 +7,4 @@ set_temp_directory(TEMP "${IE_MAIN_SOURCE_DIR}")
- if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
- set(protoc_version "3.7.1")
-
-- RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
-- ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
-- TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64"
-- SHA256 "a1bedd5c05ca51e49f8f254faa3d7331e05b3a806c151fb111d582f154d0fee8"
-- )
-- debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
--
-- reset_deps_cache(SYSTEM_PROTOC)
--
-- 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 1ac7fd8bf6..0615873110 100644
---- a/inference-engine/CMakeLists.txt
-+++ b/inference-engine/CMakeLists.txt
-@@ -18,7 +18,7 @@ function(ie_developer_export_targets)
- endfunction()
-
- function(ie_developer_export)
-- set(all_dev_targets gflags ie_libraries)
-+ set(all_dev_targets ie_libraries)
- foreach(component IN LISTS openvino_export_components)
- export(TARGETS ${${component}} NAMESPACE IE::
- APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
-@@ -142,7 +142,7 @@ endif()
- # Developer package
- #
-
--openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader gflags ie_samples_utils)
-+openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)
-
- # for Template plugin
- if(NGRAPH_INTERPRETER_ENABLE)
-@@ -158,7 +158,7 @@ function(ie_generate_dev_package_config)
- configure_package_config_file("${InferenceEngine_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
- "${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake"
- INSTALL_DESTINATION share # not used
-- PATH_VARS "OpenVINO_MAIN_SOURCE_DIR;IE_MAIN_SOURCE_DIR;gflags_BINARY_DIR"
-+ PATH_VARS "OpenVINO_MAIN_SOURCE_DIR;IE_MAIN_SOURCE_DIR"
- NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-
- configure_file("${IE_MAIN_SOURCE_DIR}/cmake/templates/InferenceEngineConfig-version.cmake.in"
-diff --git a/inference-engine/cmake/dependencies.cmake b/inference-engine/cmake/dependencies.cmake
-index b270c46f2d..5f85197a85 100644
---- a/inference-engine/cmake/dependencies.cmake
-+++ b/inference-engine/cmake/dependencies.cmake
-@@ -81,51 +81,6 @@ endif ()
- if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
- reset_deps_cache(TBBROOT TBB_DIR)
-
-- if (WIN32 AND X86_64)
-- #TODO: add target_path to be platform specific as well, to avoid following if
-- RESOLVE_DEPENDENCY(TBB
-- ARCHIVE_WIN "tbb2020_20200415_win.zip"
-- TARGET_PATH "${TEMP}/tbb"
-- ENVIRONMENT "TBBROOT"
-- SHA256 "f1c9b9e2861efdaa01552bd25312ccbc5feeb45551e5f91ae61e29221c5c1479")
-- RESOLVE_DEPENDENCY(TBBBIND_2_4
-- ARCHIVE_WIN "tbbbind_2_4_static_win_v2.zip"
-- TARGET_PATH "${TEMP}/tbbbind_2_4"
-- ENVIRONMENT "TBBBIND_2_4_ROOT"
-- SHA256 "90dc165652f6ac2ed3014c71e57f797fcc4b11e1498a468e3d2c85deb2a4186a")
-- elseif(ANDROID) # Should be before LINUX due LINUX is detected as well
-- RESOLVE_DEPENDENCY(TBB
-- ARCHIVE_ANDROID "tbb2020_20200404_android.tgz"
-- TARGET_PATH "${TEMP}/tbb"
-- ENVIRONMENT "TBBROOT"
-- SHA256 "f42d084224cc2d643314bd483ad180b081774608844000f132859fca3e9bf0ce")
-- elseif(LINUX AND X86_64)
-- RESOLVE_DEPENDENCY(TBB
-- ARCHIVE_LIN "tbb2020_20200415_lin_strip.tgz"
-- TARGET_PATH "${TEMP}/tbb"
-- ENVIRONMENT "TBBROOT"
-- SHA256 "95b2f3b0b70c7376a0c7de351a355c2c514b42c4966e77e3e34271a599501008")
-- RESOLVE_DEPENDENCY(TBBBIND_2_4
-- ARCHIVE_LIN "tbbbind_2_4_static_lin_v2.tgz"
-- TARGET_PATH "${TEMP}/tbbbind_2_4"
-- ENVIRONMENT "TBBBIND_2_4_ROOT"
-- SHA256 "6dc926258c6cd3cba0f5c2cc672fd2ad599a1650fe95ab11122e8f361a726cb6")
-- elseif(LINUX AND AARCH64)
-- RESOLVE_DEPENDENCY(TBB
-- ARCHIVE_LIN "keembay/tbb2020_38404_kmb_lic.tgz"
-- TARGET_PATH "${TEMP}/tbb_yocto"
-- ENVIRONMENT "TBBROOT"
-- SHA256 "321261ff2eda6d4568a473cb883262bce77a93dac599f7bd65d2918bdee4d75b")
-- elseif(APPLE AND X86_64)
-- RESOLVE_DEPENDENCY(TBB
-- ARCHIVE_MAC "tbb2020_20200404_mac.tgz"
-- TARGET_PATH "${TEMP}/tbb"
-- ENVIRONMENT "TBBROOT"
-- SHA256 "ad9cf52e657660058aa6c6844914bc0fc66241fec89a392d8b79a7ff69c3c7f6")
-- else()
-- message(FATAL_ERROR "TBB is not available on current platform")
-- endif()
--
- update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
- update_deps_cache(TBB_DIR "${TBB}/cmake" "Path to TBB cmake folder")
-
-diff --git a/inference-engine/cmake/ie_parallel.cmake b/inference-engine/cmake/ie_parallel.cmake
-index edf3d2f2b2..6579d0f7ea 100644
---- a/inference-engine/cmake/ie_parallel.cmake
-+++ b/inference-engine/cmake/ie_parallel.cmake
-@@ -26,7 +26,7 @@ function(set_ie_threading_interface_for TARGET_NAME)
- find_dependency(TBB COMPONENTS tbb tbbmalloc)
- endif()
- set(TBB_FOUND ${TBB_FOUND} PARENT_SCOPE)
-- set(TBB_IMPORTED_TARGETS ${TBB_IMPORTED_TARGETS} PARENT_SCOPE)
-+ set(TBB_IMPORTED_TARGETS "tbb;tbbmalloc" PARENT_SCOPE)
- set(TBB_VERSION ${TBB_VERSION} PARENT_SCOPE)
- if (NOT TBB_FOUND)
- ext_message(WARNING "TBB was not found by the configured TBB_DIR/TBBROOT path.\
-diff --git a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
-index 261edbf3d7..bf217a789a 100644
---- a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
-+++ b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in
-@@ -86,16 +86,6 @@ endfunction()
- set(IE_PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
-
- set(THREADING "@THREADING@")
--if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT TBB_FOUND)
-- set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
-- _ie_find_dependency(TBB
-- COMPONENTS tbb tbbmalloc
-- CONFIG
-- PATHS ${TBBROOT}/cmake
-- ${_tbb_dir}
-- NO_CMAKE_FIND_ROOT_PATH
-- NO_DEFAULT_PATH)
--endif()
-
- set_and_check(_ngraph_dir "@PACKAGE_IE_NGRAPH_DIR@")
- _ie_find_dependency(ngraph
-diff --git a/inference-engine/samples/CMakeLists.txt b/inference-engine/samples/CMakeLists.txt
-index 7924c56779..ae93857944 100644
---- a/inference-engine/samples/CMakeLists.txt
-+++ b/inference-engine/samples/CMakeLists.txt
-@@ -126,11 +126,10 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags")
- add_subdirectory(thirdparty/gflags EXCLUDE_FROM_ALL)
- set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty)
- endfunction()
-- add_gflags()
-+ #add_gflags()
- endif()
-
- if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib")
-- add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL)
- endif()
-
- if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy")
-diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
-index e8ed1a5c4c..2fcb0bed4a 100644
---- a/inference-engine/src/inference_engine/CMakeLists.txt
-+++ b/inference-engine/src/inference_engine/CMakeLists.txt
-@@ -290,8 +290,8 @@ configure_package_config_file("${InferenceEngine_SOURCE_DIR}/cmake/templates/Inf
- INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}"
- PATH_VARS ${PATH_VARS})
-
--set(IE_INCLUDE_DIR "include")
--set(IE_NGRAPH_DIR "../ngraph/cmake")
-+set(IE_INCLUDE_DIR "../../include")
-+set(IE_NGRAPH_DIR "ngraph")
- set(IE_TBB_DIR "${IE_TBB_DIR_INSTALL}")
- set(IE_PARALLEL_CMAKE "share/ie_parallel.cmake")
-
-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 5e8643dc5d..031557efc3 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
-@@ -43,7 +43,7 @@ function(add_gtest_libraries)
- PROPERTIES FOLDER thirdparty)
- endfunction()
-
--add_gtest_libraries()
-+#add_gtest_libraries()
-
- if (MSVC)
- set(PUGI pugixml_mt)
-@@ -52,8 +52,6 @@ else ()
- endif ()
-
- list(APPEND EXPORT_DEPENDENCIES
-- 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 7c1d89eabf..2fbd8fc324 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 f028ebdd8a..9c5bd53466 100644
---- a/inference-engine/thirdparty/CMakeLists.txt
-+++ b/inference-engine/thirdparty/CMakeLists.txt
-@@ -62,14 +62,13 @@ else()
- target_include_directories(pugixml INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src>")
- endif()
-
--add_subdirectory(ade EXCLUDE_FROM_ALL)
- add_subdirectory(fluid/modules/gapi)
-
--set_target_properties(ade fluid PROPERTIES FOLDER thirdparty)
-+set_target_properties(fluid PROPERTIES FOLDER thirdparty)
-
- # developer package
-
--openvino_developer_export_targets(COMPONENT openvino_common TARGETS ade fluid)
-+openvino_developer_export_targets(COMPONENT openvino_common TARGETS fluid)
-
- if (NOT USE_SYSTEM_PUGIXML)
- set_target_properties(pugixml PROPERTIES FOLDER thirdparty)
-diff --git a/ngraph/python/CMakeLists.txt b/ngraph/python/CMakeLists.txt
-index 501bfffb4b..b45612c19c 100644
---- a/ngraph/python/CMakeLists.txt
-+++ b/ngraph/python/CMakeLists.txt
-@@ -17,17 +17,7 @@ endif()
-
- include(FetchContent)
-
--FetchContent_Declare(
-- pybind11
-- GIT_REPOSITORY "https://github.com/pybind/pybind11.git"
-- GIT_TAG "v2.5.0"
--)
--
--FetchContent_GetProperties(pybind11)
--if(NOT pybind11_POPULATED)
-- FetchContent_Populate(pybind11)
-- add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
--endif()
-+add_subdirectory(pybind11)
-
- # PYTHON_VERSION_MAJOR and PYTHON_VERSION_MINOR are defined inside pybind11
- set(PYTHON_VERSION python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-diff --git a/tests/fuzz/src/CMakeLists.txt b/tests/fuzz/src/CMakeLists.txt
-index b9400d9e7e..669938526c 100644
---- a/tests/fuzz/src/CMakeLists.txt
-+++ b/tests/fuzz/src/CMakeLists.txt
-@@ -10,7 +10,6 @@ add_custom_target(fuzz)
- FILE(GLOB tests "*-fuzzer.cc")
-
- add_subdirectory(../../../thirdparty/cnpy ${CMAKE_CURRENT_BINARY_DIR}/cnpy)
--add_subdirectory(../../../thirdparty/zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
-
- foreach(test_source ${tests})
- get_filename_component(test_name ${test_source} NAME_WE)
-diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
-index 2c6b656408..4e86bd21ef 100644
---- a/thirdparty/CMakeLists.txt
-+++ b/thirdparty/CMakeLists.txt
-@@ -5,6 +5,5 @@
- add_subdirectory(ittapi)
- add_subdirectory(itt_collector)
- add_subdirectory(xbyak EXCLUDE_FROM_ALL)
--add_subdirectory(zlib EXCLUDE_FROM_ALL)
- add_subdirectory(cnpy EXCLUDE_FROM_ALL)
- openvino_developer_export_targets(COMPONENT openvino_common TARGETS xbyak)
-diff --git a/thirdparty/cnpy/CMakeLists.txt b/thirdparty/cnpy/CMakeLists.txt
-index 5571cd5f78..e30604927a 100644
---- a/thirdparty/cnpy/CMakeLists.txt
-+++ b/thirdparty/cnpy/CMakeLists.txt
-@@ -14,8 +14,8 @@ if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
- target_compile_options(${TARGET_NAME} PUBLIC -Wno-unused-variable)
- endif()
-
--target_link_libraries(${TARGET_NAME} PUBLIC zlib)
-+target_link_libraries(${TARGET_NAME} PUBLIC z)
- target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/..")
-
--set_target_properties(cnpy PROPERTIES FOLDER thirdparty)
-\ No newline at end of file
-+set_target_properties(cnpy PROPERTIES FOLDER thirdparty)
---
-2.32.0
-
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-Disable-Werror.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-Disable-Werror.patch
deleted file mode 100644
index 5e7cfb38..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-Disable-Werror.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 1a3f315323a0b1d1affed01e85cbbf0a677718e8 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] 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 -
- ngraph/CMakeLists.txt | 1 -
- 2 files changed, 2 deletions(-)
-
-diff --git a/inference-engine/thirdparty/clDNN/CMakeLists.txt b/inference-engine/thirdparty/clDNN/CMakeLists.txt
-index d14da47860..08ed695c0d 100644
---- a/inference-engine/thirdparty/clDNN/CMakeLists.txt
-+++ b/inference-engine/thirdparty/clDNN/CMakeLists.txt
-@@ -518,7 +518,6 @@ foreach(__CLDNN_CompilerFlagName IN ITEMS "CMAKE_CXX_FLAGS" "CMAKE_C_FLAGS")
- MultiProcessorCompilation
- DeadCodeEliminate
- ExtensionsEnabled
-- TreatWarnAsErrorEnabled
- WarnLevel4
- NoFastMath
- StackProtector
-diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt
-index a05ca3b15c..ae888c4cb2 100644
---- a/ngraph/CMakeLists.txt
-+++ b/ngraph/CMakeLists.txt
-@@ -197,7 +197,6 @@ if (WIN32)
- endif()
-
- if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
- endif()
-
- if(WIN32)
---
-2.32.0
-
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 145f2585..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-inference-engine-installation-fixes.patch
+++ /dev/null
@@ -1,326 +0,0 @@
-From 626184cf0e8c97b23cf0e7be4fb3e73f7e6748ee 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 | 15 --------
- .../IEDevScriptsConfig.cmake | 2 +-
- cmake/developer_package/packaging.cmake | 8 +++--
- cmake/developer_package/plugins/plugins.cmake | 2 +-
- .../common/opencv_c_wrapper/CMakeLists.txt | 2 ++
- inference-engine/samples/CMakeLists.txt | 4 ++-
- .../common/format_reader/CMakeLists.txt | 4 ++-
- .../src/inference_engine/CMakeLists.txt | 35 ++-----------------
- .../src/preprocessing/CMakeLists.txt | 2 +-
- .../src/readers/ir_reader/CMakeLists.txt | 2 +-
- .../src/vpu/myriad_plugin/CMakeLists.txt | 2 +-
- .../tests/unit/cpu/CMakeLists.txt | 2 ++
- .../unit/inference_engine/CMakeLists.txt | 2 ++
- .../tests/unit/vpu/CMakeLists.txt | 2 ++
- .../tools/compile_tool/CMakeLists.txt | 2 +-
- ngraph/CMakeLists.txt | 8 ++---
- 16 files changed, 32 insertions(+), 62 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e0706a72e8..7920de9a42 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -180,12 +180,7 @@ 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
-@@ -195,22 +190,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 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/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake
-index 0e1fe76db2..97867a24f8 100644
---- a/cmake/developer_package/IEDevScriptsConfig.cmake
-+++ b/cmake/developer_package/IEDevScriptsConfig.cmake
-@@ -124,7 +124,7 @@ if(NOT DEFINED OUTPUT_ROOT)
- if(NOT DEFINED OpenVINO_MAIN_SOURCE_DIR)
- message(FATAL_ERROR "OpenVINO_MAIN_SOURCE_DIR is not defined")
- endif()
-- set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
-+ set(OUTPUT_ROOT ${CMAKE_CURRENT_BINARY_DIR})
- endif()
-
- # Enable postfixes for Debug/Release builds
-diff --git a/cmake/developer_package/packaging.cmake b/cmake/developer_package/packaging.cmake
-index 2b5e945b17..adc4bef0bc 100644
---- a/cmake/developer_package/packaging.cmake
-+++ b/cmake/developer_package/packaging.cmake
-@@ -5,7 +5,9 @@
- 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()
-
- #
- # ie_cpack_set_library_dir()
-@@ -18,8 +20,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()
-diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake
-index aae1dbb7fb..e6dac2a478 100644
---- a/cmake/developer_package/plugins/plugins.cmake
-+++ b/cmake/developer_package/plugins/plugins.cmake
-@@ -124,7 +124,7 @@ function(ie_add_plugin)
-
- install(TARGETS ${IE_PLUGIN_NAME}
- RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT ${install_component}
-- LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT ${install_component})
-+ LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT ${install_component})
- endif()
- endfunction()
-
-diff --git a/inference-engine/ie_bridges/c/samples/common/opencv_c_wrapper/CMakeLists.txt b/inference-engine/ie_bridges/c/samples/common/opencv_c_wrapper/CMakeLists.txt
-index 45b2b3e9ed..55f7dfd214 100644
---- a/inference-engine/ie_bridges/c/samples/common/opencv_c_wrapper/CMakeLists.txt
-+++ b/inference-engine/ie_bridges/c/samples/common/opencv_c_wrapper/CMakeLists.txt
-@@ -28,3 +28,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER c_samples)
- if(COMMAND add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
- add_clang_format_target(${TARGET_NAME}_clang 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 ae93857944..fba24c6fed 100644
---- a/inference-engine/samples/CMakeLists.txt
-+++ b/inference-engine/samples/CMakeLists.txt
-@@ -33,7 +33,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)
-@@ -256,6 +256,8 @@ macro(ie_add_sample)
- if(COMMAND add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
- add_clang_format_target(${IE_SAMPLE_NAME}_clang FOR_SOURCES ${IE_SAMPLE_SOURCES} ${IE_SAMPLE_HEADERS})
- 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 d75061e56c..a2f8bd6397 100644
---- a/inference-engine/samples/common/format_reader/CMakeLists.txt
-+++ b/inference-engine/samples/common/format_reader/CMakeLists.txt
-@@ -44,4 +44,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}
-
- if(COMMAND add_clang_format_target)
- add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
--endif()
-\ No newline at end of file
-+endif()
-+
-+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 5d044e097c..103c187913 100644
---- a/inference-engine/src/inference_engine/CMakeLists.txt
-+++ b/inference-engine/src/inference_engine/CMakeLists.txt
-@@ -227,35 +227,6 @@ list(APPEND core_components ngraph)
- list(APPEND PATH_VARS "IE_INCLUDE_DIR" "IE_NGRAPH_DIR"
- "IE_PARALLEL_CMAKE")
-
--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)
--
-- set(IE_TBB_DIR_INSTALL "external/tbb/cmake")
-- set(IE_TBB_DIR "${TBB_DIR}")
-- list(APPEND PATH_VARS "IE_TBB_DIR")
--
-- install(FILES "${TBB}/cmake/TBBConfig.cmake"
-- "${TBB}/cmake/TBBConfigVersion.cmake"
-- DESTINATION ${IE_CPACK_IE_DIR}/${IE_TBB_DIR_INSTALL}
-- COMPONENT tbb)
--endif()
--
- # Install Inference Engine
-
- ie_cpack_add_component(core REQUIRED DEPENDS ${core_components})
-@@ -270,7 +241,7 @@ install(TARGETS ${TARGET_NAME} EXPORT InferenceEngineTargets
- LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core)
-
- install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
-- DESTINATION ${IE_CPACK_RUNTIME_PATH}
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
- COMPONENT core)
-
- # Install cmake scripts
-@@ -278,7 +249,7 @@ install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
- install(EXPORT InferenceEngineTargets
- FILE InferenceEngineTargets.cmake
- NAMESPACE IE::
-- DESTINATION ${IE_CPACK_IE_DIR}/share
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/InferenceEngine
- COMPONENT core_dev)
-
- set(IE_NGRAPH_DIR "${CMAKE_BINARY_DIR}/ngraph")
-@@ -307,5 +278,5 @@ configure_file("${IE_MAIN_SOURCE_DIR}/cmake/templates/InferenceEngineConfig-vers
- install(FILES "${CMAKE_BINARY_DIR}/share/InferenceEngineConfig.cmake"
- "${CMAKE_BINARY_DIR}/InferenceEngineConfig-version.cmake"
- "${InferenceEngine_SOURCE_DIR}/cmake/ie_parallel.cmake"
-- DESTINATION ${IE_CPACK_IE_DIR}/share
-+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/InferenceEngine
- COMPONENT core_dev)
-diff --git a/inference-engine/src/preprocessing/CMakeLists.txt b/inference-engine/src/preprocessing/CMakeLists.txt
-index f9548339d1..2670a04b60 100644
---- a/inference-engine/src/preprocessing/CMakeLists.txt
-+++ b/inference-engine/src/preprocessing/CMakeLists.txt
-@@ -184,4 +184,4 @@ ie_developer_export_targets(${TARGET_NAME})
-
- install(TARGETS ${TARGET_NAME}
- RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core
-- LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core)
-+ LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core)
-diff --git a/inference-engine/src/readers/ir_reader/CMakeLists.txt b/inference-engine/src/readers/ir_reader/CMakeLists.txt
-index 6d2bd39f3c..0722702055 100644
---- a/inference-engine/src/readers/ir_reader/CMakeLists.txt
-+++ b/inference-engine/src/readers/ir_reader/CMakeLists.txt
-@@ -49,4 +49,4 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
-
- install(TARGETS ${TARGET_NAME}
- RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core
-- LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core)
-+ LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core)
-diff --git a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-index a3e0182ed9..1b0e241485 100644
---- a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-+++ b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
-@@ -55,6 +55,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_REL
- # install
- if (LINUX)
- 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)
- endif()
-diff --git a/inference-engine/tests/unit/cpu/CMakeLists.txt b/inference-engine/tests/unit/cpu/CMakeLists.txt
-index dfa8ce9d3f..88e7fbf67f 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 5c38c77b9b..927f93484f 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 fcb9f567bb..d4ac1952b8 100644
---- a/inference-engine/tests/unit/vpu/CMakeLists.txt
-+++ b/inference-engine/tests/unit/vpu/CMakeLists.txt
-@@ -33,3 +33,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 6e6f384289..a76ba55e64 100644
---- a/inference-engine/tools/compile_tool/CMakeLists.txt
-+++ b/inference-engine/tools/compile_tool/CMakeLists.txt
-@@ -41,7 +41,7 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
- ie_cpack_add_component(core_tools DEPENDS core)
-
- install(TARGETS compile_tool
-- RUNTIME DESTINATION deployment_tools/tools/compile_tool
-+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- COMPONENT core_tools)
-
- install(FILES README.md
-diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt
-index 830fb3eb36..3093596e4a 100644
---- a/ngraph/CMakeLists.txt
-+++ b/ngraph/CMakeLists.txt
-@@ -183,10 +183,10 @@ endif()
- message(STATUS "Installation directory: ${CMAKE_INSTALL_PREFIX}")
-
- # Destinations
--set(NGRAPH_INSTALL_LIB "deployment_tools/ngraph/${CMAKE_INSTALL_LIBDIR}")
--set(NGRAPH_INSTALL_INCLUDE "deployment_tools/ngraph/${CMAKE_INSTALL_INCLUDEDIR}")
--set(NGRAPH_INSTALL_DOC "deployment_tools/ngraph/${CMAKE_INSTALL_DOCDIR}")
--set(NGRAPH_INSTALL_BIN "deployment_tools/ngraph/${CMAKE_INSTALL_BINDIR}")
-+set(NGRAPH_INSTALL_LIB "${CMAKE_INSTALL_LIBDIR}")
-+set(NGRAPH_INSTALL_INCLUDE "${CMAKE_INSTALL_INCLUDEDIR}")
-+set(NGRAPH_INSTALL_DOC "${CMAKE_INSTALL_DOCDIR}")
-+set(NGRAPH_INSTALL_BIN "${CMAKE_INSTALL_BINDIR}")
-
- #-----------------------------------------------------------------------------------------------
- # Compile Flags for nGraph...
---
-2.32.0
-
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/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 6d0c6cbc..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,29 +1,27 @@
-From 247a5383e7ae444fd99022a19fe90a59dbedbc98 Mon Sep 17 00:00:00 2001
+From 804b08023b3f8e72b8e3eb09e464d6775c11d966 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Mon, 30 Aug 2021 17:54:17 +0800
+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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
-index 1df8f248d..d368d608c 100644
+index 51767051c..fb7e3d22f 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
-@@ -131,7 +131,7 @@ find_package(OpenCV REQUIRED COMPONENTS core highgui videoio imgproc imgcodecs g
- find_package(InferenceEngine REQUIRED)
- find_package(ngraph REQUIRED)
+@@ -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)
- add_subdirectory(multi_channel_common/cpp)
---
-2.17.1
-
+ find_package(OpenCV QUIET COMPONENTS gapi)
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.4.2.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.4.2.bb
deleted file mode 100644
index 6afb0fca..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2021.4.2.bb
+++ /dev/null
@@ -1,66 +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=https;branch=master \
- file://0001-use-oe-gflags.patch \
- "
-
-SRCREV = "0d7aeac5eacdd343fdf9b375a23b7ec9a3846002"
-
-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-test-generator \
- python3-requests \
- python3-pyyaml \
- python3-numpy \
- bash \
-"
-
-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
- 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/demos ${D}${datadir}/openvino/open-model-zoo
- cp -rf ${WORKDIR}/git/tools/downloader ${D}${datadir}/openvino/open-model-zoo/tools
-}
-
-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.4.2.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.4.2.bb
deleted file mode 100644
index 14a3c8ee..00000000
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2021.4.2.bb
+++ /dev/null
@@ -1,132 +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=https;branch=releases/2021/4;lfs=0 \
- https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/usb-ma2x8x/firmware_usb-ma2x8x_1875.zip;name=usb_ma2x8x \
- https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/pcie-ma2x8x/firmware_pcie-ma2x8x_1875.zip;name=pcie_ma2x8x \
- git://github.com/openvinotoolkit/oneDNN.git;protocol=https;destsuffix=git/inference-engine/thirdparty/mkl-dnn;name=mkl;nobranch=1 \
- git://github.com/herumi/xbyak.git;protocol=https;destsuffix=git/thirdparty/xbyak;name=xbyak;branch=master \
- git://github.com/pybind/pybind11.git;protocol=https;destsuffix=git/ngraph/python/pybind11;name=pybind11;branch=master \
- file://0001-inference-engine-use-system-installed-packages.patch \
- file://0002-Disable-Werror.patch \
- file://0003-inference-engine-installation-fixes.patch \
- file://0001-dont-install-licenses-and-version-file.patch \
- "
-
-SRCREV = "6c4462759e8974c0ce5b36ad22972a1c6ded76a8"
-SRCREV_mkl = "60f41b3a9988ce7b1bc85c4f1ce7f9443bc91c9d"
-SRCREV_xbyak = "8d1e41b650890080fb77548372b6236bbd4079f9"
-SRCREV_pybind11 = "3b1dbebabc801c9cf6f0953a4c20b904d444f879"
-
-SRC_URI[usb_ma2x8x.sha256sum] = "e65fcc1c6b0f3e9d814e53022c212ec0a2b83197a9df38badb298fb85ccf3acf"
-SRC_URI[pcie_ma2x8x.sha256sum] = "b11368fec2036d96fb703d2a40b171184fefe89f27e74a988ef1ca34260a2bc5"
-
-LICENSE = "Apache-2.0 & ISSL & MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
- file://inference-engine/thirdparty/mkl-dnn/LICENSE;md5=c441291ac5f15bdc6b09b4cc02ece35b \
- file://thirdparty/xbyak/COPYRIGHT;md5=03532861dad9003cc2c17f14fc7a4efa \
- file://inference-engine/thirdparty/clDNN/common/include/OpenCL_CLHPP_License.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
-"
-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}/cmake/TBB \
- -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 \
- zlib \
- "
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST:libc-musl = "null"
-
-#Disable opencl temporarily. intel-compute-runtime depends on
-#intel-graphics-compiler and vc-intrinsics and these two recipes fail to
-#compile with LLVM13. Enable it after upstream has fixed it.
-#PACKAGECONFIG ?= "vpu opencl"
-PACKAGECONFIG ?= "vpu"
-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"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
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/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.1.0.bb b/recipes-bsp/metee/metee_3.2.4.bb
index 80399f52..da8220b9 100644
--- a/recipes-bsp/metee/metee_3.1.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;branch=master;protocol=https"
-SRCREV = "73636d20b51c64182867686d1db9ff05604f42d8"
+SRC_URI = "git://github.com/intel/metee.git;branch=master;protocol=https \
+"
+SRCREV = "db45e37e146fd9c06907a15ade55eba06ad1f951"
S = "${WORKDIR}/git"
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 2008168c..31e9344b 100644
--- a/recipes-core/libxcam/libxcam_1.5.0.bb
+++ b/recipes-core/libxcam/libxcam_1.5.0.bb
@@ -9,6 +9,7 @@ inherit autotools pkgconfig
S = "${WORKDIR}/git"
SRCREV = "231a1d5243cd45c7a6b511b667f1ec52178fdda8"
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"
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_20210608.bb b/recipes-core/microcode/intel-microcode_20240312.bb
index 0487b219..00b18231 100644
--- a/recipes-core/microcode/intel-microcode_20210608.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 = "3f97690f0da8011f52209b232450a1e5c4f2e1f6"
+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/*
}
diff --git a/recipes-core/microcode/iucode-tool_2.3.1.bb b/recipes-core/microcode/iucode-tool_2.3.1.bb
index 1d45f9a7..19417b7c 100644
--- a/recipes-core/microcode/iucode-tool_2.3.1.bb
+++ b/recipes-core/microcode/iucode-tool_2.3.1.bb
@@ -12,7 +12,7 @@ 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"
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/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 71c21a04..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=https;branch=master "
-
-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 a51bdece..b65b182d 100644
--- a/recipes-devtools/slimboot/slimboot-tools_git.bb
+++ b/recipes-devtools/slimboot/slimboot-tools_git.bb
@@ -5,10 +5,10 @@ Operating Systems or Hypervisors."
HOMEPAGE = "https://slimbootloader.github.io/tools/index.html"
SRC_URI = "git://github.com/slimbootloader/slimbootloader;protocol=https;branch=master"
-SRCREV = "9f146afd47e0ca204521826a583d55388850b216"
+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.3.1.bb b/recipes-graphics/gmmlib/gmmlib_22.3.15.bb
index 9572ddc7..875fbaf5 100644
--- a/recipes-graphics/gmmlib/gmmlib_21.3.1.bb
+++ b/recipes-graphics/gmmlib/gmmlib_22.3.15.bb
@@ -8,9 +8,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=465fe90caea3edd6a2cecb3f0c28a654"
SRC_URI = " \
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 = "1c975c52634172376b49f2983d4d0fd7049302f9"
+SRCREV = "5fb4180e22695ad4e3c155cf680119913c9f44bc"
S = "${WORKDIR}/git"
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/libva/libva-intel-utils_2.13.0.bb b/recipes-graphics/libva/libva-intel-utils_2.20.1.bb
index 7accee5f..9c26f009 100644
--- a/recipes-graphics/libva/libva-intel-utils_2.13.0.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.13-branch;protocol=https"
-SRCREV = "7bad184b2cf2ffaf4fb3cc71d4df63d7b142d592"
+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+)+))"
diff --git a/recipes-graphics/libva/libva-intel_2.13.0.bb b/recipes-graphics/libva/libva-intel_2.20.0.bb
index a2c58bbc..c81ed65c 100644
--- a/recipes-graphics/libva/libva-intel_2.13.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] = "fad383f39f36115814bd0eda1496a4cc01761643bd962635400df2d4470ad460"
+SRC_URI = "https://github.com/intel/libva/releases/download/${PV}/libva-${PV}.tar.bz2 \
+ "
+SRC_URI[sha256sum] = "f72bdb4f48dfe71ad01f1cbefe069672a2c949a6abd51cf3c4d4784210badc49"
S = "${WORKDIR}/libva-${PV}"
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 dd6dc1d5..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"
+SRCREV = "75b292eb1309e4ea10dce403065ee8ca5bf29ecc"
SRC_URI = "git://github.com/intel/metrics-discovery.git;branch=master;protocol=https \
- file://0001-md_internal.h-Replace-string.h-with-string-C-header-.patch \
"
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.13.4.bb b/recipes-kernel/intel-ethernet/ixgbe_5.19.6.bb
index 21fe3277..7ef38650 100644
--- a/recipes-kernel/intel-ethernet/ixgbe_5.13.4.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] = "6a9644299889a973803fb0d84f4cb0ec4e35708bae14bc38b0d441240a152974"
+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,7 +19,7 @@ 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"
@@ -40,5 +40,4 @@ FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity"
EXCLUDE_FROM_WORLD = "1"
-# This was fixed in kernel v4.4
-CVE_CHECK_WHITELIST += "CVE-2015-1142857"
+CVE_STATUS[CVE-2015-1142857] = "fixed-version: Fixed from version 4.4-rc1"
diff --git a/recipes-kernel/intel-ethernet/ixgbevf_4.13.3.bb b/recipes-kernel/intel-ethernet/ixgbevf_4.18.7.bb
index e3fd3d6f..b21796c6 100644
--- a/recipes-kernel/intel-ethernet/ixgbevf_4.13.3.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] = "b03010df2c491192dfda489fb6b5a99e83670ac9bc12fc76b1a144ddb2af3f76"
+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,7 +22,7 @@ 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"
@@ -41,7 +41,6 @@ PACKAGES += "${PN}-script"
FILES:${PN}-script += "${sysconfdir}/network/set_irq_affinity"
-# This was fixed in kernel v4.4
-CVE_CHECK_WHITELIST += "CVE-2015-1142857"
+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 a06a8e26..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} \
@@ -44,6 +44,8 @@ do_install:append() {
RDEPENDS:${PN} = "linux-firmware-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"
diff --git a/recipes-kernel/linux/linux-intel-dev.bb b/recipes-kernel/linux/linux-intel-dev.bb
deleted file mode 100644
index 41f327b8..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.12.0"
-SRCREV_machine ?= "9f4ad9e425a1d3b6a34617b8ea226d56a119a717"
-SRCREV_meta ?= "99570241ac88d6c7e32b6fccd83afce53816b275"
-
-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.10.bb b/recipes-kernel/linux/linux-intel-rt_5.10.bb
deleted file mode 100644
index fe1accb0..00000000
--- a/recipes-kernel/linux/linux-intel-rt_5.10.bb
+++ /dev/null
@@ -1,35 +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=6bc538ed5bd9a7fc9398086aedcd7e46"
-SRC_URI:append = " file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \
- "
-
-KBRANCH = "5.10/preempt-rt"
-KMETA_BRANCH = "yocto-5.10"
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.10.78"
-SRCREV_machine ?= "c287378636ba3f627b4da448d62a75ed41a35982"
-SRCREV_meta ?= "64fb693a6c11f21bab3ff9bb8dcb65a70abe05e3"
-
-LINUX_KERNEL_TYPE = "preempt-rt"
-
-# Following commit is backported from mainline 5.12-rc to linux-intel 5.10 kernel
-# Commit: https://github.com/torvalds/linux/commit/26499e0518a77de29e7db2c53fb0d0e9e15be8fb
-# In which 'CONFIG_DRM_GMA3600' config option is dropped.
-# This causes warning during config audit. So suppress the harmless warning for now.
-KCONF_BSP_AUDIT_LEVEL = "0"
-
-# Disabling CONFIG_SND_SOC_INTEL_SKYLAKE for 32-bit, does not allow to set CONFIG_SND_SOC_INTEL_SST too, which
-# causes config warning too.
-KCONF_AUDIT_LEVEL:core2-32-intel-common = "0"
diff --git a/recipes-kernel/linux/linux-intel-rt_5.15.bb b/recipes-kernel/linux/linux-intel-rt_6.6.bb
index bc11cb63..23e79a43 100644
--- a/recipes-kernel/linux/linux-intel-rt_5.15.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,21 +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.15/preempt-rt"
-KMETA_BRANCH = "yocto-5.15"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
DEPENDS += "elfutils-native openssl-native util-linux-native"
-LINUX_VERSION ?= "5.15.2"
-SRCREV_machine ?= "f09e0e5e5d73c753dbdf2e9f0ac2d533a51e8dd8"
-SRCREV_meta ?= "bee5d6a15909f05935f4a61f83a72cddfca7934a"
+LINUX_VERSION_EXTENSION ??= "-intel-pk-${LINUX_KERNEL_TYPE}"
+
+LINUX_VERSION ?= "6.6.23"
+SRCREV_machine ?= "73113409624a0a68494db7b1c1d535d1c8b96689"
+SRCREV_meta ?= "eb283ea577df80542d48f0c498365960b4c4ecd9"
LINUX_KERNEL_TYPE = "preempt-rt"
-# Disabling CONFIG_SND_SOC_INTEL_SKYLAKE for 32-bit, does not allow to set CONFIG_SND_SOC_INTEL_SST too, which
-# causes config warning too.
-KCONF_AUDIT_LEVEL:core2-32-intel-common = "0"
+# 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 8112dc62..f78f5205 100644
--- a/recipes-kernel/linux/linux-intel.inc
+++ b/recipes-kernel/linux/linux-intel.inc
@@ -6,20 +6,19 @@ 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: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)}"
diff --git a/recipes-kernel/linux/linux-intel/0001-io-mapping-Cleanup-atomic-iomap.patch b/recipes-kernel/linux/linux-intel/0001-io-mapping-Cleanup-atomic-iomap.patch
deleted file mode 100644
index e3608238..00000000
--- a/recipes-kernel/linux/linux-intel/0001-io-mapping-Cleanup-atomic-iomap.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From cc3ff5fe73139251070775308dcaadf474566b4b Mon Sep 17 00:00:00 2001
-From: Thomas Gleixner <tglx@linutronix.de>
-Date: Tue, 3 Nov 2020 10:27:32 +0100
-Subject: [PATCH] io-mapping: Cleanup atomic iomap
-
-Switch the atomic iomap implementation over to kmap_local and stick the
-preempt/pagefault mechanics into the generic code similar to the
-kmap_atomic variants.
-
-Rename the x86 map function in preparation for a non-atomic variant.
-
-Upstream-Status: Backport [https://github.com/torvalds/linux/commit/351191ad55c8a1eccaf23e4187c62056229c0779]
-
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Cc: Linus Torvalds <torvalds@linuxfoundation.org>
-Cc: Christoph Hellwig <hch@lst.de>
-Cc: Andrew Morton <akpm@linux-foundation.org>
-Link: https://lore.kernel.org/r/20201103095858.625310005@linutronix.de
----
- arch/x86/include/asm/iomap.h | 9 +--------
- arch/x86/mm/iomap_32.c | 6 ++----
- include/linux/io-mapping.h | 8 ++++++--
- 3 files changed, 9 insertions(+), 14 deletions(-)
-
-diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h
-index 0be7a30fd6bc..e2de092fc38c 100644
---- a/arch/x86/include/asm/iomap.h
-+++ b/arch/x86/include/asm/iomap.h
-@@ -13,14 +13,7 @@
- #include <asm/cacheflush.h>
- #include <asm/tlbflush.h>
-
--void __iomem *iomap_atomic_pfn_prot(unsigned long pfn, pgprot_t prot);
--
--static inline void iounmap_atomic(void __iomem *vaddr)
--{
-- kunmap_local_indexed((void __force *)vaddr);
-- pagefault_enable();
-- preempt_enable();
--}
-+void __iomem *__iomap_local_pfn_prot(unsigned long pfn, pgprot_t prot);
-
- int iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
-
-diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
-index e0a40d7cc66c..9aaa756ddf21 100644
---- a/arch/x86/mm/iomap_32.c
-+++ b/arch/x86/mm/iomap_32.c
-@@ -44,7 +44,7 @@ void iomap_free(resource_size_t base, unsigned long size)
- }
- EXPORT_SYMBOL_GPL(iomap_free);
-
--void __iomem *iomap_atomic_pfn_prot(unsigned long pfn, pgprot_t prot)
-+void __iomem *__iomap_local_pfn_prot(unsigned long pfn, pgprot_t prot)
- {
- /*
- * For non-PAT systems, translate non-WB request to UC- just in
-@@ -60,8 +60,6 @@ void __iomem *iomap_atomic_pfn_prot(unsigned long pfn, pgprot_t prot)
- /* Filter out unsupported __PAGE_KERNEL* bits: */
- pgprot_val(prot) &= __default_kernel_pte_mask;
-
-- preempt_disable();
-- pagefault_disable();
- return (void __force __iomem *)__kmap_local_pfn_prot(pfn, prot);
- }
--EXPORT_SYMBOL_GPL(iomap_atomic_pfn_prot);
-+EXPORT_SYMBOL_GPL(__iomap_local_pfn_prot);
-diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
-index 0a1a186a43c5..e9743cfd8585 100644
---- a/include/linux/io-mapping.h
-+++ b/include/linux/io-mapping.h
-@@ -69,13 +69,17 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping,
-
- BUG_ON(offset >= mapping->size);
- phys_addr = mapping->base + offset;
-- return iomap_atomic_pfn_prot(PHYS_PFN(phys_addr), mapping->prot);
-+ preempt_disable();
-+ pagefault_disable();
-+ return __iomap_local_pfn_prot(PHYS_PFN(phys_addr), mapping->prot);
- }
-
- static inline void
- io_mapping_unmap_atomic(void __iomem *vaddr)
- {
-- iounmap_atomic(vaddr);
-+ kunmap_local_indexed((void __force *)vaddr);
-+ pagefault_enable();
-+ preempt_enable();
- }
-
- static inline void __iomem *
---
-2.17.1
-
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/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 9264c22a..00000000
--- a/recipes-kernel/linux/linux-intel_5.10.bb
+++ /dev/null
@@ -1,33 +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 \
- file://0001-io-mapping-Cleanup-atomic-iomap.patch \
- "
-
-DEPENDS += "elfutils-native openssl-native util-linux-native"
-
-LINUX_VERSION ?= "5.10.78"
-SRCREV_machine ?= "4e8162d8163c74e46a9f0bafb860f42249702791"
-SRCREV_meta ?= "64fb693a6c11f21bab3ff9bb8dcb65a70abe05e3"
-
-# 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"
-
-# Following commit is backported from mainline 5.12-rc to linux-intel 5.10 kernel
-# Commit: https://github.com/torvalds/linux/commit/26499e0518a77de29e7db2c53fb0d0e9e15be8fb
-# In which 'CONFIG_DRM_GMA3600' config option is dropped.
-# This causes warning during config audit. So suppress the harmless warning for now.
-KCONF_BSP_AUDIT_LEVEL = "0"
-
-# Disabling CONFIG_SND_SOC_INTEL_SKYLAKE for 32-bit, does not allow to set CONFIG_SND_SOC_INTEL_SST too, which
-# causes config warning too.
-KCONF_AUDIT_LEVEL:core2-32-intel-common = "0"
diff --git a/recipes-kernel/linux/linux-intel_5.15.bb b/recipes-kernel/linux/linux-intel_5.15.bb
deleted file mode 100644
index 172f0162..00000000
--- a/recipes-kernel/linux/linux-intel_5.15.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require linux-intel.inc
-
-KBRANCH = "5.15/linux"
-KMETA_BRANCH = "yocto-5.15"
-
-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.15.1"
-SRCREV_machine ?= "d7d7ea689cc887081dd8bf8ef2f296b5cd9c593e"
-SRCREV_meta ?= "bee5d6a15909f05935f4a61f83a72cddfca7934a"
-
-# 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"
-
-# Disabling CONFIG_SND_SOC_INTEL_SKYLAKE for 32-bit, does not allow to set CONFIG_SND_SOC_INTEL_SST too, which
-# causes config warning too.
-KCONF_AUDIT_LEVEL:core2-32-intel-common = "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-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 7657b02f..9f3d43e3 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -1,3 +1,5 @@
+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.
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 41582aa5..0c861e13 100644
--- a/recipes-kernel/linux/meta-intel-compat-kernel.inc
+++ b/recipes-kernel/linux/meta-intel-compat-kernel.inc
@@ -8,7 +8,7 @@ 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:x86-64-v3-intel-common = "intel-corei7-64"
INTEL_COMMON_AUTOLOAD ?= " uio iwlwifi i915"
KERNEL_MODULE_AUTOLOAD:intel-x86-common = " ${INTEL_COMMON_AUTOLOAD}"
diff --git a/recipes-multimedia/itt/itt_3.22.4.bb b/recipes-multimedia/itt/itt_3.24.6.bb
index 2091260a..1c4759f9 100644
--- a/recipes-multimedia/itt/itt_3.22.4.bb
+++ b/recipes-multimedia/itt/itt_3.24.6.bb
@@ -3,13 +3,13 @@ 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;branch=master"
-SRCREV = "0ef7dc3eb99d29dd56a4a51cb4f0076e4a2973e8"
+SRCREV = "ec077431fc725dba590b09b2cec5137878b14783"
S = "${WORKDIR}/git"
PE = "1"
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/0001-MOS-user-setting-reentrant.patch b/recipes-multimedia/libva/files/0001-MOS-user-setting-reentrant.patch
deleted file mode 100644
index 9b9cfe35..00000000
--- a/recipes-multimedia/libva/files/0001-MOS-user-setting-reentrant.patch
+++ /dev/null
@@ -1,476 +0,0 @@
-From b2c07abaf546f84529b39cb4ae443ed2a5bc35e9 Mon Sep 17 00:00:00 2001
-From: jinchung <you@example.com>
-Date: Wed, 3 Nov 2021 14:02:51 +0000
-Subject: [PATCH] [MOS] user setting reentrant
-
-Fix for registry key reentrant on Linux during multiple processes
-
-Upstream-Status: Submitted [internal innersource]
-innersource PR #45124
-
-Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
-Signed-off-by: Wang, Pingli <pingli.wang@intel.com>
----
- .../common/os/mos_utilities_specific.cpp | 2 +-
- .../linux/common/os/mos_utilities_specific.h | 2 +-
- .../agnostic/common/os/mos_utilities_next.cpp | 15 ++-
- .../agnostic/common/os/mos_utilities_next.h | 2 +-
- .../common/os/mos_utilities_specific_next.cpp | 107 +++++++-----------
- .../common/os/mos_utilities_specific_next.h | 71 ++++++------
- 6 files changed, 89 insertions(+), 110 deletions(-)
-
-diff --git a/media_driver/linux/common/os/mos_utilities_specific.cpp b/media_driver/linux/common/os/mos_utilities_specific.cpp
-index ae414360..62eb4593 100644
---- a/media_driver/linux/common/os/mos_utilities_specific.cpp
-+++ b/media_driver/linux/common/os/mos_utilities_specific.cpp
-@@ -589,7 +589,7 @@ static int32_t _UserFeature_FindValue(MOS_UF_KEY UFKey, char * const pcValueName
-
- iResult = -1;
-
-- for ( i = 0; i < (int32_t)UFKey.ulValueNum; i++ )
-+ for ( i = 0; i < UFKey.ulValueNum; i++ )
- {
- iResult = strcmp(UFKey.pValueArray[i].pcValueName, pcValueName);
- if ( iResult == 0 )
-diff --git a/media_driver/linux/common/os/mos_utilities_specific.h b/media_driver/linux/common/os/mos_utilities_specific.h
-index 81d84537..3d1cda35 100644
---- a/media_driver/linux/common/os/mos_utilities_specific.h
-+++ b/media_driver/linux/common/os/mos_utilities_specific.h
-@@ -116,7 +116,7 @@ typedef struct _MOS_UF_VALUE {
- typedef struct _MOS_UF_KEY {
- void *UFKey;
- char pcKeyName[MAX_USERFEATURE_LINE_LENGTH];
-- uint32_t ulValueNum;
-+ int32_t ulValueNum;
- MOS_UF_VALUE *pValueArray;
- } MOS_UF_KEY;
-
-diff --git a/media_softlet/agnostic/common/os/mos_utilities_next.cpp b/media_softlet/agnostic/common/os/mos_utilities_next.cpp
-index 8427ec17..74ba75b9 100644
---- a/media_softlet/agnostic/common/os/mos_utilities_next.cpp
-+++ b/media_softlet/agnostic/common/os/mos_utilities_next.cpp
-@@ -1930,9 +1930,18 @@ MOS_STATUS MosUtilities::MosUserFeatureReadValueFromMapID(
- &ufKey,
- ufInfo)) != MOS_STATUS_SUCCESS)
- {
-- MOS_OS_NORMALMESSAGE("Failed to open user feature for reading eStatus:%d.", eStatus);
-- eStatus = MOS_STATUS_USER_FEATURE_KEY_OPEN_FAILED;
-- goto finish;
-+ MOS_OS_NORMALMESSAGE("Failed to open user feature for concurrency.");
-+ if ((eStatus = MosUserFeatureOpen(
-+ pUserFeature->Type,
-+ pUserFeature->pcPath,
-+ KEY_READ,
-+ &ufKey,
-+ ufInfo)) != MOS_STATUS_SUCCESS)
-+ {
-+ MOS_OS_NORMALMESSAGE("Failed to open user feature for reading eStatus:%d.", eStatus);
-+ eStatus = MOS_STATUS_USER_FEATURE_KEY_OPEN_FAILED;
-+ goto finish;
-+ }
- }
-
- // Initialize Read Value
-diff --git a/media_softlet/agnostic/common/os/mos_utilities_next.h b/media_softlet/agnostic/common/os/mos_utilities_next.h
-index f492a2c7..65aa3729 100644
---- a/media_softlet/agnostic/common/os/mos_utilities_next.h
-+++ b/media_softlet/agnostic/common/os/mos_utilities_next.h
-@@ -653,7 +653,7 @@ public:
- //!
- //! \brief Unlink the user feature key Desc Fields table items to key value map
- //! \details Unlink the user feature key Desc Fields table items to key value map
-- //! according to ID sequence and do some post processing by calling MOS_DestroyUserFeatureData
-+ //! according to ID sequence and do some post processing by calling MOSDestroyUserFeatureData
- //! \param [in] pUserFeatureKey
- //! Pointer to the User Feature Value needed to be destroyed
- //! \return MOS_STATUS
-diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-index 81ee4bdf..584ba086 100644
---- a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-@@ -47,7 +47,8 @@
- #include <unistd.h> // fork
- #include <algorithm>
-
--const char *MosUtilitiesSpecificNext::m_szUserFeatureFile = USER_FEATURE_FILE;
-+const char *MosUtilitiesSpecificNext::m_szUserFeatureFile = USER_FEATURE_FILE;
-+MOS_PUF_KEYLIST MosUtilitiesSpecificNext::m_ufKeyList = nullptr;
-
- double MosUtilities::MosGetTime()
- {
-@@ -540,7 +541,7 @@ void MosUtilities::MosSleep(uint32_t mSec)
-
- iResult = -1;
-
-- for ( i = 0; i < (int32_t)UFKey.ulValueNum; i++ )
-+ for ( i = 0; i < UFKey.ulValueNum; i++ )
- {
- iResult = strcmp(UFKey.pValueArray[i].pcValueName, pcValueName);
- if ( iResult == 0 )
-@@ -566,7 +567,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureAdd(MOS_PUF_KEYLIST *pKeyList, M
- return MOS_STATUS_INVALID_PARAMETER;
- }
-
-- pNewNode = (MOS_UF_KEYNODE*)MOS_AllocMemory(sizeof(MOS_UF_KEYNODE));
-+ pNewNode = (MOS_UF_KEYNODE*)MOS_AllocAndZeroMemory(sizeof(MOS_UF_KEYNODE));
- if (pNewNode == nullptr)
- {
- return MOS_STATUS_NO_SPACE;
-@@ -604,41 +605,34 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
- }
-
- // Prepare the ValueBuff of the NewKey
-- if ((ulValueBuf = MOS_AllocMemory(NewKey.pValueArray[0].ulValueLen)) == nullptr)
-+ if ((ulValueBuf = MOS_AllocAndZeroMemory(NewKey.pValueArray[0].ulValueLen)) == nullptr)
- {
- return MOS_STATUS_NO_SPACE;
- }
-+ MOS_AtomicIncrement(&MosUtilities::m_mosMemAllocFakeCounter); //ulValueBuf does not count it, because it is freed after the MEMNJA final report.
-+ MOS_OS_NORMALMESSAGE("ulValueBuf %p for key %s", ulValueBuf, NewKey.pValueArray[0].pcValueName);
-
- if ( (iPos = UserFeatureFindValue(*Key, NewKey.pValueArray[0].pcValueName)) == NOT_FOUND)
- {
- //not found, add a new value to key struct.
- //reallocate memory for appending this value.
-- pValueArray = (MOS_UF_VALUE*)MOS_AllocMemory(sizeof(MOS_UF_VALUE)*(Key->ulValueNum+1));
-- if (pValueArray == nullptr)
-+ iPos = MOS_AtomicIncrement(&Key->ulValueNum);
-+ if (iPos >= UF_CAPABILITY)
- {
-- MOS_FreeMemory(ulValueBuf);
-- return MOS_STATUS_NO_SPACE;
-+ MOS_OS_ASSERTMESSAGE("user setting value icount %d must less than UF_CAPABILITY(64)", iPos);
-+ return MOS_STATUS_USER_FEATURE_KEY_READ_FAILED;
- }
-
-- MosUtilities::MosSecureMemcpy(pValueArray,
-- sizeof(MOS_UF_VALUE)*(Key->ulValueNum),
-- Key->pValueArray,
-- sizeof(MOS_UF_VALUE)*(Key->ulValueNum));
--
-- MOS_FreeMemory(Key->pValueArray);
--
-- Key->pValueArray = pValueArray;
--
-- iPos = Key->ulValueNum;
-- MosUtilities::MosSecureStrcpy(Key->pValueArray[Key->ulValueNum].pcValueName,
-+ MosUtilities::MosSecureStrcpy(Key->pValueArray[iPos].pcValueName,
- MAX_USERFEATURE_LINE_LENGTH,
- NewKey.pValueArray[0].pcValueName);
-- Key->ulValueNum ++;
- }
- else
- {
- //if found, the previous value buffer needs to be freed before reallocating
- MOS_FreeMemory(Key->pValueArray[iPos].ulValueBuf);
-+ MOS_AtomicDecrement(&MosUtilities::m_mosMemAllocFakeCounter);
-+ MOS_OS_NORMALMESSAGE("ulValueBuf %p for key %s", ulValueBuf, NewKey.pValueArray[0].pcValueName);
- }
-
- Key->pValueArray[iPos].ulValueLen = NewKey.pValueArray[0].ulValueLen;
-@@ -733,7 +727,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpFile(const char * const szF
- iCurId = 0;
- eStatus = MOS_STATUS_SUCCESS;
-
-- CurKey = (MOS_UF_KEY*)MOS_AllocMemory(sizeof(MOS_UF_KEY));
-+ CurKey = (MOS_UF_KEY*)MOS_AllocAndZeroMemory(sizeof(MOS_UF_KEY));
- if (CurKey == nullptr)
- {
- return MOS_STATUS_NO_SPACE;
-@@ -771,7 +765,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpFile(const char * const szF
- // if the CurKey didn't be added in pKeyList, free it.
- MOS_FreeMemory(CurKey);
- }
-- CurKey = (MOS_UF_KEY*)MOS_AllocMemory(sizeof(MOS_UF_KEY));
-+ CurKey = (MOS_UF_KEY*)MOS_AllocAndZeroMemory(sizeof(MOS_UF_KEY));
- if (CurKey == nullptr)
- {
- eStatus = MOS_STATUS_NO_SPACE;
-@@ -796,7 +790,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpFile(const char * const szF
- CurKey->ulValueNum = 0;
-
- // allocate capability length for valuearray.
-- CurValue = (MOS_UF_VALUE*)MOS_AllocMemory(sizeof(MOS_UF_VALUE)*UF_CAPABILITY);
-+ CurValue = (MOS_UF_VALUE*)MOS_AllocAndZeroMemory(sizeof(MOS_UF_VALUE)*UF_CAPABILITY);
- if (CurValue == nullptr)
- {
- eStatus = MOS_STATUS_NO_SPACE;
-@@ -826,6 +820,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpFile(const char * const szF
- if (iCount < 0 || iCount >= UF_CAPABILITY)
- {
- eStatus = MOS_STATUS_USER_FEATURE_KEY_READ_FAILED;
-+ MOS_OS_ASSERTMESSAGE("user setting value icount %d, and it must meet 0 < icount < UF_CAPABILITY(64)", iCount);
- break;
- }
-
-@@ -987,7 +982,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpDataToFile(const char *szFil
- fprintf(File, "%s\n", UF_KEY_ID);
- fprintf(File, "\t0x%.8x\n", (uint32_t)(uintptr_t)pKeyTmp->pElem->UFKey);
- fprintf(File, "\t%s\n", pKeyTmp->pElem->pcKeyName);
-- for ( j = 0; j < (int32_t)pKeyTmp->pElem->ulValueNum; j ++ )
-+ for ( j = 0; j < pKeyTmp->pElem->ulValueNum; j ++ )
- {
- fprintf(File, "\t\t%s\n", UF_VALUE_ID);
- if ( strlen(pKeyTmp->pElem->pValueArray[j].pcValueName) > 0 )
-@@ -1015,10 +1010,9 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureDumpDataToFile(const char *szFil
- break;
- } //switch (pKeyTmp->pElem->pValueArray[j].ulValueType)
- }
-- } // for ( j = 0; j < (int32_t)pKeyTmp->pElem->ulValueNum; j ++ )
-+ } // for ( j = 0; j < pKeyTmp->pElem->ulValueNum; j ++ )
- } //for (pKeyTmp = pKeyList; pKeyTmp; pKeyTmp = pKeyTmp->pNext)
- fclose(File);
-- MosUtilities::MosUserFeatureNotifyChangeKeyValue(nullptr, false, nullptr, true);
-
- return MOS_STATUS_SUCCESS;
- }
-@@ -1055,12 +1049,10 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSetValue(
- MOS_UF_KEY NewKey;
- MOS_UF_VALUE NewValue;
- MOS_STATUS eStatus;
-- MOS_PUF_KEYLIST pKeyList;
-
- eStatus = MOS_STATUS_UNKNOWN;
-- pKeyList = nullptr;
-
-- if ( (strKey== nullptr) || (pcValueName == nullptr) )
-+ if ((strKey == nullptr) || (pcValueName == nullptr) || (m_ufKeyList == nullptr))
- {
- return MOS_STATUS_INVALID_PARAMETER;
- }
-@@ -1083,18 +1075,11 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSetValue(
- NewKey.pValueArray = &NewValue;
- NewKey.ulValueNum = 1;
-
-- if ((eStatus = UserFeatureDumpFile(m_szUserFeatureFile, &pKeyList)) != MOS_STATUS_SUCCESS)
-+ if ( ( eStatus = UserFeatureSet(&MosUtilitiesSpecificNext::m_ufKeyList, NewKey)) == MOS_STATUS_SUCCESS )
- {
-- UserFeatureFreeKeyList(pKeyList);
-- return eStatus;
-+ MosUtilities::MosUserFeatureNotifyChangeKeyValue(nullptr, false, nullptr, true);
- }
-
-- if ( ( eStatus = UserFeatureSet(&pKeyList, NewKey)) == MOS_STATUS_SUCCESS )
-- {
-- eStatus = UserFeatureDumpDataToFile(m_szUserFeatureFile, pKeyList);
-- }
--
-- UserFeatureFreeKeyList(pKeyList);
- return eStatus;
- }
-
-@@ -1114,9 +1099,9 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureQueryValue(
- char strTempValueName[MAX_USERFEATURE_LINE_LENGTH];
-
- eStatus = MOS_STATUS_UNKNOWN;
-- pKeyList = nullptr;
-+ pKeyList = MosUtilitiesSpecificNext::m_ufKeyList;
-
-- if ( (strKey == nullptr) || (pcValueName == nullptr))
-+ if ( (strKey == nullptr) || (pcValueName == nullptr) || (pKeyList == nullptr))
- {
- return MOS_STATUS_INVALID_PARAMETER;
- }
-@@ -1129,21 +1114,17 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureQueryValue(
- NewKey.pValueArray = &NewValue;
- NewKey.ulValueNum = 1;
-
-- if ((eStatus = UserFeatureDumpFile(m_szUserFeatureFile, &pKeyList)) == MOS_STATUS_SUCCESS)
-+ if ( (eStatus = UserFeatureQuery(pKeyList, &NewKey)) == MOS_STATUS_SUCCESS )
- {
-- if ( (eStatus = UserFeatureQuery(pKeyList, &NewKey)) == MOS_STATUS_SUCCESS )
-+ if(uiValueType != nullptr)
- {
-- if(uiValueType != nullptr)
-- {
-- *uiValueType = NewKey.pValueArray[0].ulValueType;
-- }
-- if (nDataSize != nullptr)
-- {
-- *nDataSize = NewKey.pValueArray[0].ulValueLen;
-- }
-+ *uiValueType = NewKey.pValueArray[0].ulValueType;
-+ }
-+ if (nDataSize != nullptr)
-+ {
-+ *nDataSize = NewKey.pValueArray[0].ulValueLen;
- }
- }
-- UserFeatureFreeKeyList(pKeyList);
-
- return eStatus;
- }
-@@ -1155,16 +1136,9 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureGetKeyIdbyName(const char *pcKe
- MOS_STATUS eStatus;
- MOS_PUF_KEYLIST pTempNode;
-
-- pKeyList = nullptr;
-+ pKeyList = MosUtilitiesSpecificNext::m_ufKeyList;
- iResult = -1;
-
-- if ((eStatus = UserFeatureDumpFile(m_szUserFeatureFile, &pKeyList)) !=
-- MOS_STATUS_SUCCESS )
-- {
-- UserFeatureFreeKeyList(pKeyList);
-- return eStatus;
-- }
--
- eStatus = MOS_STATUS_INVALID_PARAMETER;
-
- for(pTempNode=pKeyList; pTempNode; pTempNode=pTempNode->pNext)
-@@ -1177,7 +1151,6 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureGetKeyIdbyName(const char *pcKe
- break;
- }
- }
-- UserFeatureFreeKeyList(pKeyList);
-
- return eStatus;
- }
-@@ -1188,7 +1161,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureGetKeyNamebyId(void *UFKey, cha
- MOS_PUF_KEYLIST pTempNode;
- MOS_STATUS eStatus;
-
-- pKeyList = nullptr;
-+ pKeyList = MosUtilitiesSpecificNext::m_ufKeyList;
-
- switch((uintptr_t)UFKey)
- {
-@@ -1201,13 +1174,6 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureGetKeyNamebyId(void *UFKey, cha
- eStatus = MOS_STATUS_SUCCESS;
- break;
- default:
-- if ((eStatus = UserFeatureDumpFile(m_szUserFeatureFile, &pKeyList)) !=
-- MOS_STATUS_SUCCESS )
-- {
-- UserFeatureFreeKeyList(pKeyList);
-- return eStatus;
-- }
--
- eStatus = MOS_STATUS_UNKNOWN;
-
- for(pTempNode=pKeyList;pTempNode;pTempNode=pTempNode->pNext)
-@@ -1219,7 +1185,6 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureGetKeyNamebyId(void *UFKey, cha
- break;
- }
- }
-- UserFeatureFreeKeyList(pKeyList);
- break;
- }
-
-@@ -1364,6 +1329,7 @@ MOS_STATUS MosUtilities::MosOsUtilitiesInit(MOS_CONTEXT_HANDLE mosCtx)
- //Init MOS User Feature Key from mos desc table
- eStatus = MosDeclareUserFeatureKeysForAllDescFields();
-
-+ MosUtilitiesSpecificNext::UserFeatureDumpFile(MosUtilitiesSpecificNext::m_szUserFeatureFile, &MosUtilitiesSpecificNext::m_ufKeyList);
- #if _MEDIA_RESERVED
- m_codecUserFeatureExt = new CodechalUserSettingsMgr();
- m_vpUserFeatureExt = new VphalUserSettingsMgr();
-@@ -1425,6 +1391,9 @@ MOS_STATUS MosUtilities::MosOsUtilitiesClose(MOS_CONTEXT_HANDLE mosCtx)
- // so if there still is another active lib instance, logs would still be printed.
- MosUtilDebug::MosMessageClose();
- #endif
-+ MosUtilitiesSpecificNext::UserFeatureDumpDataToFile(MosUtilitiesSpecificNext::m_szUserFeatureFile, MosUtilitiesSpecificNext::m_ufKeyList);
-+ MosUtilitiesSpecificNext::UserFeatureFreeKeyList(MosUtilitiesSpecificNext::m_ufKeyList);
-+ MosUtilitiesSpecificNext::m_ufKeyList = nullptr;
- }
- m_mutexLock.Unlock();
- return eStatus;
-diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.h b/media_softlet/linux/common/os/mos_utilities_specific_next.h
-index 792123a6..878ce4e6 100644
---- a/media_softlet/linux/common/os/mos_utilities_specific_next.h
-+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.h
-@@ -110,6 +110,41 @@ static MOS_STATUS MosUserFeatureOpenKeyFile(
- uint32_t samDesired,
- void **phkResult);
-
-+/*----------------------------------------------------------------------------
-+ | Name : UserFeatureDumpFile
-+ | Purpose : This function read the whole User Feature File and dump User Feature File
-+ | data to key linked list.
-+ | Arguments : szFileName [in] User Feature File name.
-+ | pKeyList [out] Key Linked list.
-+ | Returns : MOS_STATUS_SUCCESS Operation success.
-+ | MOS_STATUS_USER_FEATURE_KEY_READ_FAILED User Feature File can't be open as read.
-+ | MOS_STATUS_NO_SPACE no space left for allocate
-+ | MOS_STATUS_UNKNOWN unknown user feature type found in User Feature File
-+ | MOS_STATUS_INVALID_PARAMETER unknown items found in User Feature File
-+ | Comments :
-+ \---------------------------------------------------------------------------*/
-+static MOS_STATUS UserFeatureDumpFile(const char *const szFileName, MOS_PUF_KEYLIST *pKeyList);
-+
-+/*----------------------------------------------------------------------------
-+| Name : UserFeatureDumpDataToFile
-+| Purpose : This function dump key linked list data to File.
-+| Arguments : szFileName [in] A handle to the File.
-+| pKeyList [in] Reserved, any LPDWORD type value.
-+| Returns : MOS_STATUS_SUCCESS Operation success.
-+| MOS_STATUS_USER_FEATURE_KEY_WRITE_FAILED File can't be written.
-+| Comments :
-+\---------------------------------------------------------------------------*/
-+
-+static MOS_STATUS UserFeatureDumpDataToFile(const char *szFileName, MOS_PUF_KEYLIST pKeyList);
-+
-+/*----------------------------------------------------------------------------
-+| Name : UserFeatureFreeKeyList
-+| Purpose : Free key list
-+| Arguments : pKeyList [in] key list to be free.
-+| Returns : None
-+| Comments :
-+\---------------------------------------------------------------------------*/
-+static void UserFeatureFreeKeyList(MOS_PUF_KEYLIST pKeyList);
-
- private:
-
-@@ -174,41 +209,6 @@ private:
-
- static MOS_STATUS UserFeatureReadNextTokenFromFile(FILE *pFile, const char *szFormat, char *szToken);
-
-- /*----------------------------------------------------------------------------
-- | Name : UserFeatureDumpFile
-- | Purpose : This function read the whole User Feature File and dump User Feature File
-- | data to key linked list.
-- | Arguments : szFileName [in] User Feature File name.
-- | pKeyList [out] Key Linked list.
-- | Returns : MOS_STATUS_SUCCESS Operation success.
-- | MOS_STATUS_USER_FEATURE_KEY_READ_FAILED User Feature File can't be open as read.
-- | MOS_STATUS_NO_SPACE no space left for allocate
-- | MOS_STATUS_UNKNOWN unknown user feature type found in User Feature File
-- | MOS_STATUS_INVALID_PARAMETER unknown items found in User Feature File
-- | Comments :
-- \---------------------------------------------------------------------------*/
-- static MOS_STATUS UserFeatureDumpFile(const char * const szFileName, MOS_PUF_KEYLIST* pKeyList);
--
-- /*----------------------------------------------------------------------------
-- | Name : UserFeatureDumpDataToFile
-- | Purpose : This function dump key linked list data to File.
-- | Arguments : szFileName [in] A handle to the File.
-- | pKeyList [in] Reserved, any LPDWORD type value.
-- | Returns : MOS_STATUS_SUCCESS Operation success.
-- | MOS_STATUS_USER_FEATURE_KEY_WRITE_FAILED File can't be written.
-- | Comments :
-- \---------------------------------------------------------------------------*/
-- static MOS_STATUS UserFeatureDumpDataToFile(const char *szFileName, MOS_PUF_KEYLIST pKeyList);
--
-- /*----------------------------------------------------------------------------
-- | Name : UserFeatureFreeKeyList
-- | Purpose : Free key list
-- | Arguments : pKeyList [in] key list to be free.
-- | Returns : None
-- | Comments :
-- \---------------------------------------------------------------------------*/
-- static void UserFeatureFreeKeyList(MOS_PUF_KEYLIST pKeyList);
--
- /*----------------------------------------------------------------------------
- | Name : UserFeatureSetValue
- | Purpose : Modify or add a value of the specified user feature key.
-@@ -290,6 +290,7 @@ private:
-
- public:
- static const char* m_szUserFeatureFile;
-+ static MOS_PUF_KEYLIST m_ufKeyList;
- static int32_t m_mosTraceFd;
- static const char* const m_mosTracePath;
- static std::map<std::string, std::map<std::string, std::string>> m_regBuffer;
---
-2.31.1
-
diff --git a/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch b/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch
deleted file mode 100644
index e513e0aa..00000000
--- a/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 437e63b6c35eb5d12aac18d7f76ce1a702ad16e0 Mon Sep 17 00:00:00 2001
-From: Lim Siew Hoon <siew.hoon.lim@intel.com>
-Date: Thu, 2 Dec 2021 15:50:33 +0000
-Subject: [PATCH] [Media Common] Fix the user setting memory free
-
-From 4b8a411f2b8df112cbb5dbf8562735700cd15cf1 Mon Sep 17 00:00:00 2001
-From: "Wang, Pingli" <pingli.wang@intel.com>
-Date: Thu, 2 Dec 2021 17:57:50 +0800
-Subject: [PATCH] [Media Common]Fix the user setting memory free
-
-This commit fix the #1300
-
-Signed-off-by: Wang, Pingli <pingli.wang@intel.com>
-
-This patch was imported from iHD media-driver git server
-(https://github.com/intel/media-driver.git) as of pull request
-https://github.com/intel/media-driver/pull/1305.
-
-Upstream-status: Submitted
-
-Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
----
- media_softlet/linux/common/os/mos_utilities_specific_next.cpp | 4 ++++
- media_softlet/linux/common/os/mos_utilities_specific_next.h | 4 ++++
- 2 files changed, 8 insertions(+)
-
-diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-index 584ba086..c138cb08 100644
---- a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
-@@ -70,6 +70,7 @@ double MosUtilities::MosGetTime()
- //!
- const char *const MosUtilitiesSpecificNext::m_mosTracePath = "/sys/kernel/debug/tracing/trace_marker_raw";
- int32_t MosUtilitiesSpecificNext::m_mosTraceFd = -1;
-+MosMutex MosUtilitiesSpecificNext::m_userSettingMutex;
-
- std::map<std::string, std::map<std::string, std::string>> MosUtilitiesSpecificNext::m_regBuffer;
-
-@@ -612,6 +613,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
- MOS_AtomicIncrement(&MosUtilities::m_mosMemAllocFakeCounter); //ulValueBuf does not count it, because it is freed after the MEMNJA final report.
- MOS_OS_NORMALMESSAGE("ulValueBuf %p for key %s", ulValueBuf, NewKey.pValueArray[0].pcValueName);
-
-+ m_userSettingMutex.Lock();
- if ( (iPos = UserFeatureFindValue(*Key, NewKey.pValueArray[0].pcValueName)) == NOT_FOUND)
- {
- //not found, add a new value to key struct.
-@@ -620,6 +622,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
- if (iPos >= UF_CAPABILITY)
- {
- MOS_OS_ASSERTMESSAGE("user setting value icount %d must less than UF_CAPABILITY(64)", iPos);
-+ m_userSettingMutex.Unlock();
- return MOS_STATUS_USER_FEATURE_KEY_READ_FAILED;
- }
-
-@@ -646,6 +649,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
- NewKey.pValueArray[0].ulValueBuf,
- NewKey.pValueArray[0].ulValueLen);
-
-+ m_userSettingMutex.Unlock();
- return MOS_STATUS_SUCCESS;
- }
-
-diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.h b/media_softlet/linux/common/os/mos_utilities_specific_next.h
-index 878ce4e6..57e505d0 100644
---- a/media_softlet/linux/common/os/mos_utilities_specific_next.h
-+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.h
-@@ -30,6 +30,8 @@
- #include "mos_defs.h"
- #include "mos_utilities_specific.h"
-
-+class MosMutex;
-+
- class MosUtilitiesSpecificNext
- {
- public:
-@@ -294,5 +296,7 @@ public:
- static int32_t m_mosTraceFd;
- static const char* const m_mosTracePath;
- static std::map<std::string, std::map<std::string, std::string>> m_regBuffer;
-+private:
-+ static MosMutex m_userSettingMutex;
- };
- #endif // __MOS_UTILITIES_SPECIFIC_NEXT_H__
---
-2.31.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.3.5.bb b/recipes-multimedia/libva/intel-media-driver_23.4.3.bb
index dc6cd8cb..6513d574 100644
--- a/recipes-multimedia/libva/intel-media-driver_21.3.5.bb
+++ b/recipes-multimedia/libva/intel-media-driver_23.4.3.bb
@@ -19,11 +19,20 @@ REQUIRED_DISTRO_FEATURES = "opengl"
DEPENDS += "libva gmmlib"
SRC_URI = "git://github.com/intel/media-driver.git;protocol=https;nobranch=1 \
- file://0001-MOS-user-setting-reentrant.patch \
- file://0001-Media-Common-Fix-the-user-setting-memory-free.patch \
+ 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 = "ec4dc5d653733c21f8bf390794674052b5abdb09"
+SRCREV = "a9f272496fc0f3e823cc4a814666ea27b443d902"
S = "${WORKDIR}/git"
COMPATIBLE_HOST:x86-x32 = "null"
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 8956bd04..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;branch=master;protocol=https \
- 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 ad84bb4f..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;protocol=https \
-"
-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/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.3.5.bb b/recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb
index 27fd4ab2..f00a4404 100644
--- a/recipes-multimedia/mediasdk/intel-mediasdk_21.3.5.bb
+++ b/recipes-multimedia/mediasdk/intel-mediasdk_23.2.2.bb
@@ -17,7 +17,9 @@ 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,15 +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://fix-gcc13.patch \
"
-SRCREV = "2b2922e15f353bc542d64f8ef15a248d88bfd2ce"
+SRCREV = "869b60a6c3d7b5e9f7c3b3b914986322dca4bbae"
S = "${WORKDIR}/git"
UPSTREAM_CHECK_GITTAGREGEX = "^intel-mediasdk-(?P<pver>(\d+(\.\d+)+))$"
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/0001-AVCd-Add-frame-info-check-and-update-ChromaFormat-in.patch b/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-AVCd-Add-frame-info-check-and-update-ChromaFormat-in.patch
deleted file mode 100644
index 3c41c741..00000000
--- a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-AVCd-Add-frame-info-check-and-update-ChromaFormat-in.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From f23ba1b768a4db58ed985a0f066b65d9a65dd61b Mon Sep 17 00:00:00 2001
-From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
-Date: Mon, 1 Nov 2021 13:28:06 +0000
-Subject: [PATCH 2/2] [AVCd] Add frame info check and update ChromaFormat in
- FillOutputSurface for VDSFC CSC
-
-Upstream-Status: Submitted
-innersource PR #3871
-
-Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
----
- .../decode/h264/src/mfx_h264_dec_decode.cpp | 48 +++++++++----------
- 1 file changed, 24 insertions(+), 24 deletions(-)
-
-diff --git a/_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp b/_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp
-index 84e57f7f18..8e51ad7852 100644
---- a/_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp
-+++ b/_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp
-@@ -1140,12 +1140,8 @@ mfxStatus VideoDECODEH264::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
- isVideoProcCscEnabled = true;
- }
- #endif
-- sts = CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_AVC);
-- //Decode CSC support more FourCC format, already checked in Init, skip the check return;
-- if(!isVideoProcCscEnabled)
-- {
-- MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_UNSUPPORTED);
-- }
-+ sts = isVideoProcCscEnabled ? CheckFrameInfoDecVideoProcCsc(&surface_work->Info, MFX_CODEC_AVC) : CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_AVC);
-+ MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_INVALID_VIDEO_PARAM)
-
- sts = CheckFrameData(surface_work);
- MFX_CHECK_STS(sts);
-@@ -1420,11 +1416,6 @@ void VideoDECODEH264::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
- }
- #endif
-
-- surface_out->Info.CropH = (mfxU16)(pFrame->lumaSize().height - pFrame->m_crop_bottom - pFrame->m_crop_top);
-- surface_out->Info.CropW = (mfxU16)(pFrame->lumaSize().width - pFrame->m_crop_right - pFrame->m_crop_left);
-- surface_out->Info.CropX = (mfxU16)(pFrame->m_crop_left);
-- surface_out->Info.CropY = (mfxU16)(pFrame->m_crop_top);
--
- #ifndef MFX_DEC_VIDEO_POSTPROCESS_DISABLE
- mfxExtDecVideoProcessing * videoProcessing = (mfxExtDecVideoProcessing *)GetExtendedBuffer(m_vFirstPar.ExtParam, m_vFirstPar.NumExtParam, MFX_EXTBUFF_DEC_VIDEO_PROCESSING);
- if (videoProcessing)
-@@ -1433,8 +1424,28 @@ void VideoDECODEH264::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
- surface_out->Info.CropW = videoProcessing->Out.CropW;
- surface_out->Info.CropX = videoProcessing->Out.CropX;
- surface_out->Info.CropY = videoProcessing->Out.CropY;
-- }
-+ surface_out->Info.ChromaFormat = videoProcessing->Out.ChromaFormat;
-+ } else
- #endif
-+ {
-+ surface_out->Info.CropH = (mfxU16)(pFrame->lumaSize().height - pFrame->m_crop_bottom - pFrame->m_crop_top);
-+ surface_out->Info.CropW = (mfxU16)(pFrame->lumaSize().width - pFrame->m_crop_right - pFrame->m_crop_left);
-+ surface_out->Info.CropX = (mfxU16)(pFrame->m_crop_left);
-+ surface_out->Info.CropY = (mfxU16)(pFrame->m_crop_top);
-+
-+ switch(pFrame->m_chroma_format)
-+ {
-+ case 0:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV400;
-+ break;
-+ case 2:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-+ break;
-+ default:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ break;
-+ }
-+ }
-
- bool isShouldUpdate = !(m_vFirstPar.mfx.FrameInfo.AspectRatioH || m_vFirstPar.mfx.FrameInfo.AspectRatioW);
-
-@@ -1447,18 +1458,7 @@ void VideoDECODEH264::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
- surface_out->Info.FrameRateExtN = isShouldUpdate ? m_vPar.mfx.FrameInfo.FrameRateExtN : m_vFirstPar.mfx.FrameInfo.FrameRateExtN;
-
- surface_out->Info.PicStruct = 0;
-- switch(pFrame->m_chroma_format)
-- {
-- case 0:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV400;
-- break;
-- case 2:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-- break;
-- default:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-- break;
-- }
-+
-
- switch (pFrame->m_displayPictureStruct)
- {
---
-2.33.1
-
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-Adding-missing-device-ID-4692-for-ADL-S.patch b/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-Adding-missing-device-ID-4692-for-ADL-S.patch
deleted file mode 100644
index 9d8577bc..00000000
--- a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-Adding-missing-device-ID-4692-for-ADL-S.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 1579b536f1a82fb7c80f49fc7b76cda65b8bd18e Mon Sep 17 00:00:00 2001
-From: "Teng, Jin Chung" <jin.chung.teng@intel.com>
-Date: Thu, 28 Oct 2021 13:49:58 +0800
-Subject: [PATCH] Adding missing device ID 4692 for ADL-S
-
-Upstream-Status: Submitted
-innersource PR #3717
-
-[Internal]
-Issue:-
-Test:-
-OSPR:N/A
-
-Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
----
- _studio/shared/include/mfxstructures-int.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/_studio/shared/include/mfxstructures-int.h b/_studio/shared/include/mfxstructures-int.h
-index c71f126..fa1329d 100755
---- a/_studio/shared/include/mfxstructures-int.h
-+++ b/_studio/shared/include/mfxstructures-int.h
-@@ -427,6 +427,7 @@ typedef struct {
- { 0x4683, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
- { 0x4690, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
- { 0x4691, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
-+ { 0x4692, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
- { 0x4693, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
- { 0x4698, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
- { 0x4699, MFX_HW_ADL_S, MFX_GT1 },//ADL-S
---
-2.7.4
-
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-HEVCd-Add-frame-info-check-and-update-ChromaFormat-i.patch b/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-HEVCd-Add-frame-info-check-and-update-ChromaFormat-i.patch
deleted file mode 100644
index 69ce1369..00000000
--- a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-HEVCd-Add-frame-info-check-and-update-ChromaFormat-i.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From 99160958668fd4a170cd749492e37ebdb28dae69 Mon Sep 17 00:00:00 2001
-From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
-Date: Thu, 23 Sep 2021 21:34:16 +0000
-Subject: [PATCH 1/2] [HEVCd] Add frame info check and update ChromaFormat in
- FillOutputSurface for VDSFC CSC
-
-Upstream-Status: Submitted
-innersource PR #3871
-
-Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
----
- .../decode/h265/src/mfx_h265_dec_decode.cpp | 64 +++++++++++--------
- .../mfx_lib/shared/include/mfx_common_int.h | 1 +
- _studio/mfx_lib/shared/src/mfx_common_int.cpp | 33 ++++++++++
- 3 files changed, 71 insertions(+), 27 deletions(-)
-
-diff --git a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
-index fe2bcf2c3f..362ad257d6 100644
---- a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
-+++ b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
-@@ -963,8 +963,16 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
-
- if (surface_work)
- {
-- sts = CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_HEVC);
-- MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_INVALID_VIDEO_PARAM);
-+ bool isVideoProcCscEnabled = false;
-+#ifndef MFX_DEC_VIDEO_POSTPROCESS_DISABLE
-+ mfxExtDecVideoProcessing* videoProcessing = (mfxExtDecVideoProcessing*)GetExtendedBuffer(m_vInitPar.ExtParam, m_vInitPar.NumExtParam, MFX_EXTBUFF_DEC_VIDEO_PROCESSING);
-+ if (videoProcessing && videoProcessing->Out.FourCC != m_vPar.mfx.FrameInfo.FourCC)
-+ {
-+ isVideoProcCscEnabled = true;
-+ }
-+#endif
-+ sts = isVideoProcCscEnabled ? CheckFrameInfoDecVideoProcCsc(&surface_work->Info, MFX_CODEC_HEVC) : CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_HEVC);
-+ MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_INVALID_VIDEO_PARAM)
-
- sts = CheckFrameData(surface_work);
- MFX_CHECK_STS(sts);
-@@ -1172,11 +1180,6 @@ void VideoDECODEH265::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
-
- surface_out->Info.FrameId.TemporalId = 0;
-
-- surface_out->Info.CropH = (mfxU16)(pFrame->lumaSize().height - pFrame->m_crop_bottom - pFrame->m_crop_top);
-- surface_out->Info.CropW = (mfxU16)(pFrame->lumaSize().width - pFrame->m_crop_right - pFrame->m_crop_left);
-- surface_out->Info.CropX = (mfxU16)(pFrame->m_crop_left);
-- surface_out->Info.CropY = (mfxU16)(pFrame->m_crop_top);
--
- #ifndef MFX_DEC_VIDEO_POSTPROCESS_DISABLE
- mfxExtDecVideoProcessing * videoProcessing = (mfxExtDecVideoProcessing *)GetExtendedBuffer(m_vFirstPar.ExtParam, m_vFirstPar.NumExtParam, MFX_EXTBUFF_DEC_VIDEO_PROCESSING);
- if (videoProcessing)
-@@ -1185,8 +1188,35 @@ void VideoDECODEH265::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
- surface_out->Info.CropW = videoProcessing->Out.CropW;
- surface_out->Info.CropX = videoProcessing->Out.CropX;
- surface_out->Info.CropY = videoProcessing->Out.CropY;
-+ surface_out->Info.ChromaFormat = videoProcessing->Out.ChromaFormat;
- }
-+ else
- #endif
-+ {
-+ surface_out->Info.CropH = (mfxU16)(pFrame->lumaSize().height - pFrame->m_crop_bottom - pFrame->m_crop_top);
-+ surface_out->Info.CropW = (mfxU16)(pFrame->lumaSize().width - pFrame->m_crop_right - pFrame->m_crop_left);
-+ surface_out->Info.CropX = (mfxU16)(pFrame->m_crop_left);
-+ surface_out->Info.CropY = (mfxU16)(pFrame->m_crop_top);
-+
-+ switch(pFrame->m_chroma_format)
-+ {
-+ case 0:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV400;
-+ break;
-+ case 1:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ break;
-+ case 2:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-+ break;
-+ case 3:
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-+ break;
-+ default:
-+ VM_ASSERT(!"Unknown chroma format");
-+ surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ }
-+ }
-
- bool isShouldUpdate = !(m_vFirstPar.mfx.FrameInfo.AspectRatioH || m_vFirstPar.mfx.FrameInfo.AspectRatioW);
-
-@@ -1198,26 +1228,6 @@ void VideoDECODEH265::FillOutputSurface(mfxFrameSurface1 **surf_out, mfxFrameSur
- surface_out->Info.FrameRateExtD = isShouldUpdate ? m_vPar.mfx.FrameInfo.FrameRateExtD : m_vFirstPar.mfx.FrameInfo.FrameRateExtD;
- surface_out->Info.FrameRateExtN = isShouldUpdate ? m_vPar.mfx.FrameInfo.FrameRateExtN : m_vFirstPar.mfx.FrameInfo.FrameRateExtN;
-
-- surface_out->Info.PicStruct = 0;
-- switch(pFrame->m_chroma_format)
-- {
-- case 0:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV400;
-- break;
-- case 1:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-- break;
-- case 2:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-- break;
-- case 3:
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-- break;
-- default:
-- VM_ASSERT(!"Unknown chroma format");
-- surface_out->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-- }
--
- surface_out->Info.PicStruct =
- UMC2MFX_PicStruct(pFrame->m_DisplayPictureStruct_H265, !!m_vPar.mfx.ExtendedPicStruct);
-
-diff --git a/_studio/mfx_lib/shared/include/mfx_common_int.h b/_studio/mfx_lib/shared/include/mfx_common_int.h
-index 4f12ddb883..73f4667a18 100644
---- a/_studio/mfx_lib/shared/include/mfx_common_int.h
-+++ b/_studio/mfx_lib/shared/include/mfx_common_int.h
-@@ -29,6 +29,7 @@
-
- mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId);
- mfxStatus CheckFrameInfoEncoders(mfxFrameInfo *info);
-+mfxStatus CheckFrameInfoDecVideoProcCsc(mfxFrameInfo *info, mfxU32 codecId);
- mfxStatus CheckFrameInfoCodecs(mfxFrameInfo *info, mfxU32 codecId = MFX_CODEC_AVC);
-
- mfxStatus CheckVideoParamEncoders(mfxVideoParam *in, eMFXHWType type);
-diff --git a/_studio/mfx_lib/shared/src/mfx_common_int.cpp b/_studio/mfx_lib/shared/src/mfx_common_int.cpp
-index 1142457f00..4f2126d944 100644
---- a/_studio/mfx_lib/shared/src/mfx_common_int.cpp
-+++ b/_studio/mfx_lib/shared/src/mfx_common_int.cpp
-@@ -163,6 +163,39 @@ mfxStatus CheckFrameInfoEncoders(mfxFrameInfo *info)
- return MFX_ERR_NONE;
- }
-
-+mfxStatus CheckFrameInfoDecVideoProcCsc(mfxFrameInfo *info, mfxU32 codecId)
-+{
-+ mfxStatus sts = CheckFrameInfoCommon(info, codecId);
-+ MFX_CHECK_STS(sts);
-+
-+ switch(info->FourCC) {
-+ case MFX_FOURCC_NV12:
-+ case MFX_FOURCC_P010:
-+ case MFX_FOURCC_P016:
-+ if (info->ChromaFormat == MFX_CHROMAFORMAT_YUV420)
-+ return MFX_ERR_NONE;
-+ MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
-+
-+ case MFX_FOURCC_YUY2:
-+ case MFX_FOURCC_Y210:
-+ case MFX_FOURCC_Y216:
-+ if (info->ChromaFormat == MFX_CHROMAFORMAT_YUV422)
-+ return MFX_ERR_NONE;
-+ MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
-+
-+ case MFX_FOURCC_AYUV:
-+ case MFX_FOURCC_Y410:
-+ case MFX_FOURCC_Y416:
-+ case MFX_FOURCC_RGB4:
-+ if (info->ChromaFormat == MFX_CHROMAFORMAT_YUV444)
-+ return MFX_ERR_NONE;
-+ MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
-+
-+ default:
-+ MFX_RETURN(MFX_ERR_UNSUPPORTED);
-+ }
-+}
-+
- mfxStatus CheckFrameInfoCodecs(mfxFrameInfo *info, mfxU32 codecId)
- {
- mfxStatus sts = CheckFrameInfoCommon(info, codecId);
---
-2.33.1
-
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-jpegd-Enable-JPEG-decode-error-report.patch b/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-jpegd-Enable-JPEG-decode-error-report.patch
deleted file mode 100644
index 21482ed7..00000000
--- a/recipes-multimedia/onevpl/onevpl-intel-gpu/0001-jpegd-Enable-JPEG-decode-error-report.patch
+++ /dev/null
@@ -1,502 +0,0 @@
-From fe25ec3db9a48308bd6d3e9fe800e67335f8a369 Mon Sep 17 00:00:00 2001
-From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
-Date: Mon, 4 Oct 2021 13:56:08 +0800
-Subject: [PATCH] [jpegd] Enable JPEG decode error report
-
-Upstream-Status: Submitted
-innersource PR #3318
-
-[Internal]
- Issue: NA
- Test: manual. Gst-MSDK with mfxExtDecodeErrorReport
- OSPR: N/A
-
-Signed-off-by: Cheah, Vincent Beng Keat vincent.beng.keat.cheah@intel.com>
----
- .../mjpeg/include/mfx_mjpeg_dec_decode.h | 2 ++
- .../decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp | 19 ++++++++++-
- .../umc/codec/jpeg_dec/include/jpegdec.h | 1 +
- .../umc/codec/jpeg_dec/include/jpegdec_base.h | 19 +++++++++++
- .../jpeg_dec/include/umc_mjpeg_mfx_decode.h | 2 +-
- .../include/umc_mjpeg_mfx_decode_base.h | 4 +--
- .../shared/umc/codec/jpeg_dec/src/jpegdec.cpp | 17 ++++++++--
- .../umc/codec/jpeg_dec/src/jpegdec_base.cpp | 29 +++++++++++++++-
- .../jpeg_dec/src/umc_mjpeg_mfx_decode.cpp | 6 ++--
- .../src/umc_mjpeg_mfx_decode_base.cpp | 6 ++--
- api/vpl/mfxstructures.h | 33 +++++++++++++++----
- 11 files changed, 121 insertions(+), 17 deletions(-)
-
-diff --git a/_studio/mfx_lib/decode/mjpeg/include/mfx_mjpeg_dec_decode.h b/_studio/mfx_lib/decode/mjpeg/include/mfx_mjpeg_dec_decode.h
-index c6641d3e71..a2ea6b5cec 100644
---- a/_studio/mfx_lib/decode/mjpeg/include/mfx_mjpeg_dec_decode.h
-+++ b/_studio/mfx_lib/decode/mjpeg/include/mfx_mjpeg_dec_decode.h
-@@ -37,6 +37,7 @@
- #endif
-
- #include "mfx_task.h"
-+#include "umc_media_data.h"
-
- #include "mfx_vpp_jpeg.h"
-
-@@ -46,6 +47,7 @@ namespace UMC
- class JpegFrameConstructor;
- class MediaDataEx;
- class FrameData;
-+ class MediaData;
- };
-
- class VideoDECODEMJPEGBase
-diff --git a/_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp b/_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp
-index 3769fe8a72..0775fbb1be 100644
---- a/_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp
-+++ b/_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp
-@@ -456,6 +456,14 @@ mfxStatus VideoDECODEMJPEG::DecodeHeader(VideoCORE *core, mfxBitstream *bs, mfxV
- UMC::Status umcRes = decoder.Init(&umcVideoParams);
- MFX_CHECK_INIT(umcRes == UMC::UMC_OK);
-
-+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
-+
-+ if (extbuf)
-+ {
-+ reinterpret_cast<mfxExtDecodeErrorReport *>(extbuf)->ErrorTypes = 0;
-+ in.SetExtBuffer(extbuf);
-+ }
-+
- umcRes = decoder.DecodeHeader(&in);
-
- in.Save(bs);
-@@ -770,6 +778,14 @@ mfxStatus VideoDECODEMJPEG::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1
- MFXMediaDataAdapter src(bs);
- UMC::MediaDataEx *pSrcData;
-
-+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
-+
-+ if (extbuf)
-+ {
-+ reinterpret_cast<mfxExtDecodeErrorReport *>(extbuf)->ErrorTypes = 0;
-+ src.SetExtBuffer(extbuf);
-+ }
-+
- if (!m_isHeaderFound && bs)
- {
- umcRes = pMJPEGVideoDecoder->FindStartOfImage(&src);
-@@ -785,7 +801,8 @@ mfxStatus VideoDECODEMJPEG::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1
-
- if (!m_isHeaderParsed && bs)
- {
-- umcRes = pMJPEGVideoDecoder->_GetFrameInfo((uint8_t*)src.GetDataPointer(), src.GetDataSize());
-+ umcRes = pMJPEGVideoDecoder->_GetFrameInfo((uint8_t*)src.GetDataPointer(), src.GetDataSize(), &src);
-+
- if (umcRes != UMC::UMC_OK)
- {
- if(umcRes != UMC::UMC_ERR_NOT_ENOUGH_DATA)
-diff --git a/_studio/shared/umc/codec/jpeg_dec/include/jpegdec.h b/_studio/shared/umc/codec/jpeg_dec/include/jpegdec.h
-index 1e70931284..561e1c2889 100644
---- a/_studio/shared/umc/codec/jpeg_dec/include/jpegdec.h
-+++ b/_studio/shared/umc/codec/jpeg_dec/include/jpegdec.h
-@@ -27,6 +27,7 @@
- #include "omp.h"
- #endif
- #include "jpegdec_base.h"
-+#include "umc_media_data.h"
-
- class CBaseStreamInput;
-
-diff --git a/_studio/shared/umc/codec/jpeg_dec/include/jpegdec_base.h b/_studio/shared/umc/codec/jpeg_dec/include/jpegdec_base.h
-index 5e9c139c2c..42647f871c 100644
---- a/_studio/shared/umc/codec/jpeg_dec/include/jpegdec_base.h
-+++ b/_studio/shared/umc/codec/jpeg_dec/include/jpegdec_base.h
-@@ -29,6 +29,13 @@
- #include "colorcomp.h"
- #include "membuffin.h"
- #include "bitstreamin.h"
-+#include "mfxstructures.h"
-+#include "umc_media_data.h"
-+
-+namespace UMC
-+{
-+ class MediaData;
-+};
-
- class CJPEGDecoderBase
- {
-@@ -146,6 +153,18 @@ public:
- JERRCODE SkipMarker(void);
-
- JERRCODE DetectSampling(void);
-+
-+ void SetDecodeErrorTypes(void);
-+
-+ void SetDecodeErrorReportParam(UMC::MediaData *in)
-+ {
-+ UMC::MediaData::AuxInfo* aux = (in) ? in->GetAuxInfo(MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
-+ m_pDecodeErrorReport = (aux) ? reinterpret_cast<mfxExtDecodeErrorReport*>(aux->ptr) : NULL;
-+ }
-+
-+protected:
-+ mfxExtDecodeErrorReport* m_pDecodeErrorReport;
-+
- };
-
- #endif // MFX_ENABLE_MJPEG_VIDEO_DECODE
-diff --git a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode.h b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode.h
-index fbe535cd95..2edd4d57a8 100644
---- a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode.h
-+++ b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode.h
-@@ -94,7 +94,7 @@ public:
- JCOLOR GetColorType();
-
- // All memory sizes should come in size_t type
-- Status _GetFrameInfo(const uint8_t* pBitStream, size_t nSize);
-+ Status _GetFrameInfo(const uint8_t* pBitStream, size_t nSize, MediaData *in);
-
- // Allocate the destination frame
- Status AllocateFrame() override;
-diff --git a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
-index 9cee49e9c1..90ce5888ea 100644
---- a/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
-+++ b/_studio/shared/umc/codec/jpeg_dec/include/umc_mjpeg_mfx_decode_base.h
-@@ -63,7 +63,7 @@ public:
- // Close decoding & free all allocated resources
- virtual Status Close(void);
-
-- virtual Status GetFrame(UMC::MediaDataEx *, UMC::FrameData** , const mfxU32 ) { return MFX_ERR_NONE; };
-+ virtual Status GetFrame(UMC::MediaDataEx *, UMC::FrameData** , const mfxU32) { return MFX_ERR_NONE; };
-
- virtual void SetFrameAllocator(FrameAllocator * frameAllocator);
-
-@@ -79,7 +79,7 @@ public:
- Status FindStartOfImage(MediaData * in);
-
- // All memory sizes should come in size_t type
-- Status _GetFrameInfo(const uint8_t* pBitStream, size_t nSize);
-+ Status _GetFrameInfo(const uint8_t* pBitStream, size_t nSize, MediaData *in);
-
- Status SetRotation(uint16_t rotation);
-
-diff --git a/_studio/shared/umc/codec/jpeg_dec/src/jpegdec.cpp b/_studio/shared/umc/codec/jpeg_dec/src/jpegdec.cpp
-index 127133ae4c..54441dc534 100644
---- a/_studio/shared/umc/codec/jpeg_dec/src/jpegdec.cpp
-+++ b/_studio/shared/umc/codec/jpeg_dec/src/jpegdec.cpp
-@@ -1120,6 +1120,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseAPP0();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1128,6 +1129,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseAPP1();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1136,6 +1138,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseAPP14();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1152,6 +1155,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDQT();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1160,6 +1164,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseSOF0();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1206,6 +1211,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDHT();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1214,6 +1220,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDRI();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1222,6 +1229,7 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseSOS(op);
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
-
-@@ -1231,7 +1239,10 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- {
- jerr = m_BitStreamIn.Seek(-(m_sos_len + 2));
- if(JPEG_OK != jerr)
-+ {
-+ SetDecodeErrorTypes();
- return jerr;
-+ }
- }
- else
- {
-@@ -1246,7 +1257,10 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- {
- jerr = ParseData();
- if(JPEG_OK != jerr)
-+ {
-+ SetDecodeErrorTypes();
- return jerr;
-+ }
-
- }
- break;
-@@ -1288,10 +1302,10 @@ JERRCODE CJPEGDecoder::ParseJPEGBitStream(JOPERATION op)
- default:
- TRC1("-> Unknown marker ",m_marker);
- TRC0("..Skipping");
-+ SetDecodeErrorTypes();
- jerr = SkipMarker();
- if(JPEG_OK != jerr)
- return jerr;
--
- break;
- }
- }
-@@ -4575,7 +4589,6 @@ JERRCODE CJPEGDecoder::ReadHeader(
- JERRCODE CJPEGDecoder::ReadData(void)
- {
- return ParseJPEGBitStream(JO_READ_DATA);
--
- } // CJPEGDecoder::ReadData(void)
-
- JERRCODE CJPEGDecoder::ReadData(uint32_t restartNum, uint32_t restartsToDecode)
-diff --git a/_studio/shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp b/_studio/shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp
-index d6244e827b..4409b51cee 100644
---- a/_studio/shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp
-+++ b/_studio/shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp
-@@ -282,6 +282,23 @@ JERRCODE CJPEGDecoderBase::DetectSampling(void)
- return JPEG_OK;
- } // CJPEGDecoderBase::DetectSampling()
-
-+void CJPEGDecoderBase::SetDecodeErrorTypes(void)
-+{
-+ if (!m_pDecodeErrorReport)
-+ return;
-+
-+ switch (m_marker)
-+ {
-+ case JM_APP0: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_APP0_MARKER; break;
-+ case JM_APP14: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_APP14_MARKER; break;
-+ case JM_DQT: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_DQT_MARKER; break;
-+ case JM_SOF0: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_SOF0_MARKER; break;
-+ case JM_DHT: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_DHT_MARKER; break;
-+ case JM_DRI: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_DRI_MARKER; break;
-+ case JM_SOS: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_SOS_MARKER; break;
-+ default: m_pDecodeErrorReport->ErrorTypes |= MFX_ERROR_JPEG_UNKNOWN_MARKER; break;
-+ };
-+}
-
- JERRCODE CJPEGDecoderBase::NextMarker(JMARKER* marker)
- {
-@@ -1265,6 +1282,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseAPP0();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1273,6 +1291,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseAPP14();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1281,6 +1300,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDQT();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1289,6 +1309,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseSOF0();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1311,6 +1332,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDHT();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1319,6 +1341,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseDRI();
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
- break;
-@@ -1327,6 +1350,7 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- jerr = ParseSOS(op);
- if(JPEG_OK != jerr)
- {
-+ SetDecodeErrorTypes();
- return jerr;
- }
-
-@@ -1336,7 +1360,10 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- {
- jerr = m_BitStreamIn.Seek(-(m_sos_len + 2));
- if(JPEG_OK != jerr)
-+ {
-+ SetDecodeErrorTypes();
- return jerr;
-+ }
- }
- else
- {
-@@ -1355,10 +1382,10 @@ JERRCODE CJPEGDecoderBase::ParseJPEGBitStream(JOPERATION op)
- default:
- TRC1("-> Unknown marker ",m_marker);
- TRC0("..Skipping");
-+ SetDecodeErrorTypes();
- jerr = SkipMarker();
- if(JPEG_OK != jerr)
- return jerr;
--
- break;
- }
- }
-diff --git a/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode.cpp b/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode.cpp
-index 01a513e883..0ffcfaf7ab 100644
---- a/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode.cpp
-+++ b/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode.cpp
-@@ -378,7 +378,7 @@ Status MJPEGVideoDecoderMFX::DecodeHeader(MediaData* in)
- }
- }
-
-- Status sts = _GetFrameInfo((uint8_t*)in->GetDataPointer(), in->GetDataSize());
-+ Status sts = _GetFrameInfo((uint8_t*)in->GetDataPointer(), in->GetDataSize(), in);
-
- if (sts == UMC_ERR_NOT_ENOUGH_DATA &&
- (!(in->GetFlags() & MediaData::FLAG_VIDEO_DATA_NOT_FULL_FRAME) ||
-@@ -937,7 +937,7 @@ Status MJPEGVideoDecoderMFX::PostProcessing(double pts)
- return UMC_OK;
- }
-
--Status MJPEGVideoDecoderMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t nSize)
-+Status MJPEGVideoDecoderMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t nSize, MediaData *in)
- {
- int32_t nchannels;
- int32_t precision;
-@@ -945,6 +945,8 @@ Status MJPEGVideoDecoderMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t nSi
- JCOLOR color;
- JERRCODE jerr;
-
-+ m_dec[0]->SetDecodeErrorReportParam(in);
-+
- if (!m_IsInit)
- return UMC_ERR_NOT_INITIALIZED;
-
-diff --git a/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_base.cpp b/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_base.cpp
-index 06fd1a681b..3150492ab2 100644
---- a/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_base.cpp
-+++ b/_studio/shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_base.cpp
-@@ -322,7 +322,7 @@ Status MJPEGVideoDecoderBaseMFX::DecodeHeader(MediaData* in)
- }
- }
-
-- Status sts = _GetFrameInfo((uint8_t*)in->GetDataPointer(), in->GetDataSize());
-+ Status sts = _GetFrameInfo((uint8_t*)in->GetDataPointer(), in->GetDataSize(), in);
-
- if (sts == UMC_ERR_NOT_ENOUGH_DATA &&
- (!(in->GetFlags() & MediaData::FLAG_VIDEO_DATA_NOT_FULL_FRAME) ||
-@@ -345,7 +345,7 @@ Status MJPEGVideoDecoderBaseMFX::SetRotation(uint16_t rotation)
- return UMC_OK;
- }
-
--Status MJPEGVideoDecoderBaseMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t nSize)
-+Status MJPEGVideoDecoderBaseMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t nSize, MediaData *in)
- {
- int32_t nchannels;
- int32_t precision;
-@@ -353,6 +353,8 @@ Status MJPEGVideoDecoderBaseMFX::_GetFrameInfo(const uint8_t* pBitStream, size_t
- JCOLOR color;
- JERRCODE jerr;
-
-+ m_decBase->SetDecodeErrorReportParam(in);
-+
- if (!m_IsInit)
- return UMC_ERR_NOT_INITIALIZED;
-
-diff --git a/api/vpl/mfxstructures.h b/api/vpl/mfxstructures.h
-index 879a431602..1bfdaf68c2 100644
---- a/api/vpl/mfxstructures.h
-+++ b/api/vpl/mfxstructures.h
-@@ -3520,12 +3520,33 @@ MFX_PACK_END()
-
- /*! The ErrorTypes enumerator uses bit-ORed values to itemize bitstream error types. */
- enum {
-- MFX_ERROR_NO = 0, /*!< No error in bitstream. */
-- MFX_ERROR_PPS = (1 << 0), /*!< Invalid/corrupted PPS. */
-- MFX_ERROR_SPS = (1 << 1), /*!< Invalid/corrupted SPS. */
-- MFX_ERROR_SLICEHEADER = (1 << 2), /*!< Invalid/corrupted slice header. */
-- MFX_ERROR_SLICEDATA = (1 << 3), /*!< Invalid/corrupted slice data. */
-- MFX_ERROR_FRAME_GAP = (1 << 4), /*!< Missed frames. */
-+ MFX_ERROR_NO = 0, /*!< No error in bitstream. */
-+ MFX_ERROR_PPS = (1 << 0), /*!< Invalid/corrupted PPS. */
-+ MFX_ERROR_SPS = (1 << 1), /*!< Invalid/corrupted SPS. */
-+ MFX_ERROR_SLICEHEADER = (1 << 2), /*!< Invalid/corrupted slice header. */
-+ MFX_ERROR_SLICEDATA = (1 << 3), /*!< Invalid/corrupted slice data. */
-+ MFX_ERROR_FRAME_GAP = (1 << 4), /*!< Missed frames. */
-+ MFX_ERROR_JPEG_APP0_MARKER = (1 << 5), /*!< Invalid/corrupted APP0 marker. */
-+ MFX_ERROR_JPEG_APP1_MARKER = (1 << 6), /*!< Invalid/corrupted APP1 marker. */
-+ MFX_ERROR_JPEG_APP2_MARKER = (1 << 7), /*!< Invalid/corrupted APP2 marker. */
-+ MFX_ERROR_JPEG_APP3_MARKER = (1 << 8), /*!< Invalid/corrupted APP3 marker. */
-+ MFX_ERROR_JPEG_APP4_MARKER = (1 << 9), /*!< Invalid/corrupted APP4 marker. */
-+ MFX_ERROR_JPEG_APP5_MARKER = (1 << 10), /*!< Invalid/corrupted APP5 marker. */
-+ MFX_ERROR_JPEG_APP6_MARKER = (1 << 11), /*!< Invalid/corrupted APP6 marker. */
-+ MFX_ERROR_JPEG_APP7_MARKER = (1 << 12), /*!< Invalid/corrupted APP7 marker. */
-+ MFX_ERROR_JPEG_APP8_MARKER = (1 << 13), /*!< Invalid/corrupted APP8 marker. */
-+ MFX_ERROR_JPEG_APP9_MARKER = (1 << 14), /*!< Invalid/corrupted APP9 marker. */
-+ MFX_ERROR_JPEG_APP10_MARKER = (1 << 15), /*!< Invalid/corrupted APP10 marker. */
-+ MFX_ERROR_JPEG_APP11_MARKER = (1 << 16), /*!< Invalid/corrupted APP11 marker. */
-+ MFX_ERROR_JPEG_APP12_MARKER = (1 << 17), /*!< Invalid/corrupted APP12 marker. */
-+ MFX_ERROR_JPEG_APP13_MARKER = (1 << 18), /*!< Invalid/corrupted APP13 marker. */
-+ MFX_ERROR_JPEG_APP14_MARKER = (1 << 19), /*!< Invalid/corrupted APP14 marker. */
-+ MFX_ERROR_JPEG_DQT_MARKER = (1 << 20), /*!< Invalid/corrupted DQT marker. */
-+ MFX_ERROR_JPEG_SOF0_MARKER = (1 << 21), /*!< Invalid/corrupted SOF0 marker. */
-+ MFX_ERROR_JPEG_DHT_MARKER = (1 << 22), /*!< Invalid/corrupted DHT marker. */
-+ MFX_ERROR_JPEG_DRI_MARKER = (1 << 23), /*!< Invalid/corrupted DRI marker. */
-+ MFX_ERROR_JPEG_SOS_MARKER = (1 << 24), /*!< Invalid/corrupted SOS marker. */
-+ MFX_ERROR_JPEG_UNKNOWN_MARKER = (1 << 25), /*!< Unknown Marker. */
- };
-
- MFX_PACK_BEGIN_USUAL_STRUCT()
---
-2.33.0
-
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu_21.3.4.bb b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb
index 1fc4c4b2..0b849bf1 100644
--- a/recipes-multimedia/onevpl/onevpl-intel-gpu_21.3.4.bb
+++ b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb
@@ -15,15 +15,19 @@ 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;branch=main;lfs=0 \
- file://0001-jpegd-Enable-JPEG-decode-error-report.patch \
- file://0001-Adding-missing-device-ID-4692-for-ADL-S.patch \
- file://0001-HEVCd-Add-frame-info-check-and-update-ChromaFormat-i.patch \
- file://0001-AVCd-Add-frame-info-check-and-update-ChromaFormat-in.patch \
- "
+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 = "51608c724044802cc060b7969084126a3e90ca4a"
+SRCREV = "852fa9f705ef44c004d014548601f3804a6de705"
S = "${WORKDIR}/git"
+FILES:${PN} += " \
+ ${libdir}/libmfx-gen/enctools.so \
+ "
+
inherit cmake
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Extends-errorTypes-to-support-JPEG-errors.patch b/recipes-multimedia/onevpl/onevpl/0001-Extends-errorTypes-to-support-JPEG-errors.patch
deleted file mode 100644
index 063dd3fb..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-Extends-errorTypes-to-support-JPEG-errors.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From acdab0d47785f61aa06c1f0955450bf1574f202c Mon Sep 17 00:00:00 2001
-From: Vincent Cheah Beng Keat <vincent.beng.keat.cheah@intel.com>
-Date: Tue, 28 Sep 2021 03:06:40 +0000
-Subject: [PATCH] Extends errorTypes to support JPEG errors
-
-Upstream-Status: Submitted
-innersource PR #251
-
----
- api/vpl/mfxstructures.h | 33 +++++++++++++++++++++++++++------
- 1 file changed, 27 insertions(+), 6 deletions(-)
-
-diff --git a/api/vpl/mfxstructures.h b/api/vpl/mfxstructures.h
-index 9c8dd2b1..a9ccb4ae 100644
---- a/api/vpl/mfxstructures.h
-+++ b/api/vpl/mfxstructures.h
-@@ -3546,12 +3546,33 @@ MFX_PACK_END()
-
- /*! The ErrorTypes enumerator uses bit-ORed values to itemize bitstream error types. */
- enum {
-- MFX_ERROR_NO = 0, /*!< No error in bitstream. */
-- MFX_ERROR_PPS = (1 << 0), /*!< Invalid/corrupted PPS. */
-- MFX_ERROR_SPS = (1 << 1), /*!< Invalid/corrupted SPS. */
-- MFX_ERROR_SLICEHEADER = (1 << 2), /*!< Invalid/corrupted slice header. */
-- MFX_ERROR_SLICEDATA = (1 << 3), /*!< Invalid/corrupted slice data. */
-- MFX_ERROR_FRAME_GAP = (1 << 4), /*!< Missed frames. */
-+ MFX_ERROR_NO = 0, /*!< No error in bitstream. */
-+ MFX_ERROR_PPS = (1 << 0), /*!< Invalid/corrupted PPS. */
-+ MFX_ERROR_SPS = (1 << 1), /*!< Invalid/corrupted SPS. */
-+ MFX_ERROR_SLICEHEADER = (1 << 2), /*!< Invalid/corrupted slice header. */
-+ MFX_ERROR_SLICEDATA = (1 << 3), /*!< Invalid/corrupted slice data. */
-+ MFX_ERROR_FRAME_GAP = (1 << 4), /*!< Missed frames. */
-+ MFX_ERROR_JPEG_APP0_MARKER = (1 << 5), /*!< Invalid/corrupted APP0 marker. */
-+ MFX_ERROR_JPEG_APP1_MARKER = (1 << 6), /*!< Invalid/corrupted APP1 marker. */
-+ MFX_ERROR_JPEG_APP2_MARKER = (1 << 7), /*!< Invalid/corrupted APP2 marker. */
-+ MFX_ERROR_JPEG_APP3_MARKER = (1 << 8), /*!< Invalid/corrupted APP3 marker. */
-+ MFX_ERROR_JPEG_APP4_MARKER = (1 << 9), /*!< Invalid/corrupted APP4 marker. */
-+ MFX_ERROR_JPEG_APP5_MARKER = (1 << 10), /*!< Invalid/corrupted APP5 marker. */
-+ MFX_ERROR_JPEG_APP6_MARKER = (1 << 11), /*!< Invalid/corrupted APP6 marker. */
-+ MFX_ERROR_JPEG_APP7_MARKER = (1 << 12), /*!< Invalid/corrupted APP7 marker. */
-+ MFX_ERROR_JPEG_APP8_MARKER = (1 << 13), /*!< Invalid/corrupted APP8 marker. */
-+ MFX_ERROR_JPEG_APP9_MARKER = (1 << 14), /*!< Invalid/corrupted APP9 marker. */
-+ MFX_ERROR_JPEG_APP10_MARKER = (1 << 15), /*!< Invalid/corrupted APP10 marker. */
-+ MFX_ERROR_JPEG_APP11_MARKER = (1 << 16), /*!< Invalid/corrupted APP11 marker. */
-+ MFX_ERROR_JPEG_APP12_MARKER = (1 << 17), /*!< Invalid/corrupted APP12 marker. */
-+ MFX_ERROR_JPEG_APP13_MARKER = (1 << 18), /*!< Invalid/corrupted APP13 marker. */
-+ MFX_ERROR_JPEG_APP14_MARKER = (1 << 19), /*!< Invalid/corrupted APP14 marker. */
-+ MFX_ERROR_JPEG_DQT_MARKER = (1 << 20), /*!< Invalid/corrupted DQT marker. */
-+ MFX_ERROR_JPEG_SOF0_MARKER = (1 << 21), /*!< Invalid/corrupted SOF0 marker. */
-+ MFX_ERROR_JPEG_DHT_MARKER = (1 << 22), /*!< Invalid/corrupted DHT marker. */
-+ MFX_ERROR_JPEG_DRI_MARKER = (1 << 23), /*!< Invalid/corrupted DRI marker. */
-+ MFX_ERROR_JPEG_SOS_MARKER = (1 << 24), /*!< Invalid/corrupted SOS marker. */
-+ MFX_ERROR_JPEG_UNKNOWN_MARKER = (1 << 25), /*!< Unknown Marker. */
- };
-
- MFX_PACK_BEGIN_USUAL_STRUCT()
---
-2.33.0
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch b/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch
deleted file mode 100644
index 93e5ed0d..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d16afe9f9302e4995f12d699019eba170bb6db21 Mon Sep 17 00:00:00 2001
-From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
-Date: Fri, 8 Oct 2021 08:45:39 +0800
-Subject: [PATCH] Fix basename() build issue with musl_libc
-
-Upstream-Status: Submitted
-innersource PR #264
-
-Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
----
- tools/legacy/sample_common/src/vaapi_utils.cpp | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp b/tools/legacy/sample_common/src/vaapi_utils.cpp
-index b69dbe44..9382535a 100644
---- a/tools/legacy/sample_common/src/vaapi_utils.cpp
-+++ b/tools/legacy/sample_common/src/vaapi_utils.cpp
-@@ -7,6 +7,7 @@
- #ifdef LIBVA_SUPPORT
-
- #include "vaapi_utils.h"
-+ #include <libgen.h>
- #include <dlfcn.h>
- #include <stdexcept>
-
-@@ -26,7 +27,7 @@ SimpleLoader::SimpleLoader(const char* name) {
- dlerror();
- so_handle = dlopen(name, RTLD_GLOBAL | RTLD_NOW);
- if (NULL == so_handle) {
-- so_handle = dlopen(basename(name), RTLD_GLOBAL | RTLD_NOW);
-+ so_handle = dlopen(basename((char *)name), RTLD_GLOBAL | RTLD_NOW);
- if (NULL == so_handle) {
- std::cerr << dlerror() << std::endl;
- throw std::runtime_error("Can't load library");
---
-2.33.0
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-sample_decode-Add-VDSFC-CSC-for-AVC-HEVC.patch b/recipes-multimedia/onevpl/onevpl/0001-sample_decode-Add-VDSFC-CSC-for-AVC-HEVC.patch
deleted file mode 100644
index db8baa3e..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-sample_decode-Add-VDSFC-CSC-for-AVC-HEVC.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-From f8d87fc857d5bfd69247c985ed82ba88e167ef30 Mon Sep 17 00:00:00 2001
-From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
-Date: Fri, 9 Jul 2021 13:59:33 +0000
-Subject: [PATCH] sample_decode: Add VDSFC CSC for AVC/HEVC
-
-Upstream-Status: Submitted
-innersource PR #289
-
-Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
----
- .../sample_decode/src/pipeline_decode.cpp | 84 +++++++++++++++++--
- 1 file changed, 77 insertions(+), 7 deletions(-)
-
-diff --git a/tools/legacy/sample_decode/src/pipeline_decode.cpp b/tools/legacy/sample_decode/src/pipeline_decode.cpp
-index 4dc811c5..d817ff2a 100644
---- a/tools/legacy/sample_decode/src/pipeline_decode.cpp
-+++ b/tools/legacy/sample_decode/src/pipeline_decode.cpp
-@@ -765,6 +765,14 @@ bool CDecodingPipeline::IsVppRequired(sInputParams* pParams) {
- if (pParams->eDeinterlace) {
- bVppIsUsed = true;
- }
-+
-+ if ((MODE_DECODER_POSTPROC_AUTO == pParams->nDecoderPostProcessing) ||
-+ (MODE_DECODER_POSTPROC_FORCE == pParams->nDecoderPostProcessing)) {
-+ /* Decoder will make decision about internal post-processing usage slightly later */
-+ if ((pParams->videoType == MFX_CODEC_AVC) || (pParams->videoType == MFX_CODEC_HEVC))
-+ bVppIsUsed = false;
-+ }
-+
- return bVppIsUsed;
- }
-
-@@ -1014,6 +1022,8 @@ mfxStatus CDecodingPipeline::InitMfxParams(sInputParams* pParams) {
- if (!m_bVppIsUsed) {
- if ((m_mfxVideoParams.mfx.FrameInfo.CropW != pParams->Width && pParams->Width) ||
- (m_mfxVideoParams.mfx.FrameInfo.CropH != pParams->Height && pParams->Height) ||
-+ (pParams->nDecoderPostProcessing && pParams->videoType == MFX_CODEC_AVC) ||
-+ (pParams->nDecoderPostProcessing && pParams->videoType == MFX_CODEC_HEVC) ||
- (pParams->nDecoderPostProcessing && pParams->videoType == MFX_CODEC_JPEG &&
- pParams->fourcc == MFX_FOURCC_RGB4 &&
- // No need to use decoder's post processing for decoding of JPEG with RGB 4:4:4
-@@ -1027,7 +1037,10 @@ mfxStatus CDecodingPipeline::InitMfxParams(sInputParams* pParams) {
- if (((MODE_DECODER_POSTPROC_AUTO == pParams->nDecoderPostProcessing) ||
- (MODE_DECODER_POSTPROC_FORCE == pParams->nDecoderPostProcessing)) &&
- (MFX_CODEC_AVC == m_mfxVideoParams.mfx.CodecId ||
-- MFX_CODEC_JPEG == m_mfxVideoParams.mfx.CodecId) && /* Only for AVC and JPEG */
-+ MFX_CODEC_JPEG == m_mfxVideoParams.mfx.CodecId ||
-+ MFX_CODEC_HEVC == m_mfxVideoParams.mfx.CodecId ||
-+ MFX_CODEC_VP9 == m_mfxVideoParams.mfx.CodecId ||
-+ MFX_CODEC_AV1 == m_mfxVideoParams.mfx.CodecId) &&
- (MFX_PICSTRUCT_PROGRESSIVE ==
- m_mfxVideoParams.mfx.FrameInfo.PicStruct)) /* ...And only for progressive!*/
- { /* it is possible to use decoder's post-processing */
-@@ -1050,12 +1063,69 @@ mfxStatus CDecodingPipeline::InitMfxParams(sInputParams* pParams) {
-
- decPostProcessing->Out.FourCC = m_mfxVideoParams.mfx.FrameInfo.FourCC;
- decPostProcessing->Out.ChromaFormat = m_mfxVideoParams.mfx.FrameInfo.ChromaFormat;
-- decPostProcessing->Out.Width = MSDK_ALIGN16(pParams->Width);
-- decPostProcessing->Out.Height = MSDK_ALIGN16(pParams->Height);
-- decPostProcessing->Out.CropX = 0;
-- decPostProcessing->Out.CropY = 0;
-- decPostProcessing->Out.CropW = pParams->Width;
-- decPostProcessing->Out.CropH = pParams->Height;
-+
-+ if (pParams->videoType == MFX_CODEC_AVC || pParams->videoType == MFX_CODEC_HEVC) {
-+ switch (pParams->fourcc) {
-+ case MFX_FOURCC_RGB4:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_RGB4;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-+ break;
-+
-+ case MFX_FOURCC_NV12:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_NV12;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ break;
-+
-+ case MFX_FOURCC_P010:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_P010;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ break;
-+
-+ case MFX_FOURCC_P016:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_P016;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-+ break;
-+
-+ case MFX_FOURCC_YUY2:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_YUY2;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-+ break;
-+
-+ case MFX_FOURCC_Y210:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_Y210;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-+ break;
-+
-+ case MFX_FOURCC_Y216:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_Y216;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
-+ break;
-+
-+ case MFX_FOURCC_AYUV:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_AYUV;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-+ break;
-+
-+ case MFX_FOURCC_Y410:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_Y410;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-+ break;
-+
-+ case MFX_FOURCC_Y416:
-+ decPostProcessing->Out.FourCC = MFX_FOURCC_Y416;
-+ decPostProcessing->Out.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
-+ break;
-+
-+ default:
-+ break;
-+ }
-+ }
-+ decPostProcessing->Out.Width = MSDK_ALIGN16(pParams->Width);
-+ decPostProcessing->Out.Height = MSDK_ALIGN16(pParams->Height);
-+ decPostProcessing->Out.CropX = 0;
-+ decPostProcessing->Out.CropY = 0;
-+ decPostProcessing->Out.CropW = pParams->Width;
-+ decPostProcessing->Out.CropH = pParams->Height;
-
- msdk_printf(MSDK_STRING("Decoder's post-processing is used for resizing\n"));
- }
---
-2.33.1
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-Addin-basic-wayland-dmabuf-support.patch b/recipes-multimedia/onevpl/onevpl/0001-sample_misc-Addin-basic-wayland-dmabuf-support.patch
deleted file mode 100644
index 96110ef8..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-Addin-basic-wayland-dmabuf-support.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 2e2bcb1817f2dc91adf85f5255a4792a6213a74e Mon Sep 17 00:00:00 2001
-From: "Ung, Teng En" <teng.en.ung@intel.com>
-Date: Fri, 8 Oct 2021 14:19:40 +0000
-Subject: [PATCH 2/3] sample_misc: Addin basic wayland dmabuf support.
-
-Upstream-Status: Submitted
-innersource PR #269
-
----
- .../sample_misc/wayland/include/class_wayland.h | 16 ++++++++++++++++
- .../sample_misc/wayland/src/class_wayland.cpp | 8 ++++++++
- 2 files changed, 24 insertions(+)
-
-diff --git a/tools/legacy/sample_misc/wayland/include/class_wayland.h b/tools/legacy/sample_misc/wayland/include/class_wayland.h
-index 564b9b8b..e5267ec2 100644
---- a/tools/legacy/sample_misc/wayland/include/class_wayland.h
-+++ b/tools/legacy/sample_misc/wayland/include/class_wayland.h
-@@ -32,6 +32,9 @@ extern "C" {
- #include "sample_defs.h"
- #include "vpl/mfxstructures.h"
- #include "wayland-drm-client-protocol.h"
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ #include "linux-dmabuf-unstable-v1.h"
-+#endif
-
- typedef struct buffer wld_buffer;
-
-@@ -93,6 +96,11 @@ public:
- struct wl_drm* GetDrm() {
- return m_drm;
- }
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ struct zwp_linux_dmabuf_v1* GetDMABuf() {
-+ return m_dmabuf;
-+ }
-+#endif
- struct wl_shm* GetShm() {
- return m_shm;
- };
-@@ -120,6 +128,11 @@ public:
- void SetDrm(struct wl_drm* drm) {
- m_drm = drm;
- }
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ void SetDMABuf(struct zwp_linux_dmabuf_v1* dmabuf) {
-+ m_dmabuf = dmabuf;
-+ }
-+#endif
- void DrmHandleDevice(const char* device);
- void DrmHandleAuthenticated();
- void RegistryGlobal(struct wl_registry* registry,
-@@ -147,6 +160,9 @@ private:
- struct wl_compositor* m_compositor;
- struct wl_shell* m_shell;
- struct wl_drm* m_drm;
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ struct zwp_linux_dmabuf_v1* m_dmabuf;
-+#endif
- struct wl_shm* m_shm;
- struct wl_shm_pool* m_pool;
- struct wl_surface* m_surface;
-diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-index 65147973..dc2fc718 100644
---- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-+++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-@@ -50,6 +50,9 @@ Wayland::Wayland()
- m_compositor(NULL),
- m_shell(NULL),
- m_drm(NULL),
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ m_dmabuf(NULL),
-+#endif
- m_shm(NULL),
- m_pool(NULL),
- m_surface(NULL),
-@@ -360,6 +363,11 @@ void Wayland::RegistryGlobal(struct wl_registry* registry,
- m_drm = static_cast<wl_drm*>(wl_registry_bind(registry, name, &wl_drm_interface, 2));
- wl_drm_add_listener(m_drm, &drm_listener, this);
- }
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ else if(0 == strcmp(interface, "zwp_linux_dmabuf_v1"))
-+ m_dmabuf = static_cast<zwp_linux_dmabuf_v1*>(
-+ wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface, version));
-+#endif
- }
-
- void Wayland::DrmHandleDevice(const char* name) {
---
-2.31.1
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch b/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch
deleted file mode 100644
index d061e3ef..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 0091d3fea76e64ffbd537b2ae47b8912c89c09d7 Mon Sep 17 00:00:00 2001
-From: "Ung, Teng En" <teng.en.ung@intel.com>
-Date: Fri, 8 Oct 2021 14:38:45 +0000
-Subject: [PATCH 3/3] sample_misc: use wayland dmabuf to render nv12
-
-Upstream-Status: Submitted
-innersource PR #269
-
----
- .../sample_misc/wayland/src/class_wayland.cpp | 60 +++++++++++++++----
- 1 file changed, 47 insertions(+), 13 deletions(-)
-
-diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-index dc2fc718..d2e7e4e2 100644
---- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-+++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
-@@ -26,6 +26,7 @@ or https://software.intel.com/en-us/media-client-solutions-support.
- #include <iostream>
- extern "C" {
- #include <drm.h>
-+#include <drm_fourcc.h>
- #include <intel_bufmgr.h>
- #include <xf86drm.h>
- }
-@@ -305,20 +306,53 @@ struct wl_buffer* Wayland::CreatePrimeBuffer(uint32_t name,
- int32_t offsets[3],
- int32_t pitches[3]) {
- struct wl_buffer* buffer = NULL;
-- if (NULL == m_drm)
-- return NULL;
-
-- buffer = wl_drm_create_prime_buffer(m_drm,
-- name,
-- width,
-- height,
-- format,
-- offsets[0],
-- pitches[0],
-- offsets[1],
-- pitches[1],
-- offsets[2],
-- pitches[2]);
-+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
-+ if (format == WL_DRM_FORMAT_NV12) {
-+ if(NULL == m_dmabuf)
-+ return NULL;
-+
-+ struct zwp_linux_buffer_params_v1 *dmabuf_params = NULL;
-+ int i = 0;
-+ uint64_t modifier = I915_FORMAT_MOD_Y_TILED;
-+
-+ dmabuf_params = zwp_linux_dmabuf_v1_create_params(m_dmabuf);
-+ for(i = 0; i < 2; i++) {
-+ zwp_linux_buffer_params_v1_add(dmabuf_params,
-+ name,
-+ i,
-+ offsets[i],
-+ pitches[i],
-+ modifier >> 32,
-+ modifier & 0xffffffff);
-+ }
-+
-+ buffer = zwp_linux_buffer_params_v1_create_immed(dmabuf_params,
-+ width,
-+ height,
-+ format,
-+ 0);
-+
-+ zwp_linux_buffer_params_v1_destroy(dmabuf_params);
-+ } else
-+#endif
-+ {
-+ if(NULL == m_drm)
-+ return NULL;
-+
-+ buffer = wl_drm_create_prime_buffer(m_drm,
-+ name,
-+ width,
-+ height,
-+ format,
-+ offsets[0],
-+ pitches[0],
-+ offsets[1],
-+ pitches[1],
-+ offsets[2],
-+ pitches[2]);
-+ }
-+
- return buffer;
- }
-
---
-2.31.1
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch b/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch
deleted file mode 100644
index 6fab79e5..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 6ef9dd02e297ae20da422f2f3f4f298061efd6e9 Mon Sep 17 00:00:00 2001
-From: "Ung, Teng En" <teng.en.ung@intel.com>
-Date: Fri, 15 Oct 2021 11:55:13 +0000
-Subject: [PATCH 1/3] samples: Addin wayland-scanner auto generate on cmake.
-
-Upstream-Status: Submitted
-innersource PR #269
-
----
- tools/legacy/sample_common/CMakeLists.txt | 21 ++++++++++
- .../legacy/sample_misc/wayland/CMakeLists.txt | 39 +++++++++++++++++++
- 2 files changed, 60 insertions(+)
-
-diff --git a/tools/legacy/sample_common/CMakeLists.txt b/tools/legacy/sample_common/CMakeLists.txt
-index 0ff83aa4..0ed8b390 100644
---- a/tools/legacy/sample_common/CMakeLists.txt
-+++ b/tools/legacy/sample_common/CMakeLists.txt
-@@ -92,6 +92,27 @@ if(UNIX)
- target_include_directories(
- ${TARGET}
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../sample_misc/wayland/include)
-+
-+ pkg_check_modules(PKG_WAYLAND_SCANNER "wayland-scanner>=1.15")
-+ pkg_check_modules(PKG_WAYLAND_PROTCOLS "wayland-protocols>=1.15")
-+
-+ if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND)
-+ pkg_get_variable(WAYLAND_PROTOCOLS_PATH wayland-protocols pkgdatadir)
-+ if(WAYLAND_PROTOCOLS_PATH)
-+ find_file(
-+ WAYLAND_LINUX_DMABUF_XML_PATH linux-dmabuf-unstable-v1.xml
-+ PATHS ${WAYLAND_PROTOCOLS_PATH}/unstable/linux-dmabuf
-+ NO_DEFAULT_PATH)
-+ endif()
-+ endif()
-+
-+ if(WAYLAND_LINUX_DMABUF_XML_PATH)
-+ target_compile_definitions(
-+ ${TARGET} PUBLIC -DWAYLAND_LINUX_DMABUF_SUPPORT)
-+ target_include_directories(
-+ ${TARGET}
-+ PUBLIC ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
-+ endif()
- else()
- message(
- WARNING
-diff --git a/tools/legacy/sample_misc/wayland/CMakeLists.txt b/tools/legacy/sample_misc/wayland/CMakeLists.txt
-index 1fe98da4..01e6029b 100644
---- a/tools/legacy/sample_misc/wayland/CMakeLists.txt
-+++ b/tools/legacy/sample_misc/wayland/CMakeLists.txt
-@@ -29,6 +29,45 @@ target_sources(
- ${CMAKE_CURRENT_SOURCE_DIR}/src/listener_wayland.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/wayland-drm-protocol.c)
-
-+if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND AND WAYLAND_LINUX_DMABUF_XML_PATH)
-+ pkg_get_variable(WAYLAND_SCANNER_BIN_PATH wayland-scanner bindir)
-+ pkg_get_variable(WAYLAND_SCANNER_BIN wayland-scanner wayland_scanner)
-+
-+ if(WAYLAND_SCANNER_BIN_PATH AND WAYLAND_SCANNER_BIN)
-+ execute_process(
-+ COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
-+ "client-header" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.h"
-+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-+ if (WAYLAND_SCANNER_RESULT)
-+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.h")
-+ return()
-+ endif()
-+
-+ execute_process(
-+ COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
-+ "private-code" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c"
-+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-+ if (WAYLAND_SCANNER_RESULT)
-+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.c")
-+ return()
-+ endif()
-+
-+ include_directories(
-+ ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
-+ add_definitions(-DWAYLAND_LINUX_DMABUF_SUPPORT)
-+ target_sources(
-+ ${TARGET}
-+ PRIVATE ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c)
-+ else()
-+ message(ERROR "Don't know how to execute wayland-scanner.")
-+ return()
-+ endif()
-+endif()
-+
- target_link_libraries(${TARGET} sample_common wayland-client va drm drm_intel)
-
- install(TARGETS ${TARGET} LIBRARY DESTINATION ${_TOOLS_LIB_PATH})
---
-2.31.1
-
diff --git a/recipes-multimedia/onevpl/onevpl/0001-samples-use-find_program-to-detect-wayland-scanner-i.patch b/recipes-multimedia/onevpl/onevpl/0001-samples-use-find_program-to-detect-wayland-scanner-i.patch
deleted file mode 100644
index 6f1ad93e..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-samples-use-find_program-to-detect-wayland-scanner-i.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From c69500c88058358bdc6c0a036d90b000d63f2a41 Mon Sep 17 00:00:00 2001
-From: "Ung, Teng En" <teng.en.ung@intel.com>
-Date: Wed, 3 Nov 2021 14:23:15 +0000
-Subject: [PATCH 4/4] samples: use find_program to detect wayland-scanner in
- cmake
-
-Upstream-Status: Submitted
-innersource PR #269
-
----
- tools/legacy/sample_common/CMakeLists.txt | 4 +-
- tools/legacy/sample_misc/wayland/CMakeLists.txt | 59 +++++++++++--------------
- 2 files changed, 28 insertions(+), 35 deletions(-)
-
-diff --git a/tools/legacy/sample_common/CMakeLists.txt b/tools/legacy/sample_common/CMakeLists.txt
-index 0ed8b39..658d44d 100644
---- a/tools/legacy/sample_common/CMakeLists.txt
-+++ b/tools/legacy/sample_common/CMakeLists.txt
-@@ -93,10 +93,10 @@ if(UNIX)
- ${TARGET}
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../sample_misc/wayland/include)
-
-- pkg_check_modules(PKG_WAYLAND_SCANNER "wayland-scanner>=1.15")
-+ find_program(WAYLAND_SCANNER_BIN "wayland-scanner")
- pkg_check_modules(PKG_WAYLAND_PROTCOLS "wayland-protocols>=1.15")
-
-- if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND)
-+ if(WAYLAND_SCANNER_BIN AND PKG_WAYLAND_PROTCOLS_FOUND)
- pkg_get_variable(WAYLAND_PROTOCOLS_PATH wayland-protocols pkgdatadir)
- if(WAYLAND_PROTOCOLS_PATH)
- find_file(
-diff --git a/tools/legacy/sample_misc/wayland/CMakeLists.txt b/tools/legacy/sample_misc/wayland/CMakeLists.txt
-index 01e6029..7625bc5 100644
---- a/tools/legacy/sample_misc/wayland/CMakeLists.txt
-+++ b/tools/legacy/sample_misc/wayland/CMakeLists.txt
-@@ -29,43 +29,36 @@ target_sources(
- ${CMAKE_CURRENT_SOURCE_DIR}/src/listener_wayland.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/src/wayland-drm-protocol.c)
-
--if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND AND WAYLAND_LINUX_DMABUF_XML_PATH)
-- pkg_get_variable(WAYLAND_SCANNER_BIN_PATH wayland-scanner bindir)
-- pkg_get_variable(WAYLAND_SCANNER_BIN wayland-scanner wayland_scanner)
-+ if(WAYLAND_SCANNER_BIN AND PKG_WAYLAND_PROTCOLS_FOUND AND WAYLAND_LINUX_DMABUF_XML_PATH)
-
-- if(WAYLAND_SCANNER_BIN_PATH AND WAYLAND_SCANNER_BIN)
-- execute_process(
-- COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
-- "client-header" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-- "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.h"
-- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-- RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-- if (WAYLAND_SCANNER_RESULT)
-- message(ERROR "Failed to generate linux-dmabuf-unstable-v1.h")
-- return()
-- endif()
--
-- execute_process(
-- COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
-- "private-code" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-- "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c"
-- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-- RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-- if (WAYLAND_SCANNER_RESULT)
-- message(ERROR "Failed to generate linux-dmabuf-unstable-v1.c")
-- return()
-- endif()
-+ execute_process(
-+ COMMAND "${WAYLAND_SCANNER_BIN}"
-+ "client-header" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.h"
-+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-+ if (WAYLAND_SCANNER_RESULT)
-+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.h")
-+ return()
-+ endif()
-
-- include_directories(
-- ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
-- add_definitions(-DWAYLAND_LINUX_DMABUF_SUPPORT)
-- target_sources(
-- ${TARGET}
-- PRIVATE ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c)
-- else()
-- message(ERROR "Don't know how to execute wayland-scanner.")
-+ execute_process(
-+ COMMAND "${WAYLAND_SCANNER_BIN}"
-+ "private-code" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
-+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c"
-+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
-+ if (WAYLAND_SCANNER_RESULT)
-+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.c")
- return()
- endif()
-+
-+ include_directories(
-+ ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
-+ add_definitions(-DWAYLAND_LINUX_DMABUF_SUPPORT)
-+ target_sources(
-+ ${TARGET}
-+ PRIVATE ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c)
- endif()
-
- target_link_libraries(${TARGET} sample_common wayland-client va drm drm_intel)
---
-2.7.4
-
diff --git a/recipes-multimedia/onevpl/onevpl_2021.6.0.bb b/recipes-multimedia/onevpl/onevpl_2023.4.0.bb
index e586b54e..513c7f2c 100644
--- a/recipes-multimedia/onevpl/onevpl_2021.6.0.bb
+++ b/recipes-multimedia/onevpl/onevpl_2023.4.0.bb
@@ -6,18 +6,12 @@ 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=67727fd253b1b4574cd9eea78a2b0620"
+ file://third-party-programs.txt;md5=0e35a23482445dd089b4eabe19103a06"
SRC_URI = "git://github.com/oneapi-src/oneVPL.git;protocol=https;branch=master \
- file://0001-Fix-basename-build-issue-with-musl_libc.patch \
- file://0001-Extends-errorTypes-to-support-JPEG-errors.patch \
- file://0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch \
- file://0001-sample_misc-Addin-basic-wayland-dmabuf-support.patch \
- file://0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch \
- file://0001-samples-use-find_program-to-detect-wayland-scanner-i.patch \
- file://0001-sample_decode-Add-VDSFC-CSC-for-AVC-HEVC.patch \
+ file://0001-vpl.pc.in-dont-pass-pcfiledir-to-cflags.patch \
"
-SRCREV = "cdf7444dc971544d148c51e0d93a2df1bb55dda7"
+SRCREV = "2274efcd3672b43297ef774f332e1fed6781381c"
S = "${WORKDIR}/git"
inherit cmake
@@ -33,14 +27,14 @@ do_install:append() {
COMPATIBLE_HOST = '(x86_64).*-linux'
-PACKAGES += "${PN}-examples"
+PACKAGES =+ "${PN}-examples"
-FILES:${PN}-examples = "${datadir}/oneVPL/examples \
+FILES:${PN}-examples = "${datadir}/vpl \
"
FILES_SOLIBSDEV = ""
FILES:${PN}-dev += "${libdir}/libvpl.so"
-FILES:${PN} += "${datadir} \
- ${libdir}/oneVPL/libvpl_wayland.so \
+FILES:${PN} += " ${datadir}/oneVPL/samples \
+ ${libdir}/vpl/libvpl_wayland.so \
"
diff --git a/recipes-oneapi/crypto/intel-crypto-mb/0003-CMakeLists.txt-exclude-host-system-headers.patch b/recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch
index f9c4a923..58ed1c9a 100644
--- a/recipes-oneapi/crypto/intel-crypto-mb/0003-CMakeLists.txt-exclude-host-system-headers.patch
+++ b/recipes-oneapi/crypto/intel-crypto-mb/0001-CMakeLists.txt-exclude-host-system-headers.patch
@@ -1,19 +1,22 @@
-From 7b575fc23d246373425c3682e83634203aadc4a6 Mon Sep 17 00:00:00 2001
+From efedbf9080c19241c2aa9ee7ba901245d38c8fa2 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Thu, 17 Jun 2021 12:35:36 +0800
-Subject: [PATCH 3/4] CMakeLists.txt: exclude host system headers
+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 d1f3994..db9635b 100644
+index c4cc82a..4094f34 100644
--- a/sources/ippcp/crypto_mb/CMakeLists.txt
+++ b/sources/ippcp/crypto_mb/CMakeLists.txt
-@@ -75,7 +75,6 @@ endif()
- include_directories(
- ${MB_INCLUDE_DIRS}
+@@ -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}>
diff --git a/recipes-oneapi/crypto/intel-crypto-mb/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch b/recipes-oneapi/crypto/intel-crypto-mb/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
deleted file mode 100644
index 49adf8f1..00000000
--- a/recipes-oneapi/crypto/intel-crypto-mb/0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From c440800cae91f857949255cc63993426bdaefb26 Mon Sep 17 00:00:00 2001
-From: Naveen Saini <naveen.kumar.saini@intel.com>
-Date: Wed, 16 Jun 2021 20:54:33 +0800
-Subject: [PATCH 1/4] GNU.cmake: allow to pass compiler and linker flags
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
----
- sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
-index 5d148a1..4cb2289 100644
---- a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
-+++ b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake
-@@ -56,7 +56,8 @@ 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 "${CMAKE_C_FLAGS} -falign-functions=32 -falign-loops=32")
-+
- # 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/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.3.bb b/recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb
index 68010a4a..be72fd85 100644
--- a/recipes-oneapi/crypto/intel-crypto-mb_2021.3.bb
+++ b/recipes-oneapi/crypto/intel-crypto-mb_2021.11.1.bb
@@ -8,13 +8,14 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://../../../LICENSE;md5=e787af283468feca985d6b865d27d95b"
-SRC_URI = " \
- git://github.com/intel/ipp-crypto;protocol=https;branch=ipp-crypto_2021_3 \
- file://0001-GNU.cmake-allow-to-pass-compiler-and-linker-flags.patch;striplevel=4 \
- file://0003-CMakeLists.txt-exclude-host-system-headers.patch;striplevel=4 \
- "
+IPP_BRANCH = "ipp-crypto_${@'_'.join(d.getVar('PV').rsplit('.')[-3:])}"
-SRCREV = "d9d13aaaf8889753fb58a13c2652c39b67c2076b"
+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"
@@ -23,7 +24,5 @@ DEPENDS = "openssl"
inherit cmake pkgconfig
COMPATIBLE_HOST = '(x86_64).*-linux'
-# error: 'SHA512_Init' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
-CFLAGS:append = " -Wno-error=deprecated-declarations"
-
EXTRA_OECMAKE += " -DARCH=intel64"
+EXTRA_OECMAKE += " -DTOOLCHAIN_OPTIONS='${TOOLCHAIN_OPTIONS}'"
diff --git a/recipes-oneapi/onedpl/onedpl_2021.5.0.bb b/recipes-oneapi/onedpl/onedpl_2022.3.0.bb
index d38e6f0a..d80b64c9 100644
--- a/recipes-oneapi/onedpl/onedpl_2021.5.0.bb
+++ b/recipes-oneapi/onedpl/onedpl_2022.3.0.bb
@@ -7,13 +7,13 @@ 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=4075f07036267ff083d9e095c6a6019f"
+ file://licensing/third-party-programs.txt;md5=cfb8d6b1f04a8fcc7d0dddd817619634"
S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/oneapi-src/oneDPL.git;protocol=https;branch=release/2021.5 \
+SRC_URI = "git://github.com/oneapi-src/oneDPL.git;protocol=https;branch=release/2022.3 \
"
-SRCREV = "35830e76c16b0fbda612d8ffd440f0c712d875a5"
+SRCREV = "180f18ad25fbc39fa13bad43f1df7d54ee8f5609"
do_compile[noexec] = "1"
do_configure[noexec] = "1"
diff --git a/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2021.3.bb b/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb
index df6eb123..702f794e 100644
--- a/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2021.3.bb
+++ b/recipes-oneapi/setup-oneapi-env/setup-intel-oneapi-env_2023.0.0-25370.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Recipe to set up the environment for Intel® oneAPI runtime libra
via configuration file in ld.so.conf.d directory."
LICENSE = "EULA"
-LIC_FILES_CHKSUM = "file://${CUSTOM_LICENSES_PATH}/EULA;md5=9057fba3b8ada79f1bce0d1c195c7d1f"
+LIC_FILES_CHKSUM = "file://${CUSTOM_LICENSES_PATH}/EULA;md5=7bfc91523de2e84e7131d0eacf2827d4"
SRC_URI = "file://intel-oneapi-runtime.conf"
@@ -17,3 +17,4 @@ if [ x"$D" = "x" ]; then
if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
fi
}
+BBCLASSEXTEND = "native nativesdk"
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 3a4cea14..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"
+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 bbb30a6d..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;branch=master"
-
-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 6d59654b..205967c1 100644
--- a/recipes-support/libipt/libipt_2.0.4.bb
+++ b/recipes-support/libipt/libipt_2.1.1.bb
@@ -5,19 +5,20 @@ 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 \
"
diff --git a/recipes-support/sbsigntool/sbsigntool-native_git.bb b/recipes-support/sbsigntool/sbsigntool-native_git.bb
index 58af6349..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,
@@ -22,16 +22,15 @@ LIC_FILES_CHKSUM = "file://LICENSE.GPLv3;md5=9eef91148a9b14ec7f9df333daebc746 \
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 \
- file://0002-fix-openssl-3-0.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"
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>
diff --git a/recipes-support/sbsigntool/sbsigntool/0002-fix-openssl-3-0.patch b/recipes-support/sbsigntool/sbsigntool/0002-fix-openssl-3-0.patch
deleted file mode 100644
index 8a277947..00000000
--- a/recipes-support/sbsigntool/sbsigntool/0002-fix-openssl-3-0.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Use ASN1_ITEM_rptr() instead of taking the address of IDC_PEID_it.
-
-openssl-3.0 changed the type of TYPE_it from `const ASN1_ITEM TYPE_it` to
-`const ASN1_ITEM *TYPE_it(void)`. This was previously hidden behind
-OPENSSL_EXPORT_VAR_AS_FUNCTION but in 3.0 only the function version is
-available. This change should have been transparent to the application, but
-only if the `ASN1_ITEM_rptr()` macro is used.
-
-This change passes `make check` with both openssl 1.1 and 3.0.
-
-Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
-Upstream-status: Submited [https://groups.io/g/sbsigntools/topic/patch_fix_openssl_3_0_issue/85903418]
----
- src/idc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/idc.c b/src/idc.c
-index 6d87bd4..0a82218 100644
---- a/src/idc.c
-+++ b/src/idc.c
-@@ -189,7 +189,7 @@ int IDC_set(PKCS7 *p7, PKCS7_SIGNER_INFO *si, struct image *image)
-
- idc->data->type = OBJ_nid2obj(peid_nid);
- idc->data->value = ASN1_TYPE_new();
-- type_set_sequence(image, idc->data->value, peid, &IDC_PEID_it);
-+ type_set_sequence(image, idc->data->value, peid, ASN1_ITEM_rptr(IDC_PEID));
-
- idc->digest->alg->parameter = ASN1_TYPE_new();
- idc->digest->alg->algorithm = OBJ_nid2obj(NID_sha256);
---
-2.25.1
-