SWDEV-303204 - Disable texture/image Apis on some devices

If the target device doesn't support image,
compiler will send out unavailable error if device texture apis
are called; and host texture apis will return hipErrorNotSupported.
Remove useless include/hip/amd_detail/texture_functions.h.
Add hipDeviceAttributeImageSupport attribute to check image
support in runtime.
Add __HIP_NO_IMAGE_SUPPORT(=1) macro in device code to indicate
texture apis not supported.
Change-Id: Ia891493e681a61980a2444859a90e046a9ebea39
This commit is contained in:
Tao Sang
2021-09-24 19:19:25 -04:00
committed by Tao Sang
parent 69117705c8
commit 5acc8b5102
7 changed files with 329 additions and 11204 deletions
+6
View File
@@ -663,6 +663,12 @@ hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const
if ((texRef == nullptr) || (name == nullptr)) {
HIP_RETURN(hipErrorInvalidValue);
}
amd::Device* device = hip::getCurrentDevice()->devices()[0];
const device::Info& info = device->info();
if (!info.imageSupport_) {
LogPrintfError("Texture not supported on the device %s", info.name_);
HIP_RETURN(hipErrorNotSupported);
}
/* Get address and size for the global symbol */
if (hipSuccess != PlatformState::instance().getDynTexRef(name, hmod, texRef)) {