diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def index 1ae36b32fb0a..d67cb3ff019b 100644 --- a/clang/include/clang/Basic/OpenCLExtensions.def +++ b/clang/include/clang/Basic/OpenCLExtensions.def @@ -1,107 +1,99 @@ //===--- OpenCLExtensions.def - OpenCL extension list -----------*- 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 defines the list of supported OpenCL extensions. // //===----------------------------------------------------------------------===// // Macro OPENCLEXT or OPENCLEXT_INTERNAL can be defined to enumerate the // OpenCL extensions listed in this file. // // If the extensions are to be enumerated without the supported OpenCL version, // define OPENCLEXT(ext) where ext is the name of the extension. // // If the extensions are to be enumerated with supported OpenCL version, // define OPENCLEXT_INTERNAL(ext, avail, core) where // ext - name of the extension or optional core feature. // avail - minimum OpenCL version supporting it. // core - minimum OpenCL version when the extension becomes optional core // feature or core feature. ~0U indicates not a core feature or an // optional core feature. +// +// As per The OpenCL Extension Specification, Section 1.2, in this file, an +// extension is defined if and only it either: +// * affects the OpenCL language semantics or its syntax, +// * adds built-in functions to the language. +// +// For such an extension, a preprocessor #define that matches the extension +// name must be created and a #pragma is required if and only if the +// compilation flow is impacted, e.g. due to a difference of syntax or +// semantics in the language compared to the core standard. #ifndef OPENCLEXT_INTERNAL #ifndef OPENCLEXT #pragma error "macro OPENCLEXT or OPENCLEXT_INTERNAL is required" #else #define OPENCLEXT_INTERNAL(ext, ...) OPENCLEXT(ext) #endif // OPENCLEXT #endif // OPENCLEXT_INTERNAL // OpenCL 1.0. OPENCLEXT_INTERNAL(cl_khr_3d_image_writes, 100, 200) -// fprounding mode is special since it is not mentioned beyond 1.0 -OPENCLEXT_INTERNAL(cl_khr_select_fprounding_mode, 100, 110) OPENCLEXT_INTERNAL(cl_khr_byte_addressable_store, 100, 110) OPENCLEXT_INTERNAL(cl_khr_fp16, 100, ~0U) OPENCLEXT_INTERNAL(cl_khr_fp64, 100, 120) OPENCLEXT_INTERNAL(cl_khr_global_int32_base_atomics, 100, 110) OPENCLEXT_INTERNAL(cl_khr_global_int32_extended_atomics, 100, 110) OPENCLEXT_INTERNAL(cl_khr_local_int32_base_atomics, 100, 110) OPENCLEXT_INTERNAL(cl_khr_local_int32_extended_atomics, 100, 110) OPENCLEXT_INTERNAL(cl_khr_int64_base_atomics, 100, ~0U) OPENCLEXT_INTERNAL(cl_khr_int64_extended_atomics, 100, ~0U) -OPENCLEXT_INTERNAL(cl_khr_gl_sharing, 100, ~0U) -OPENCLEXT_INTERNAL(cl_khr_icd, 100, ~0U) - -// OpenCL 1.1. -OPENCLEXT_INTERNAL(cl_khr_gl_event, 110, ~0U) -OPENCLEXT_INTERNAL(cl_khr_d3d10_sharing, 110, ~0U) // EMBEDDED_PROFILE OPENCLEXT_INTERNAL(cles_khr_int64, 110, ~0U) // OpenCL 1.2. -OPENCLEXT_INTERNAL(cl_khr_context_abort, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_d3d11_sharing, 120, ~0U) OPENCLEXT_INTERNAL(cl_khr_depth_images, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_dx9_media_sharing, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_image2d_from_buffer, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_initialize_memory, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_gl_depth_images, 120, ~0U) OPENCLEXT_INTERNAL(cl_khr_gl_msaa_sharing, 120, ~0U) -OPENCLEXT_INTERNAL(cl_khr_spir, 120, ~0U) // OpenCL 2.0. -OPENCLEXT_INTERNAL(cl_khr_egl_event, 200, ~0U) -OPENCLEXT_INTERNAL(cl_khr_egl_image, 200, ~0U) OPENCLEXT_INTERNAL(cl_khr_mipmap_image, 200, ~0U) 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) // AMD OpenCL extensions OPENCLEXT_INTERNAL(cl_amd_media_ops, 100, ~0U) OPENCLEXT_INTERNAL(cl_amd_media_ops2, 100, ~0U) // ARM OpenCL extensions OPENCLEXT_INTERNAL(cl_arm_integer_dot_product_int8, 120, ~0U) OPENCLEXT_INTERNAL(cl_arm_integer_dot_product_accumulate_int8, 120, ~0U) OPENCLEXT_INTERNAL(cl_arm_integer_dot_product_accumulate_int16, 120, ~0U) OPENCLEXT_INTERNAL(cl_arm_integer_dot_product_accumulate_saturate_int8, 120, ~0U) // Intel OpenCL extensions 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) #undef OPENCLEXT_INTERNAL #ifdef OPENCLEXT #undef OPENCLEXT #endif diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h index a0e4c19f4fea..2158a8d253d6 100644 --- a/clang/lib/Basic/Targets/AMDGPU.h +++ b/clang/lib/Basic/Targets/AMDGPU.h @@ -1,438 +1,437 @@ //===--- AMDGPU.h - Declare AMDGPU target feature support -------*- 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 declares AMDGPU TargetInfo objects. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_AMDGPU_H #define LLVM_CLANG_LIB_BASIC_TARGETS_AMDGPU_H #include "clang/Basic/TargetID.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" #include "llvm/ADT/StringSet.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/TargetParser.h" namespace clang { namespace targets { class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { static const Builtin::Info BuiltinInfo[]; static const char *const GCCRegNames[]; enum AddrSpace { Generic = 0, Global = 1, Local = 3, Constant = 4, Private = 5 }; static const LangASMap AMDGPUDefIsGenMap; static const LangASMap AMDGPUDefIsPrivMap; llvm::AMDGPU::GPUKind GPUKind; unsigned GPUFeatures; unsigned WavefrontSize; /// Target ID is device name followed by optional feature name postfixed /// by plus or minus sign delimitted by colon, e.g. gfx908:xnack+:sram-ecc-. /// If the target ID contains feature+, map it to true. /// If the target ID contains feature-, map it to false. /// If the target ID does not contain a feature (default), do not map it. llvm::StringMap OffloadArchFeatures; std::string TargetID; bool hasFP64() const { return getTriple().getArch() == llvm::Triple::amdgcn || !!(GPUFeatures & llvm::AMDGPU::FEATURE_FP64); } /// Has fast fma f32 bool hasFastFMAF() const { return !!(GPUFeatures & llvm::AMDGPU::FEATURE_FAST_FMA_F32); } /// Has fast fma f64 bool hasFastFMA() const { return getTriple().getArch() == llvm::Triple::amdgcn; } bool hasFMAF() const { return getTriple().getArch() == llvm::Triple::amdgcn || !!(GPUFeatures & llvm::AMDGPU::FEATURE_FMA); } bool hasFullRateDenormalsF32() const { return !!(GPUFeatures & llvm::AMDGPU::FEATURE_FAST_DENORMAL_F32); } bool hasLDEXPF() const { return getTriple().getArch() == llvm::Triple::amdgcn || !!(GPUFeatures & llvm::AMDGPU::FEATURE_LDEXP); } static bool isAMDGCN(const llvm::Triple &TT) { return TT.getArch() == llvm::Triple::amdgcn; } static bool isR600(const llvm::Triple &TT) { return TT.getArch() == llvm::Triple::r600; } public: AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts); void setAddressSpaceMap(bool DefaultIsPrivate); void adjust(LangOptions &Opts) override; uint64_t getPointerWidthV(unsigned AddrSpace) const override { if (isR600(getTriple())) return 32; if (AddrSpace == Private || AddrSpace == Local) return 32; return 64; } uint64_t getPointerAlignV(unsigned AddrSpace) const override { return getPointerWidthV(AddrSpace); } uint64_t getMaxPointerWidth() const override { return getTriple().getArch() == llvm::Triple::amdgcn ? 64 : 32; } const char *getClobbers() const override { return ""; } ArrayRef getGCCRegNames() const override; ArrayRef getGCCRegAliases() const override { return None; } /// Accepted register names: (n, m is unsigned integer, n < m) /// v /// s /// a /// {vn}, {v[n]} /// {sn}, {s[n]} /// {an}, {a[n]} /// {S} , where S is a special register name ////{v[n:m]} /// {s[n:m]} /// {a[n:m]} bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override { static const ::llvm::StringSet<> SpecialRegs({ "exec", "vcc", "flat_scratch", "m0", "scc", "tba", "tma", "flat_scratch_lo", "flat_scratch_hi", "vcc_lo", "vcc_hi", "exec_lo", "exec_hi", "tma_lo", "tma_hi", "tba_lo", "tba_hi", }); switch (*Name) { case 'I': Info.setRequiresImmediate(-16, 64); return true; case 'J': Info.setRequiresImmediate(-32768, 32767); return true; case 'A': case 'B': case 'C': Info.setRequiresImmediate(); return true; default: break; } StringRef S(Name); if (S == "DA" || S == "DB") { Name++; Info.setRequiresImmediate(); return true; } bool HasLeftParen = false; if (S.front() == '{') { HasLeftParen = true; S = S.drop_front(); } if (S.empty()) return false; if (S.front() != 'v' && S.front() != 's' && S.front() != 'a') { if (!HasLeftParen) return false; auto E = S.find('}'); if (!SpecialRegs.count(S.substr(0, E))) return false; S = S.drop_front(E + 1); if (!S.empty()) return false; // Found {S} where S is a special register. Info.setAllowsRegister(); Name = S.data() - 1; return true; } S = S.drop_front(); if (!HasLeftParen) { if (!S.empty()) return false; // Found s, v or a. Info.setAllowsRegister(); Name = S.data() - 1; return true; } bool HasLeftBracket = false; if (!S.empty() && S.front() == '[') { HasLeftBracket = true; S = S.drop_front(); } unsigned long long N; if (S.empty() || consumeUnsignedInteger(S, 10, N)) return false; if (!S.empty() && S.front() == ':') { if (!HasLeftBracket) return false; S = S.drop_front(); unsigned long long M; if (consumeUnsignedInteger(S, 10, M) || N >= M) return false; } if (HasLeftBracket) { if (S.empty() || S.front() != ']') return false; S = S.drop_front(); } if (S.empty() || S.front() != '}') return false; S = S.drop_front(); if (!S.empty()) return false; // Found {vn}, {sn}, {an}, {v[n]}, {s[n]}, {a[n]}, {v[n:m]}, {s[n:m]} // or {a[n:m]}. Info.setAllowsRegister(); Name = S.data() - 1; return true; } // \p Constraint will be left pointing at the last character of // the constraint. In practice, it won't be changed unless the // constraint is longer than one character. std::string convertConstraint(const char *&Constraint) const override { StringRef S(Constraint); if (S == "DA" || S == "DB") { return std::string("^") + std::string(Constraint++, 2); } const char *Begin = Constraint; TargetInfo::ConstraintInfo Info("", ""); if (validateAsmConstraint(Constraint, Info)) return std::string(Begin).substr(0, Constraint - Begin + 1); Constraint = Begin; return std::string(1, *Constraint); } bool initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeatureVec) const override; ArrayRef getTargetBuiltins() const override; bool useFP16ConversionIntrinsics() const override { return false; } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override; BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::CharPtrBuiltinVaList; } bool isValidCPUName(StringRef Name) const override { if (getTriple().getArch() == llvm::Triple::amdgcn) return llvm::AMDGPU::parseArchAMDGCN(Name) != llvm::AMDGPU::GK_NONE; return llvm::AMDGPU::parseArchR600(Name) != llvm::AMDGPU::GK_NONE; } void fillValidCPUList(SmallVectorImpl &Values) const override; bool setCPU(const std::string &Name) override { if (getTriple().getArch() == llvm::Triple::amdgcn) { GPUKind = llvm::AMDGPU::parseArchAMDGCN(Name); GPUFeatures = llvm::AMDGPU::getArchAttrAMDGCN(GPUKind); } else { GPUKind = llvm::AMDGPU::parseArchR600(Name); GPUFeatures = llvm::AMDGPU::getArchAttrR600(GPUKind); } return GPUKind != llvm::AMDGPU::GK_NONE; } void setSupportedOpenCLOpts() override { auto &Opts = getSupportedOpenCLOpts(); Opts.support("cl_clang_storage_class_specifiers"); - Opts.support("cl_khr_icd"); bool IsAMDGCN = isAMDGCN(getTriple()); if (hasFP64()) Opts.support("cl_khr_fp64"); if (IsAMDGCN || GPUKind >= llvm::AMDGPU::GK_CEDAR) { Opts.support("cl_khr_byte_addressable_store"); Opts.support("cl_khr_global_int32_base_atomics"); Opts.support("cl_khr_global_int32_extended_atomics"); Opts.support("cl_khr_local_int32_base_atomics"); Opts.support("cl_khr_local_int32_extended_atomics"); } if (IsAMDGCN) { Opts.support("cl_khr_fp16"); Opts.support("cl_khr_int64_base_atomics"); Opts.support("cl_khr_int64_extended_atomics"); Opts.support("cl_khr_mipmap_image"); Opts.support("cl_khr_mipmap_image_writes"); Opts.support("cl_khr_subgroups"); Opts.support("cl_khr_3d_image_writes"); Opts.support("cl_amd_media_ops"); Opts.support("cl_amd_media_ops2"); } } LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const override { switch (TK) { case OCLTK_Image: return LangAS::opencl_constant; case OCLTK_ClkEvent: case OCLTK_Queue: case OCLTK_ReserveID: return LangAS::opencl_global; default: return TargetInfo::getOpenCLTypeAddrSpace(TK); } } LangAS getOpenCLBuiltinAddressSpace(unsigned AS) const override { switch (AS) { case 0: return LangAS::opencl_generic; case 1: return LangAS::opencl_global; case 3: return LangAS::opencl_local; case 4: return LangAS::opencl_constant; case 5: return LangAS::opencl_private; default: return getLangASFromTargetAS(AS); } } LangAS getCUDABuiltinAddressSpace(unsigned AS) const override { return LangAS::Default; } llvm::Optional getConstantAddressSpace() const override { return getLangASFromTargetAS(Constant); } /// \returns Target specific vtbl ptr address space. unsigned getVtblPtrAddressSpace() const override { return static_cast(Constant); } /// \returns If a target requires an address within a target specific address /// space \p AddressSpace to be converted in order to be used, then return the /// corresponding target specific DWARF address space. /// /// \returns Otherwise return None and no conversion will be emitted in the /// DWARF. Optional getDWARFAddressSpace(unsigned AddressSpace) const override { const unsigned DWARF_Private = 1; const unsigned DWARF_Local = 2; if (AddressSpace == Private) { return DWARF_Private; } else if (AddressSpace == Local) { return DWARF_Local; } else { return None; } } CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { switch (CC) { default: return CCCR_Warning; case CC_C: case CC_OpenCLKernel: return CCCR_OK; } } // In amdgcn target the null pointer in global, constant, and generic // address space has value 0 but in private and local address space has // value ~0. uint64_t getNullPointerValue(LangAS AS) const override { // FIXME: Also should handle region. return (AS == LangAS::opencl_local || AS == LangAS::opencl_private) ? ~0 : 0; } void setAuxTarget(const TargetInfo *Aux) override; bool hasExtIntType() const override { return true; } // Record offload arch features since they are needed for defining the // pre-defined macros. bool handleTargetFeatures(std::vector &Features, DiagnosticsEngine &Diags) override { auto TargetIDFeatures = getAllPossibleTargetIDFeatures(getTriple(), getArchNameAMDGCN(GPUKind)); llvm::for_each(Features, [&](const auto &F) { assert(F.front() == '+' || F.front() == '-'); if (F == "+wavefrontsize64") WavefrontSize = 64; bool IsOn = F.front() == '+'; StringRef Name = StringRef(F).drop_front(); if (llvm::find(TargetIDFeatures, Name) == TargetIDFeatures.end()) return; assert(OffloadArchFeatures.find(Name) == OffloadArchFeatures.end()); OffloadArchFeatures[Name] = IsOn; }); return true; } Optional getTargetID() const override { if (!isAMDGCN(getTriple())) return llvm::None; // When -target-cpu is not set, we assume generic code that it is valid // for all GPU and use an empty string as target ID to represent that. if (GPUKind == llvm::AMDGPU::GK_NONE) return std::string(""); return getCanonicalTargetID(getArchNameAMDGCN(GPUKind), OffloadArchFeatures); } }; } // namespace targets } // namespace clang #endif // LLVM_CLANG_LIB_BASIC_TARGETS_AMDGPU_H diff --git a/clang/lib/Basic/Targets/NVPTX.h b/clang/lib/Basic/Targets/NVPTX.h index 84828f0396c3..f8d0afdcceae 100644 --- a/clang/lib/Basic/Targets/NVPTX.h +++ b/clang/lib/Basic/Targets/NVPTX.h @@ -1,170 +1,168 @@ //===--- NVPTX.h - Declare NVPTX target feature support ---------*- 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 declares NVPTX TargetInfo objects. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H #define LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H #include "clang/Basic/Cuda.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/Compiler.h" namespace clang { namespace targets { static const unsigned NVPTXAddrSpaceMap[] = { 0, // Default 1, // opencl_global 3, // opencl_local 4, // opencl_constant 0, // opencl_private // FIXME: generic has to be added to the target 0, // opencl_generic 1, // opencl_global_device 1, // opencl_global_host 1, // cuda_device 4, // cuda_constant 3, // cuda_shared 0, // ptr32_sptr 0, // ptr32_uptr 0 // ptr64 }; /// The DWARF address class. Taken from /// https://docs.nvidia.com/cuda/archive/10.0/ptx-writers-guide-to-interoperability/index.html#cuda-specific-dwarf static const int NVPTXDWARFAddrSpaceMap[] = { -1, // Default, opencl_private or opencl_generic - not defined 5, // opencl_global -1, 8, // opencl_local or cuda_shared 4, // opencl_constant or cuda_constant }; class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo { static const char *const GCCRegNames[]; static const Builtin::Info BuiltinInfo[]; CudaArch GPU; uint32_t PTXVersion; std::unique_ptr HostTarget; public: NVPTXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts, unsigned TargetPointerWidth); void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override; ArrayRef getTargetBuiltins() const override; bool initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const override { Features[CudaArchToString(GPU)] = true; Features["ptx" + std::to_string(PTXVersion)] = true; return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec); } bool hasFeature(StringRef Feature) const override; ArrayRef getGCCRegNames() const override; ArrayRef getGCCRegAliases() const override { // No aliases. return None; } bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override { switch (*Name) { default: return false; case 'c': case 'h': case 'r': case 'l': case 'f': case 'd': Info.setAllowsRegister(); return true; } } const char *getClobbers() const override { // FIXME: Is this really right? return ""; } BuiltinVaListKind getBuiltinVaListKind() const override { // FIXME: implement return TargetInfo::CharPtrBuiltinVaList; } bool isValidCPUName(StringRef Name) const override { return StringToCudaArch(Name) != CudaArch::UNKNOWN; } void fillValidCPUList(SmallVectorImpl &Values) const override { for (int i = static_cast(CudaArch::SM_20); i < static_cast(CudaArch::LAST); ++i) Values.emplace_back(CudaArchToString(static_cast(i))); } bool setCPU(const std::string &Name) override { GPU = StringToCudaArch(Name); return GPU != CudaArch::UNKNOWN; } void setSupportedOpenCLOpts() override { auto &Opts = getSupportedOpenCLOpts(); Opts.support("cl_clang_storage_class_specifiers"); - Opts.support("cl_khr_gl_sharing"); - Opts.support("cl_khr_icd"); Opts.support("cl_khr_fp64"); Opts.support("cl_khr_byte_addressable_store"); Opts.support("cl_khr_global_int32_base_atomics"); Opts.support("cl_khr_global_int32_extended_atomics"); Opts.support("cl_khr_local_int32_base_atomics"); Opts.support("cl_khr_local_int32_extended_atomics"); } /// \returns If a target requires an address within a target specific address /// space \p AddressSpace to be converted in order to be used, then return the /// corresponding target specific DWARF address space. /// /// \returns Otherwise return None and no conversion will be emitted in the /// DWARF. Optional getDWARFAddressSpace(unsigned AddressSpace) const override { if (AddressSpace >= llvm::array_lengthof(NVPTXDWARFAddrSpaceMap) || NVPTXDWARFAddrSpaceMap[AddressSpace] < 0) return llvm::None; return NVPTXDWARFAddrSpaceMap[AddressSpace]; } CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { // CUDA compilations support all of the host's calling conventions. // // TODO: We should warn if you apply a non-default CC to anything other than // a host function. if (HostTarget) return HostTarget->checkCallingConvention(CC); return CCCR_Warning; } bool hasExtIntType() const override { return true; } }; } // namespace targets } // namespace clang #endif // LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H diff --git a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl index 6a07fc98069c..e7cb8d051321 100644 --- a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl +++ b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl @@ -1,229 +1,137 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple amdgcn-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple amdgcn-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple amdgcn-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple amdgcn-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // Extensions in all versions #ifndef cl_clang_storage_class_specifiers #error "Missing cl_clang_storage_class_specifiers define" #endif #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers: enable #ifndef cl_khr_fp16 #error "Missing cl_khr_fp16 define" #endif #pragma OPENCL EXTENSION cl_khr_fp16: enable #ifndef cl_khr_int64_base_atomics #error "Missing cl_khr_int64_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable #ifndef cl_khr_int64_extended_atomics #error "Missing cl_khr_int64_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable -#ifdef cl_khr_gl_sharing -#error "Incorrect cl_khr_gl_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_sharing' - ignoring}} - -#ifndef cl_khr_icd -#error "Missing cl_khr_icd define" -#endif -#pragma OPENCL EXTENSION cl_khr_icd: enable - // Core features in CL 1.1 #ifndef cl_khr_byte_addressable_store #error "Missing cl_khr_byte_addressable_store define" #endif #pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_base_atomics #error "Missing cl_khr_global_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_extended_atomics #error "Missing cl_khr_global_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_base_atomics #error "Missing cl_khr_local_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_extended_atomics #error "Missing cl_khr_local_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif -#ifdef cl_khr_select_fprounding_mode -#error "Incorrect cl_khr_select_fprounding_mode define" -#endif -#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_select_fprounding_mode' - ignoring}} - - // Core feature in CL 1.2 #ifndef cl_khr_fp64 #error "Missing cl_khr_fp64 define" #endif #pragma OPENCL EXTENSION cl_khr_fp64: enable #if (__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}} #endif //Core feature in CL 2.0 #ifndef cl_khr_3d_image_writes #error "Missing cl_khr_3d_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable #if (__OPENCL_C_VERSION__ >= 200) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_3d_image_writes' is core feature or supported optional core feature - ignoring}} #endif - - -#ifdef cl_khr_gl_event -#error "Incorrect cl_khr_gl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_event' - ignoring}} - -#ifdef cl_khr_d3d10_sharing -#error "Incorrect cl_khr_d3d10_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d10_sharing' - ignoring}} - -#ifdef cl_khr_context_abort -#error "Incorrect cl_context_abort define" -#endif -#pragma OPENCL EXTENSION cl_khr_context_abort: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_context_abort' - ignoring}} - -#ifdef cl_khr_d3d11_sharing -#error "Incorrect cl_khr_d3d11_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d11_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d11_sharing' - ignoring}} - -#ifdef cl_khr_dx9_media_sharing -#error "Incorrect cl_khr_dx9_media_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_dx9_media_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_dx9_media_sharing' - ignoring}} - -#ifdef cl_khr_image2d_from_buffer -#error "Incorrect cl_khr_image2d_from_buffer define" -#endif -#pragma OPENCL EXTENSION cl_khr_image2d_from_buffer: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_image2d_from_buffer' - ignoring}} - -#ifdef cl_khr_initialize_memory -#error "Incorrect cl_khr_initialize_memory define" -#endif -#pragma OPENCL EXTENSION cl_khr_initialize_memory: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_initialize_memory' - ignoring}} - -#ifdef cl_khr_gl_depth_images -#error "Incorrect cl_khr_gl_depth_images define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_depth_images: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_depth_images' - ignoring}} - #ifdef cl_khr_gl_msaa_sharing #error "Incorrect cl_khr_gl_msaa_sharing define" #endif #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring}} -#ifdef cl_khr_spir -#error "Incorrect cl_khr_spir define" -#endif -#pragma OPENCL EXTENSION cl_khr_spir: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_spir' - ignoring}} - -#ifdef cl_khr_egl_event -#error "Incorrect cl_khr_egl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_event' - ignoring}} - -#ifdef cl_khr_egl_image -#error "Incorrect cl_khr_egl_image define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_image: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_image' - ignoring}} - #if (__OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_mipmap_image #error "Missing cl_khr_mipmap_image define" #endif #else #ifdef cl_khr_mipmap_image #error "Incorrect cl_khr_mipmap_image define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_mipmap_image: enable #ifdef cl_khr_srgb_image_writes #error "Incorrect cl_khr_srgb_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_srgb_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}} #if (__OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_subgroups #error "Missing cl_khr_subgroups define" #endif #else #ifdef cl_khr_subgroups #error "Incorrect cl_khr_subgroups define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_subgroups: enable -#ifdef cl_khr_terminate_context -#error "Incorrect cl_khr_terminate_context define" -#endif -#pragma OPENCL EXTENSION cl_khr_terminate_context: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_terminate_context' - ignoring}} - #ifndef cl_amd_media_ops #error "Missing cl_amd_media_ops define" #endif #pragma OPENCL EXTENSION cl_amd_media_ops: enable #ifndef cl_amd_media_ops2 #error "Missing cl_amd_media_ops2 define" #endif #pragma OPENCL EXTENSION cl_amd_media_ops2: enable diff --git a/clang/test/Misc/nvptx.languageOptsOpenCL.cl b/clang/test/Misc/nvptx.languageOptsOpenCL.cl index 4c7e1539aa3a..09e02a835310 100644 --- a/clang/test/Misc/nvptx.languageOptsOpenCL.cl +++ b/clang/test/Misc/nvptx.languageOptsOpenCL.cl @@ -1,211 +1,118 @@ // REQUIRES: nvptx-registered-target // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple nvptx-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple nvptx-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple nvptx-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple nvptx-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple nvptx-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple nvptx64-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple nvptx64-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple nvptx64-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple nvptx64-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple nvptx64-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // Extensions in all versions #ifndef cl_clang_storage_class_specifiers #error "Missing cl_clang_storage_class_specifiers define" #endif #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers: enable #ifdef cl_khr_fp16 #error "Incorrect cl_khr_fp16 define" #endif #pragma OPENCL EXTENSION cl_khr_fp16: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_fp16' - ignoring}} #ifdef cl_khr_int64_base_atomics #error "Incorrect cl_khr_int64_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_base_atomics' - ignoring}} #ifdef cl_khr_int64_extended_atomics #error "Incorrect cl_khr_int64_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_extended_atomics' - ignoring}} -#ifndef cl_khr_gl_sharing -#error "Missing cl_khr_gl_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_sharing: enable - -#ifndef cl_khr_icd -#error "Missing cl_khr_icd define" -#endif -#pragma OPENCL EXTENSION cl_khr_icd: enable - // Core features in CL 1.1 #ifndef cl_khr_byte_addressable_store #error "Missing cl_khr_byte_addressable_store define" #endif #pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_base_atomics #error "Missing cl_khr_global_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_extended_atomics #error "Missing cl_khr_global_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_base_atomics #error "Missing cl_khr_local_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_extended_atomics #error "Missing cl_khr_local_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif -#if (__OPENCL_C_VERSION__ < 110) -// Deprecated above 1.0 -#ifdef cl_khr_select_fprounding_mode -#error "Incorrect cl_khr_select_fprounding_mode define" -#endif -#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_select_fprounding_mode' - ignoring}} -#endif - - // Core feature in CL 1.2 #ifndef cl_khr_fp64 #error "Missing cl_khr_fp64 define" #endif #pragma OPENCL EXTENSION cl_khr_fp64: enable #if (__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}} #endif // Core feature in CL 2.0, but not supported on nvptx #ifdef cl_khr_3d_image_writes #error "Incorrect cl_khr_3d_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_3d_image_writes' - ignoring}} - - -#ifdef cl_khr_gl_event -#error "Incorrect cl_khr_gl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_event' - ignoring}} - -#ifdef cl_khr_d3d10_sharing -#error "Incorrect cl_khr_d3d10_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d10_sharing' - ignoring}} - -#ifdef cl_khr_context_abort -#error "Incorrect cl_context_abort define" -#endif -#pragma OPENCL EXTENSION cl_khr_context_abort: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_context_abort' - ignoring}} - -#ifdef cl_khr_d3d11_sharing -#error "Incorrect cl_khr_d3d11_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d11_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d11_sharing' - ignoring}} - -#ifdef cl_khr_dx9_media_sharing -#error "Incorrect cl_khr_dx9_media_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_dx9_media_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_dx9_media_sharing' - ignoring}} - -#ifdef cl_khr_image2d_from_buffer -#error "Incorrect cl_khr_image2d_from_buffer define" -#endif -#pragma OPENCL EXTENSION cl_khr_image2d_from_buffer: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_image2d_from_buffer' - ignoring}} - -#ifdef cl_khr_initialize_memory -#error "Incorrect cl_khr_initialize_memory define" -#endif -#pragma OPENCL EXTENSION cl_khr_initialize_memory: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_initialize_memory' - ignoring}} - -#ifdef cl_khr_gl_depth_images -#error "Incorrect cl_khr_gl_depth_images define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_depth_images: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_depth_images' - ignoring}} - #ifdef cl_khr_gl_msaa_sharing #error "Incorrect cl_khr_gl_msaa_sharing define" #endif #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring}} -#ifdef cl_khr_spir -#error "Incorrect cl_khr_spir define" -#endif -#pragma OPENCL EXTENSION cl_khr_spir: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_spir' - ignoring}} - -#ifdef cl_khr_egl_event -#error "Incorrect cl_khr_egl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_event' - ignoring}} - -#ifdef cl_khr_egl_image -#error "Missing cl_khr_egl_image define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_image: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_image' - ignoring}} - #ifdef cl_khr_srgb_image_writes #error "Incorrect cl_khr_srgb_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_srgb_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}} #ifdef cl_khr_subgroups #error "Incorrect cl_khr_subgroups define" #endif #pragma OPENCL EXTENSION cl_khr_subgroups: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} -#ifdef cl_khr_terminate_context -#error "Incorrect cl_khr_terminate_context define" -#endif -#pragma OPENCL EXTENSION cl_khr_terminate_context: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_terminate_context' - ignoring}} diff --git a/clang/test/Misc/r600.languageOptsOpenCL.cl b/clang/test/Misc/r600.languageOptsOpenCL.cl index 58444cf7688a..e0d3022f3e4a 100644 --- a/clang/test/Misc/r600.languageOptsOpenCL.cl +++ b/clang/test/Misc/r600.languageOptsOpenCL.cl @@ -1,225 +1,134 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks // Extensions in all versions #ifndef cl_clang_storage_class_specifiers #error "Missing cl_clang_storage_class_specifiers define" #endif #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers: enable #ifdef cl_khr_fp16 #error "Incorrect cl_khr_fp16 define" #endif #pragma OPENCL EXTENSION cl_khr_fp16: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_fp16' - ignoring}} #ifdef cl_khr_int64_base_atomics #error "Incorrect cl_khr_int64_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_base_atomics' - ignoring}} #ifdef cl_khr_int64_extended_atomics #error "Incorrect cl_khr_int64_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_extended_atomics' - ignoring}} -#ifdef cl_khr_gl_sharing -#error "Incorrect cl_khr_gl_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_sharing' - ignoring}} - -#ifndef cl_khr_icd -#error "Missing cl_khr_icd define" -#endif -#pragma OPENCL EXTENSION cl_khr_icd: enable - // Core features in CL 1.1 #ifndef cl_khr_byte_addressable_store #error "Missing cl_khr_byte_addressable_store define" #endif #pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_base_atomics #error "Missing cl_khr_global_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_extended_atomics #error "Missing cl_khr_global_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_base_atomics #error "Missing cl_khr_local_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_extended_atomics #error "Missing cl_khr_local_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif -// Deprecated abvoe 1.0 -#ifdef cl_khr_select_fprounding_mode -#error "Incorrect cl_khr_select_fprounding_mode define" -#endif -#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_select_fprounding_mode' - ignoring}} - - // Core feature in CL 1.2 #ifdef __HAS_FP64__ #ifndef cl_khr_fp64 #error "Missing cl_khr_fp64 define" #endif #pragma OPENCL EXTENSION cl_khr_fp64: enable #if (__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}} #endif #else #ifdef cl_khr_fp64 #error "Incorrect cl_khr_fp64 define" #endif #pragma OPENCL EXTENSION cl_khr_fp64: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}} #endif // __HAS_FP64__ //Core feature in CL 2.0 #ifdef cl_khr_3d_image_writes #error "Incorrect cl_khr_3d_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_3d_image_writes' - ignoring}} - -#ifdef cl_khr_gl_event -#error "Incorrect cl_khr_gl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_event' - ignoring}} - -#ifdef cl_khr_d3d10_sharing -#error "Incorrect cl_khr_d3d10_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d10_sharing' - ignoring}} - -#ifdef cl_khr_context_abort -#error "Incorrect cl_context_abort define" -#endif -#pragma OPENCL EXTENSION cl_khr_context_abort: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_context_abort' - ignoring}} - -#ifdef cl_khr_d3d11_sharing -#error "Incorrect cl_khr_d3d11_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_d3d11_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_d3d11_sharing' - ignoring}} - -#ifdef cl_khr_dx9_media_sharing -#error "Incorrect cl_khr_dx9_media_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_dx9_media_sharing: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_dx9_media_sharing' - ignoring}} - -#ifdef cl_khr_image2d_from_buffer -#error "Incorrect cl_khr_image2d_from_buffer define" -#endif -#pragma OPENCL EXTENSION cl_khr_image2d_from_buffer: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_image2d_from_buffer' - ignoring}} - -#ifdef cl_khr_initialize_memory -#error "Incorrect cl_khr_initialize_memory define" -#endif -#pragma OPENCL EXTENSION cl_khr_initialize_memory: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_initialize_memory' - ignoring}} - -#ifdef cl_khr_gl_depth_images -#error "Incorrect cl_khr_gl_depth_images define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_depth_images: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_depth_images' - ignoring}} - #ifdef cl_khr_gl_msaa_sharing #error "Incorrect cl_khr_gl_msaa_sharing define" #endif #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring}} -#ifdef cl_khr_spir -#error "Incorrect cl_khr_spir define" -#endif -#pragma OPENCL EXTENSION cl_khr_spir: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_spir' - ignoring}} - -#ifdef cl_khr_egl_event -#error "Incorrect cl_khr_egl_event define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_event: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_event' - ignoring}} - -#ifdef cl_khr_egl_image -#error "Incorrect cl_khr_egl_image define" -#endif -#pragma OPENCL EXTENSION cl_khr_egl_image: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_egl_image' - ignoring}} - #ifdef cl_khr_srgb_image_writes #error "Incorrect cl_khr_srgb_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_srgb_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}} #ifdef cl_khr_subgroups #error "Incorrect cl_khr_subgroups define" #endif #pragma OPENCL EXTENSION cl_khr_subgroups: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} -#ifdef cl_khr_terminate_context -#error "Incorrect cl_khr_terminate_context define" -#endif -#pragma OPENCL EXTENSION cl_khr_terminate_context: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_terminate_context' - ignoring}} diff --git a/clang/test/SemaOpenCL/extension-version.cl b/clang/test/SemaOpenCL/extension-version.cl index 4d0e79cd39c5..c4bf936f18ff 100644 --- a/clang/test/SemaOpenCL/extension-version.cl +++ b/clang/test/SemaOpenCL/extension-version.cl @@ -1,419 +1,292 @@ // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple spir-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple spir-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple spir-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple spir-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=clc++ %s -verify -triple spir-unknown-unknown // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES // RUN: %clang_cc1 -x cl -cl-std=clc++ %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) && !defined(TEST_CORE_FEATURES) // expected-no-diagnostics #endif // Extensions in all versions #ifndef cl_clang_storage_class_specifiers #error "Missing cl_clang_storage_class_specifiers define" #endif #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers: enable #ifndef cl_khr_fp16 #error "Missing cl_khr_fp16 define" #endif #pragma OPENCL EXTENSION cl_khr_fp16: enable #ifndef cl_khr_int64_base_atomics #error "Missing cl_khr_int64_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable #ifndef cl_khr_int64_extended_atomics #error "Missing cl_khr_int64_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable -#ifndef cl_khr_gl_sharing -#error "Missing cl_khr_gl_sharing define" -#endif -#pragma OPENCL EXTENSION cl_khr_gl_sharing: enable - -#ifndef cl_khr_icd -#error "Missing cl_khr_icd define" -#endif -#pragma OPENCL EXTENSION cl_khr_icd: enable - // Core features in CL 1.1 #ifndef cl_khr_byte_addressable_store #error "Missing cl_khr_byte_addressable_store define" #endif #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_base_atomics #error "Missing cl_khr_global_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_global_int32_extended_atomics #error "Missing cl_khr_global_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_base_atomics #error "Missing cl_khr_local_int32_base_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}} #endif #ifndef cl_khr_local_int32_extended_atomics #error "Missing cl_khr_local_int32_extended_atomics define" #endif #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}} #endif -#if (defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 110) -// Deprecated abvoe 1.0 -#ifndef cl_khr_select_fprounding_mode -#error "Missing cl_khr_select_fp_rounding_mode define" -#endif -#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable -#endif - - // Core feature in CL 1.2 #ifndef cl_khr_fp64 #error "Missing cl_khr_fp64 define" #endif #pragma OPENCL EXTENSION cl_khr_fp64 : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}} #endif //Core feature in CL 2.0 #ifndef cl_khr_3d_image_writes #error "Missing cl_khr_3d_image_writes define" #endif #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) && defined TEST_CORE_FEATURES // expected-warning@-2{{OpenCL extension 'cl_khr_3d_image_writes' is core feature or supported optional core feature - ignoring}} #endif -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) -#ifndef cl_khr_gl_event -#error "Missing cl_khr_gl_event define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_gl_event' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_gl_event : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) -#ifndef cl_khr_d3d10_sharing -#error "Missing cl_khr_d3d10_sharing define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_d3d10_sharing' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_d3d10_sharing : enable - #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 110) #ifndef cles_khr_int64 #error "Missing cles_khr_int64 define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cles_khr_int64' - ignoring}} #endif #pragma OPENCL EXTENSION cles_khr_int64 : enable -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_context_abort -#error "Missing cl_context_abort define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_context_abort' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_context_abort : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_d3d11_sharing -#error "Missing cl_khr_d3d11_sharing define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_d3d11_sharing' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_d3d11_sharing : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_dx9_media_sharing -#error "Missing cl_khr_dx9_media_sharing define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_dx9_media_sharing' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_dx9_media_sharing : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_image2d_from_buffer -#error "Missing cl_khr_image2d_from_buffer define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_image2d_from_buffer' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_image2d_from_buffer : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_initialize_memory -#error "Missing cl_khr_initialize_memory define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_initialize_memory' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_initialize_memory : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_gl_depth_images -#error "Missing cl_khr_gl_depth_images define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_gl_depth_images' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_gl_depth_images : enable - #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) #ifndef cl_khr_gl_msaa_sharing #error "Missing cl_khr_gl_msaa_sharing define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) -#ifndef cl_khr_spir -#error "Missing cl_khr_spir define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_spir' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_spir : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) -#ifndef cl_khr_egl_event -#error "Missing cl_khr_egl_event define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_egl_event' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_egl_event : enable - -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) -#ifndef cl_khr_egl_image -#error "Missing cl_khr_egl_image define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_egl_image' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_egl_image : enable - #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_mipmap_image #error "Missing cl_khr_mipmap_image define" #endif #else #ifdef cl_khr_mipmap_image #error "Incorrect cl_khr_mipmap_image define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_mipmap_image : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_mipmap_image_writes #error "Missing cl_khr_mipmap_image_writes define" #endif #else #ifdef cl_khr_mipmap_image_writes #error "Incorrect cl_khr_mipmap_image_writes define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_mipmap_image_writes' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_mipmap_image_writes : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_srgb_image_writes #error "Missing cl_khr_srgb_image_writes define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_srgb_image_writes : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) #ifndef cl_khr_subgroups #error "Missing cl_khr_subgroups define" #endif #else #ifdef cl_khr_subgroups #error "Incorrect cl_khr_subgroups define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_subgroups : enable -#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) -#ifndef cl_khr_terminate_context -#error "Missing cl_khr_terminate_context define" -#endif -#else -// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_terminate_context' - ignoring}} -#endif -#pragma OPENCL EXTENSION cl_khr_terminate_context: enable - #ifndef cl_amd_media_ops #error "Missing cl_amd_media_ops define" #endif #pragma OPENCL EXTENSION cl_amd_media_ops: enable #ifndef cl_amd_media_ops2 #error "Missing cl_amd_media_ops2 define" #endif #pragma OPENCL EXTENSION cl_amd_media_ops2 : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) #ifndef cl_khr_depth_images #error "Missing cl_khr_depth_images define" #endif #else #ifdef cl_khr_depth_images #error "Incorrect cl_khr_depth_images define" #endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_depth_images' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_depth_images : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) #ifndef cl_intel_subgroups #error "Missing cl_intel_subgroups define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cl_intel_subgroups' - ignoring}} #endif #pragma OPENCL EXTENSION cl_intel_subgroups : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) #ifndef cl_intel_subgroups_short #error "Missing cl_intel_subgroups_short define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cl_intel_subgroups_short' - ignoring}} #endif #pragma OPENCL EXTENSION cl_intel_subgroups_short : enable #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120) #ifndef cl_intel_device_side_avc_motion_estimation #error "Missing cl_intel_device_side_avc_motion_estimation define" #endif #else // expected-warning@+2{{unsupported OpenCL extension 'cl_intel_device_side_avc_motion_estimation' - ignoring}} #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