summaryrefslogtreecommitdiff
path: root/backend/src/ir/function.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/ir/function.hpp')
-rw-r--r--backend/src/ir/function.hpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/backend/src/ir/function.hpp b/backend/src/ir/function.hpp
index b7853c17..cbaa2083 100644
--- a/backend/src/ir/function.hpp
+++ b/backend/src/ir/function.hpp
@@ -182,6 +182,31 @@ namespace ir {
std::string typeQual;
std::string argName; // My different from arg->getName()
+
+ // only llvm-3.6 or later has kernel_arg_base_type in metadata.
+#if (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR <= 5)
+ bool isImage1dT() const {
+ return typeName.compare("image1d_t") == 0;
+ }
+ bool isImage1dArrayT() const {
+ return typeName.compare("image1d_array_t") == 0;
+ }
+ bool isImage1dBufferT() const {
+ return typeName.compare("image1d_buffer_t") == 0;
+ }
+ bool isImage2dT() const {
+ return typeName.compare("image2d_t") == 0;
+ }
+ bool isImage2dArrayT() const {
+ return typeName.compare("image2d_array_t") == 0;
+ }
+ bool isImage3dT() const {
+ return typeName.compare("image3d_t") == 0;
+ }
+ bool isSamplerType() const {
+ return typeName.compare("sampler_t") == 0;
+ }
+#else
bool isImage1dT() const {
return typeBaseName.compare("image1d_t") == 0;
}
@@ -200,16 +225,16 @@ namespace ir {
bool isImage3dT() const {
return typeBaseName.compare("image3d_t") == 0;
}
+ bool isSamplerType() const {
+ return typeBaseName.compare("sampler_t") == 0;
+ }
+#endif
bool isImageType() const {
return isImage1dT() || isImage1dArrayT() || isImage1dBufferT() ||
isImage2dT() || isImage2dArrayT() || isImage3dT();
}
- bool isSamplerType() const {
- return typeBaseName.compare("sampler_t") == 0;
- }
-
};
/*! Create a function input argument */