summaryrefslogtreecommitdiff
path: root/libcuda/cuobjdump.h
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2019-05-29 01:28:29 -0400
committerMengchi Zhang <[email protected]>2019-05-29 01:28:29 -0400
commit25bdc0dd89932f95ace0fc617649a4e041aaadd9 (patch)
tree2cac703dbb84ca04bc3e75c3d4c0074b13274d8a /libcuda/cuobjdump.h
parent568e3185c58b07ac31fdd59f6c2aa7af7533939e (diff)
Move SectionList to context
Signed-off-by: Mengchi Zhang <[email protected]>
Diffstat (limited to 'libcuda/cuobjdump.h')
-rw-r--r--libcuda/cuobjdump.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/libcuda/cuobjdump.h b/libcuda/cuobjdump.h
index 66cd736..49af3e2 100644
--- a/libcuda/cuobjdump.h
+++ b/libcuda/cuobjdump.h
@@ -1,5 +1,9 @@
#ifndef __cuobjdump_h__
#define __cuobjdump_h__
+#include <string>
+#include <list>
+#include <iostream>
+
struct cuobjdump_parser {
yyscan_t scanner;
int elfserial;
@@ -9,4 +13,67 @@ struct cuobjdump_parser {
FILE *sassfile;
char filename [1024];
};
+
+class cuobjdumpSection {
+public:
+ //Constructor
+ cuobjdumpSection() {
+ arch = 0;
+ identifier = "";
+ }
+ virtual ~cuobjdumpSection() {}
+ unsigned getArch() {return arch;}
+ void setArch(unsigned a) {arch = a;}
+ std::string getIdentifier() {return identifier;}
+ void setIdentifier(std::string i) {identifier = i;}
+ virtual void print(){std::cout << "cuobjdump Section: unknown type" << std::endl;}
+private:
+ unsigned arch;
+ std::string identifier;
+};
+
+class cuobjdumpELFSection : public cuobjdumpSection
+{
+public:
+ cuobjdumpELFSection() {}
+ virtual ~cuobjdumpELFSection() {
+ elffilename = "";
+ sassfilename = "";
+ }
+ std::string getELFfilename() {return elffilename;}
+ void setELFfilename(std::string f) {elffilename = f;}
+ std::string getSASSfilename() {return sassfilename;}
+ void setSASSfilename(std::string f) {sassfilename = f;}
+ virtual void print() {
+ std::cout << "ELF Section:" << std::endl;
+ std::cout << "arch: sm_" << getArch() << std::endl;
+ std::cout << "identifier: " << getIdentifier() << std::endl;
+ std::cout << "elf filename: " << getELFfilename() << std::endl;
+ std::cout << "sass filename: " << getSASSfilename() << std::endl;
+ std::cout << std::endl;
+ }
+private:
+ std::string elffilename;
+ std::string sassfilename;
+};
+
+class cuobjdumpPTXSection : public cuobjdumpSection
+{
+public:
+ cuobjdumpPTXSection(){
+ ptxfilename = "";
+ }
+ std::string getPTXfilename() {return ptxfilename;}
+ void setPTXfilename(std::string f) {ptxfilename = f;}
+ virtual void print() {
+ std::cout << "PTX Section:" << std::endl;
+ std::cout << "arch: sm_" << getArch() << std::endl;
+ std::cout << "identifier: " << getIdentifier() << std::endl;
+ std::cout << "ptx filename: " << getPTXfilename() << std::endl;
+ std::cout << std::endl;
+ }
+private:
+ std::string ptxfilename;
+};
+
#endif /* __cuobjdump_h__ */