Module test correction and hipModuleUnload API

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

Change-Id: I9c40337043d7972a570b795e1bfc104bd2c4d8aa
Этот коммит содержится в:
Aditya Atluri
2016-08-23 14:19:15 -05:00
родитель f9d49c2aed
Коммит 2287af23a1
4 изменённых файлов: 65 добавлений и 188 удалений
+13
Просмотреть файл
@@ -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();