Module test correction and hipModuleUnload API

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

Change-Id: I9c40337043d7972a570b795e1bfc104bd2c4d8aa
Cette révision appartient à :
Aditya Atluri a révisé 2016-08-23 14:19:15 -05:00
1 Parent 2f426aaaea
révision 768287f2a2
4 fichiers modifiés
+65 -188

Aucun fichier ne correspond à votre recherche

+13
Voir le fichier
@@ -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();