Add initial support for validating and exporting reduce kernels.
Bug: 22631253
This change adds support to slang to validate the reduce-style
kernels for errors, and also to create reduce metadata.
Change-Id: Ic9144402dff93a2a28687864637e67fca6808e2e
diff --git a/slang_rs_context.h b/slang_rs_context.h
index 8e9b577..8cced4d 100644
--- a/slang_rs_context.h
+++ b/slang_rs_context.h
@@ -48,6 +48,7 @@
class RSExportVar;
class RSExportFunc;
class RSExportForEach;
+ class RSExportReduce;
class RSExportType;
class RSContext {
@@ -60,6 +61,7 @@
typedef std::list<RSExportVar*> ExportVarList;
typedef std::list<RSExportFunc*> ExportFuncList;
typedef std::list<RSExportForEach*> ExportForEachList;
+ typedef std::list<RSExportReduce*> ExportReduceList;
typedef llvm::StringMap<RSExportType*> ExportTypeMap;
private:
@@ -100,6 +102,7 @@
ExportVarList mExportVars;
ExportFuncList mExportFuncs;
ExportForEachList mExportForEach;
+ ExportReduceList mExportReduce;
ExportTypeMap mExportTypes;
public:
@@ -198,6 +201,15 @@
}
inline bool hasExportForEach() const { return !mExportForEach.empty(); }
+ typedef ExportReduceList::const_iterator const_export_reduce_iterator;
+ const_export_reduce_iterator export_reduce_begin() const {
+ return mExportReduce.begin();
+ }
+ const_export_reduce_iterator export_reduce_end() const {
+ return mExportReduce.end();
+ }
+ inline bool hasExportReduce() const { return !mExportReduce.empty(); }
+
typedef ExportTypeMap::iterator export_type_iterator;
typedef ExportTypeMap::const_iterator const_export_type_iterator;
export_type_iterator export_types_begin() { return mExportTypes.begin(); }