Merge pull request #1515 from ansurya/tex_unbind_issue_fix
Fix undefined ref to hipUnbindTexture for texture types
このコミットが含まれているのは:
@@ -1398,6 +1398,11 @@ inline static hipError_t hipUnbindTexture(struct texture<T, dim, readMode>* tex)
|
|||||||
return hipCUDAErrorTohipError(cudaUnbindTexture(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,
|
inline static hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
|
||||||
const hipChannelFormatDesc* desc, size_t size = UINT_MAX){
|
const hipChannelFormatDesc* desc, size_t size = UINT_MAX){
|
||||||
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
|
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ bool runTest(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
HIP_CHECK(hipUnbindTexture(tex));
|
||||||
HIP_CHECK(hipFree(dData));
|
HIP_CHECK(hipFree(dData));
|
||||||
HIP_CHECK(hipFreeArray(array));
|
HIP_CHECK(hipFreeArray(array));
|
||||||
return testResult;
|
return testResult;
|
||||||
|
|||||||
@@ -634,16 +634,15 @@ hipError_t hipBindTextureToMipmappedArray(textureReference* tex,
|
|||||||
return ihipLogStatus(hip_status);
|
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;
|
hipError_t hip_status = hipSuccess;
|
||||||
|
TlsData* tls=tls_get_ptr();
|
||||||
auto ctx = ihipGetTlsDefaultCtx();
|
auto ctx = ihipGetTlsDefaultCtx();
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
hc::accelerator acc = ctx->getDevice()->_acc;
|
hc::accelerator acc = ctx->getDevice()->_acc;
|
||||||
auto device = ctx->getWriteableDevice();
|
auto device = ctx->getWriteableDevice();
|
||||||
|
|
||||||
hsa_agent_t* agent = static_cast<hsa_agent_t*>(acc.get_hsa_agent());
|
hsa_agent_t* agent = static_cast<hsa_agent_t*>(acc.get_hsa_agent());
|
||||||
|
|
||||||
hipTexture* pTexture = textureHash[textureObject];
|
hipTexture* pTexture = textureHash[textureObject];
|
||||||
if (pTexture != nullptr) {
|
if (pTexture != nullptr) {
|
||||||
hsa_ext_image_destroy(*agent, pTexture->image);
|
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) {
|
hipError_t hipUnbindTexture(const textureReference* tex) {
|
||||||
HIP_INIT_API(hipUnbindTexture, tex);
|
HIP_INIT_API(hipUnbindTexture, tex);
|
||||||
hipError_t hip_status = hipSuccess;
|
hipError_t hip_status = hipSuccess;
|
||||||
hip_status = ihipUnbindTextureImpl(tls, tex->textureObject);
|
hip_status = ihipUnbindTextureImpl(tex->textureObject);
|
||||||
return ihipLogStatus(hip_status);
|
return ihipLogStatus(hip_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ bool textureTest(enum hipArray_Format texFormat)
|
|||||||
}
|
}
|
||||||
hipFree(dData);
|
hipFree(dData);
|
||||||
hipFree(dOutputData);
|
hipFree(dOutputData);
|
||||||
|
hipUnbindTexture(textureNormalizedVal_1D);
|
||||||
delete [] hOutputData;
|
delete [] hOutputData;
|
||||||
return testResult;
|
return testResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ int runTest(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
HIPCHECK(hipUnbindTexture(tex));
|
||||||
hipFree(dData);
|
hipFree(dData);
|
||||||
hipFreeArray(hipArray);
|
hipFreeArray(hipArray);
|
||||||
return testResult;
|
return testResult;
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする