Refactor Module and Function APIs.

- hipFunction_t is now returned by value.  This eliminates dynamic
      allocation / memory management complexity in the module.  Removed
the kernel
      name so the structure is just 16 bytes now.

    - Moved the hsa_executable_load_module and hsa_executable_freeze
      calls to the hipModuleLoad and hipModuleLoadData calls.

    - Apply sharedMemBytes in hipModuleLaunchKernel to group segment
      size (not private).
This commit is contained in:
Ben Sander
2016-12-17 07:19:22 -06:00
parent 263a9614ff
commit 4d29885be3
4 changed files with 52 additions and 65 deletions
+7 -2
View File
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include <hip/hcc_detail/host_defines.h>
#include <hip/hip_runtime_api.h>
//#include "hip/hip_hcc.h"
#include <hsa/hsa.h>
#if defined (__HCC__) && (__hcc_workweek__ < 16155)
#error("This version of HIP requires a newer version of HCC.");
@@ -72,7 +72,12 @@ typedef struct ihipIpcEventHandle_t *hipIpcEventHandle_t;
typedef struct ihipModule_t *hipModule_t;
typedef struct ihipFunction_t *hipFunction_t;
struct ihipModuleSymbol_t{
hsa_executable_symbol_t _hsaSymbol;
uint64_t _object; // The kernel object.
};
typedef struct ihipModuleSymbol_t hipFunction_t;
typedef void* hipDeviceptr_t;