Module test correction and hipModuleUnload API

- Corrected the hipModule.cpp test to minimal code
- Added hipModuleUnload API
- Added hipModuleUnload API test

Change-Id: I9c40337043d7972a570b795e1bfc104bd2c4d8aa


[ROCm/hip commit: 2287af23a1]
Tá an tiomantas seo le fáil i:
Aditya Atluri tiomanta 2016-08-23 14:19:15 -05:00
1 tuismitheoir 6562018204
tiomantas 6842171207
4 comhad athraithe
+65 -188

Níor tháinig aon chomhaid le do chuardach

+13
Féach ar an gComhad
@@ -116,6 +116,19 @@ hipError_t hipModuleLoad(hipModule *module, const char *fname){
return ret;
}
hipError_t hipModuleUnload(hipModule hmod){
hsa_executable_t exec;
hsa_code_object_t co;
hipError_t ret = hipSuccess;
exec.handle = hmod.executable;
co.handle = hmod.object;
hsa_status_t status = hsa_executable_destroy(exec);
if(status != HSA_STATUS_SUCCESS){ret = hipErrorInvalidValue; }
status = hsa_code_object_destroy(co);
if(status != HSA_STATUS_SUCCESS){ret = hipErrorInvalidValue; }
return ret;
}
hipError_t hipModuleGetFunction(hipFunction *func, hipModule hmod, const char *name){
HIP_INIT_API(name);
auto ctx = ihipGetTlsDefaultCtx();