-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement basic infrastructure for optimization passes.
- Loading branch information
1 parent
13ae25b
commit 3ced497
Showing
4 changed files
with
57 additions
and
2 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
30 changes: 30 additions & 0 deletions
30
schedulers/tetrisched/include/tetrisched/OptimizationPasses.hpp
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,30 @@ | ||
#ifndef _TETRISCHED_OPTIMIZATION_PASSES_HPP_ | ||
#define _TETRISCHED_OPTIMIZATION_PASSES_HPP_ | ||
|
||
#include <string> | ||
|
||
#include "tetrisched/Expression.hpp" | ||
|
||
namespace tetrisched { | ||
class OptimizationPass { | ||
/// A representative name of the optimization pass. | ||
std::string name; | ||
|
||
public: | ||
/// Construct the base OptimizationPass class. | ||
OptimizationPass(std::string name); | ||
|
||
/// Run the pass on the given STRL expression. | ||
virtual void runPass(ExpressionPtr strlExpression) = 0; | ||
}; | ||
|
||
class CriticalPathOptimizationPass : public OptimizationPass { | ||
public: | ||
/// Instantiate the Critical Path optimization pass. | ||
CriticalPathOptimizationPass(); | ||
|
||
/// Run the Critical Path optimization pass on the given STRL expression. | ||
void runPass(ExpressionPtr strlExpression) override; | ||
}; | ||
} // namespace tetrisched | ||
#endif // _TETRISCHED_OPTIMIZATION_PASSES_HPP_ |
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,15 @@ | ||
#include "tetrisched/OptimizationPasses.hpp" | ||
|
||
namespace tetrisched { | ||
|
||
/* Methods for OptimizationPass */ | ||
OptimizationPass::OptimizationPass(std::string name) : name(name) {} | ||
|
||
/* Methods for CriticalPathOptimizationPass */ | ||
CriticalPathOptimizationPass::CriticalPathOptimizationPass() | ||
: OptimizationPass("CriticalPathOptimizationPass") {} | ||
|
||
void CriticalPathOptimizationPass::runPass(ExpressionPtr strlExpression) { | ||
// TODO (Sukrit): Implement this. | ||
} | ||
} |
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,8 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include "tetrisched/OptimizationPasses.hpp" | ||
|
||
TEST(OptimizationTest, TestBasicCriticalPathOptimizationPass) { | ||
// Create an OptimizationPass object. | ||
tetrisched::CriticalPathOptimizationPass optimizationPass(); | ||
} |