Skip to content
Snippets Groups Projects
Commit c01f5254 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

Policy workign for pipeline example. One push and one pop case

parent e04115c5
No related branches found
No related tags found
No related merge requests found
......@@ -12,13 +12,24 @@ class Policy {
class NodePolicy : public Policy {
virtual int getVersion(const char *name, int64_t it) override {
std::string s(name);
std::string NodeNames[1] = { "_Z9mysgemmNTPfiS_iS_iiff_clonedInternal_level2_cloned" };
if (!s.compare(NodeNames[0])) {
// if this is the kernel launch node
return 1;
} else {
return 0;
}
//std::string NodeNames[1] = { "_Z9mysgemmNTPfiS_iS_iiff_clonedInternal_level2_cloned" };
std::string NodeNames[] = {
"WrapperGaussianSmoothing_cloned",
"WrapperlaplacianEstimate_cloned",
"WrapperComputeZeroCrossings_cloned",
"WrapperComputeGradient_cloned",
"WrapperComputeMaxGradient_cloned",
"WrapperRejectZeroCrossings_cloned",
};
//for(int i = 0; i < 6; i++) {
if (!s.compare(NodeNames[4])) {
// if this is the kernel launch node
std::cout << s << ": CPU" << "\n";
return 0;
}
//}
std::cout << s << ": GPU" << "\n";
return 1;
}
};
......
......@@ -4,10 +4,12 @@ import re
regexSourceFile = re.compile(r"^source_filename.*")
regexMetadataLine = re.compile(r"^![0-9].*")
regexGEP = re.compile(r"(?P<prefix>.*)getelementptr(?P<attr>[A-Za-z ]*)? [<0-9 ]*[A-Zx>a-z 0-9%\.]*,")
regexGEPArr = re.compile(r"(?P<prefix>.*)getelementptr(?P<attr>[A-Za-z ]*)? \[.*],")
regexLoad = re.compile(r"(?P<prefix>.*)= load [<0-9 ]*[A-zx> 0-9%\.]*,")
regexFast = re.compile(r"(?P<prefix>.*)fast")
regexWriteOnly = re.compile(r"(?P<prefix>.*)writeonly")
regexArgmemonly = re.compile(r"(?P<prefix>.*)argmemonly")
regexNonnull = re.compile(r"(?P<prefix>.*)nonnull")
with open(sys.argv[1], 'r') as file_LLVM_40:
with open(sys.argv[2], "w") as file_LLVM_34:
......@@ -18,6 +20,8 @@ with open(sys.argv[1], 'r') as file_LLVM_40:
elif (regexMetadataLine.match(line)):
newLine = "".join((line[0], line[1:].replace(line[0], "metadata !")))
newLine = newLine.replace("distinct", "")
elif (regexGEPArr.match(line)):
newLine = regexGEPArr.sub("\g<prefix>getelementptr\g<attr>", line)
elif (regexGEP.match(line)):
newLine = regexGEP.sub("\g<prefix>getelementptr\g<attr>", line)
elif (regexLoad.match(line)):
......@@ -28,4 +32,6 @@ with open(sys.argv[1], 'r') as file_LLVM_40:
newLine = regexWriteOnly.sub("\g<prefix>", line)
elif (regexArgmemonly.match(line)):
newLine = regexArgmemonly.sub("\g<prefix>", line)
elif (regexNonnull.match(line)):
newLine = regexNonnull.sub("\g<prefix>", line)
file_LLVM_34.write(newLine)
......@@ -24,7 +24,7 @@
#include <visc.h>
#define NUM_RUNS 10000
#define NUM_RUNS 5
#define DEPTH 3
#define HEIGHT 640
#define WIDTH 480
......@@ -873,6 +873,7 @@ int main (int argc, char *argv[]) {
}
int NUM_FRAMES = cap.get(CV_CAP_PROP_FRAME_COUNT);
//NUM_FRAMES = 5;
std::cout << "Number of frames = " << NUM_FRAMES << "\n";
namedWindow(input_window, CV_WINDOW_AUTOSIZE);
namedWindow(output_window, CV_WINDOW_AUTOSIZE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment