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:
@@ -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;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário