From 87409183125b863be0c3e0470b2417c3c92a748b Mon Sep 17 00:00:00 2001 From: Mengchi Zhang Date: Sun, 9 Jun 2019 02:47:39 -0400 Subject: Move some vars back to cuda_api_object Signed-off-by: Mengchi Zhang --- libcuda/cuda_api_object.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'libcuda/cuda_api_object.h') diff --git a/libcuda/cuda_api_object.h b/libcuda/cuda_api_object.h index 2001f91..41337c6 100644 --- a/libcuda/cuda_api_object.h +++ b/libcuda/cuda_api_object.h @@ -1,14 +1,68 @@ #ifndef __cuda_api_object_h__ #define __cuda_api_object_h__ + +#include +#include +#include +#include + class cuobjdumpSection; +class cuobjdumpELFSection; +class cuobjdumpPTXSection; +class symbol_table; +class gpgpu_ptx_sim_arg; class kernel_config; +class kernel_info_t; + +typedef std::list gpgpu_ptx_sim_arg_list_t; + +#ifndef OPENGL_SUPPORT +typedef unsigned long GLuint; +#endif + +struct glbmap_entry { + GLuint m_bufferObj; + void *m_devPtr; + size_t m_size; + struct glbmap_entry *m_next; +}; + +typedef struct glbmap_entry glbmap_entry_t; class cuda_runtime_api { public: + cuda_runtime_api() { + g_glbmap = NULL; + } // global list + std::list cuobjdumpSectionList; std::list libSectionList; std::list g_cuda_launch_stack; + std::mapfatbin_registered; + std::map fatbinmap; + std::map name_symtab; + std::map g_mallocPtr_Size; + //maps sm version number to set of filenames + std::map > version_filename; + std::map pinned_memory; //support for pinned memories added + std::map pinned_memory_size; + glbmap_entry_t* g_glbmap; // member function list + void cuobjdumpInit(); + void extract_code_using_cuobjdump(); + void extract_ptx_files_using_cuobjdump(CUctx_st *context); + void cuobjdumpParseBinary(unsigned int handle); + std::list pruneSectionList(CUctx_st *context); + std::list mergeMatchingSections(std::string identifier); + std::list mergeSections(); + cuobjdumpELFSection* findELFSection(const std::string identifier); + cuobjdumpPTXSection* findPTXSection(const std::string identifier); + void cuobjdumpRegisterFatBinary(unsigned int handle, const char* filename, CUctx_st *context); + kernel_info_t *gpgpu_cuda_ptx_sim_init_grid( const char *kernel_key, + gpgpu_ptx_sim_arg_list_t args, + struct dim3 gridDim, + struct dim3 blockDim, + struct CUctx_st* context ); }; #endif /* __cuda_api_object_h__ */ -- cgit v1.3