Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenCL] Add supported OpenCL extensions to target info.
Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
- Loading branch information
Showing
28 changed files
with
277 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//===--- OpenCLOptions.h ----------------------------------------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// \brief Defines the clang::OpenCLOptions class. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_CLANG_BASIC_OPENCLOPTIONS_H | ||
#define LLVM_CLANG_BASIC_OPENCLOPTIONS_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace clang { | ||
|
||
/// \brief OpenCL supported extensions and optional core features | ||
class OpenCLOptions { | ||
public: | ||
#define OPENCLEXT(nm) unsigned nm : 1; | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
|
||
OpenCLOptions() { | ||
#define OPENCLEXT(nm) nm = 0; | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
} | ||
|
||
// Enable all options. | ||
void setAll() { | ||
#define OPENCLEXT(nm) nm = 1; | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
} | ||
|
||
// Is supported with OpenCL version \p OCLVer. | ||
#define OPENCLEXT_INTERNAL(Ext, Avail, ...) \ | ||
bool is_##Ext##_supported(unsigned OCLVer) const { \ | ||
return Ext && OCLVer >= Avail; \ | ||
} | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
|
||
|
||
// Is supported OpenCL extension with OpenCL version \p OCLVer. | ||
// For supported optional core feature, return false. | ||
#define OPENCLEXT_INTERNAL(Ext, Avail, Core) \ | ||
bool is_##Ext##_supported_extension(unsigned CLVer) const { \ | ||
return is_##Ext##_supported(CLVer) && (Core == ~0U || CLVer < Core); \ | ||
} | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
|
||
// Is supported OpenCL core features with OpenCL version \p OCLVer. | ||
// For supported extension, return false. | ||
#define OPENCLEXT_INTERNAL(Ext, Avail, Core) \ | ||
bool is_##Ext##_supported_core(unsigned CLVer) const { \ | ||
return is_##Ext##_supported(CLVer) && Core != ~0U && CLVer >= Core; \ | ||
} | ||
#include "clang/Basic/OpenCLExtensions.def" | ||
|
||
}; | ||
|
||
} // end namespace clang | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.