diff options
| author | Tor Aamodt <[email protected]> | 2020-07-04 16:26:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-04 16:26:52 -0700 |
| commit | 673f8a9f0056b456871642f4d25be5c598fcba6e (patch) | |
| tree | a9f379ae6ff144e8f3eccd3d510a36c2c0983edd /libcuda/cuobjdump.h | |
| parent | c9cc4281bf84ad6cff77d20389b59d14a534ad6b (diff) | |
| parent | 9d3caa1cb2c70a3be186d4704ecab0fe13277516 (diff) | |
Merge pull request #1 from gpgpu-sim/dev
Dev
Diffstat (limited to 'libcuda/cuobjdump.h')
| -rw-r--r-- | libcuda/cuobjdump.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/libcuda/cuobjdump.h b/libcuda/cuobjdump.h new file mode 100644 index 0000000..38afa4c --- /dev/null +++ b/libcuda/cuobjdump.h @@ -0,0 +1,81 @@ +#ifndef __cuobjdump_h__ +#define __cuobjdump_h__ +#include <iostream> +#include <list> +#include <string> + +typedef void *yyscan_t; +struct cuobjdump_parser { + yyscan_t scanner; + int elfserial; + int ptxserial; + FILE *ptxfile; + FILE *elffile; + 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__ */ |
