1 //===--- OpenCLOptions.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Defines the clang::OpenCLOptions class.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_BASIC_OPENCLOPTIONS_H
16 #define LLVM_CLANG_BASIC_OPENCLOPTIONS_H
23 /// \brief OpenCL supported extensions and optional core features
26 #define OPENCLEXT(nm) unsigned nm : 1;
27 #include "clang/Basic/OpenCLExtensions.def"
30 #define OPENCLEXT(nm) nm = 0;
31 #include "clang/Basic/OpenCLExtensions.def"
34 // Enable all options.
36 #define OPENCLEXT(nm) nm = 1;
37 #include "clang/Basic/OpenCLExtensions.def"
40 // Is supported with OpenCL version \p OCLVer.
41 #define OPENCLEXT_INTERNAL(Ext, Avail, ...) \
42 bool is_##Ext##_supported(unsigned OCLVer) const { \
43 return Ext && OCLVer >= Avail; \
45 #include "clang/Basic/OpenCLExtensions.def"
48 // Is supported OpenCL extension with OpenCL version \p OCLVer.
49 // For supported optional core feature, return false.
50 #define OPENCLEXT_INTERNAL(Ext, Avail, Core) \
51 bool is_##Ext##_supported_extension(unsigned CLVer) const { \
52 return is_##Ext##_supported(CLVer) && (Core == ~0U || CLVer < Core); \
54 #include "clang/Basic/OpenCLExtensions.def"
56 // Is supported OpenCL core features with OpenCL version \p OCLVer.
57 // For supported extension, return false.
58 #define OPENCLEXT_INTERNAL(Ext, Avail, Core) \
59 bool is_##Ext##_supported_core(unsigned CLVer) const { \
60 return is_##Ext##_supported(CLVer) && Core != ~0U && CLVer >= Core; \
62 #include "clang/Basic/OpenCLExtensions.def"
66 } // end namespace clang