SWDEV-303204 - Disable texture/image Apis on some devices. (#2381)

Modify texture tests to pass on devices that don't support texture.
Add hipDeviceAttributeImageSupport to check image support in runtime

Change-Id: Ia89c494e651a6198a24448b59a91e046a9ebea38
Esse commit está contido em:
TomSang
2021-12-02 01:16:13 -05:00
commit de GitHub
commit 5c8af57480
10 arquivos alterados com 77 adições e 6 exclusões
@@ -60,6 +60,7 @@ texture<unsigned short, hipTextureType1D, hipReadModeNormalizedFloat> texus;
template<typename T>
__global__ void normalizedValTextureTest(unsigned int numElements, float* pDst)
{
#if !defined(__HIP_NO_IMAGE_SUPPORT) || !__HIP_NO_IMAGE_SUPPORT
unsigned int elementID = hipThreadIdx_x;
if(elementID >= numElements)
return;
@@ -72,6 +73,7 @@ __global__ void normalizedValTextureTest(unsigned int numElements, float* pDst)
pDst[elementID] = tex1D(texs, coord);
else if(std::is_same<T, unsigned short>::value)
pDst[elementID] = tex1D(texus, coord);
#endif
}
bool textureVerifyFilterModePoint(float *hOutputData, float *expected, size_t size) {
@@ -171,6 +173,13 @@ bool runTest() {
int main(int argc, char** argv)
{
int imageSupport = 0;
hipDeviceGetAttribute(&imageSupport, hipDeviceAttributeImageSupport,
p_gpuDevice);
if (!imageSupport) {
printf("Texture is not support on the device\n");
passed();
}
HipTest::parseStandardArguments(argc, argv, true);
int device = 0;
bool status = false;