Merge pull request #1515 from ansurya/tex_unbind_issue_fix

Fix undefined ref to hipUnbindTexture for texture types
Этот коммит содержится в:
Rahul Garg
2019-10-30 17:54:15 -07:00
коммит произвёл GitHub
родитель 961bc5737e 9332a39838
Коммит aeb7cebbad
5 изменённых файлов: 11 добавлений и 4 удалений
+5
Просмотреть файл
@@ -1398,6 +1398,11 @@ inline static hipError_t hipUnbindTexture(struct texture<T, dim, readMode>* tex)
return hipCUDAErrorTohipError(cudaUnbindTexture(tex));
}
template <class T, int dim, enum hipTextureReadMode readMode>
inline static hipError_t hipUnbindTexture(struct texture<T, dim, readMode> &tex) {
return hipCUDAErrorTohipError(cudaUnbindTexture(tex));
}
inline static hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
const hipChannelFormatDesc* desc, size_t size = UINT_MAX){
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
+1
Просмотреть файл
@@ -124,6 +124,7 @@ bool runTest(int argc, char** argv) {
}
}
}
HIP_CHECK(hipUnbindTexture(tex));
HIP_CHECK(hipFree(dData));
HIP_CHECK(hipFreeArray(array));
return testResult;
+3 -4
Просмотреть файл
@@ -634,16 +634,15 @@ hipError_t hipBindTextureToMipmappedArray(textureReference* tex,
return ihipLogStatus(hip_status);
}
hipError_t ihipUnbindTextureImpl(TlsData *tls, const hipTextureObject_t& textureObject) {
hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject) {
hipError_t hip_status = hipSuccess;
TlsData* tls=tls_get_ptr();
auto ctx = ihipGetTlsDefaultCtx();
if (ctx) {
hc::accelerator acc = ctx->getDevice()->_acc;
auto device = ctx->getWriteableDevice();
hsa_agent_t* agent = static_cast<hsa_agent_t*>(acc.get_hsa_agent());
hipTexture* pTexture = textureHash[textureObject];
if (pTexture != nullptr) {
hsa_ext_image_destroy(*agent, pTexture->image);
@@ -659,7 +658,7 @@ hipError_t ihipUnbindTextureImpl(TlsData *tls, const hipTextureObject_t& texture
hipError_t hipUnbindTexture(const textureReference* tex) {
HIP_INIT_API(hipUnbindTexture, tex);
hipError_t hip_status = hipSuccess;
hip_status = ihipUnbindTextureImpl(tls, tex->textureObject);
hip_status = ihipUnbindTextureImpl(tex->textureObject);
return ihipLogStatus(hip_status);
}
+1
Просмотреть файл
@@ -91,6 +91,7 @@ bool textureTest(enum hipArray_Format texFormat)
}
hipFree(dData);
hipFree(dOutputData);
hipUnbindTexture(textureNormalizedVal_1D);
delete [] hOutputData;
return testResult;
}
+1
Просмотреть файл
@@ -90,6 +90,7 @@ int runTest(int argc, char** argv) {
}
}
}
HIPCHECK(hipUnbindTexture(tex));
hipFree(dData);
hipFreeArray(hipArray);
return testResult;