SWDEV-306947 - Add mode combination tests (#2447)
Address modes are valid for array rather than linear memory. Comment out codes of address test for linear memory. Add tests of mode combination(address, linear and normorlized coordinates) in 1D, 2D and 3D. Change-Id: I9e7e97d9bf619743c311f68f51d5bf115fdd534d
Этот коммит содержится в:
@@ -18,7 +18,7 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* HIT_START
|
||||
* BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_RUNTIME rocclr
|
||||
* BUILD: %t %s ../test_common.cpp
|
||||
* TEST: %t
|
||||
* HIT_END
|
||||
*/
|
||||
@@ -38,9 +38,9 @@ int runTest(hipTextureAddressMode, hipTextureFilterMode);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int testResult = runTest(hipAddressModeClamp,hipFilterModePoint);
|
||||
testResult = runTest(hipAddressModeClamp,hipFilterModeLinear);
|
||||
testResult = runTest(hipAddressModeWrap,hipFilterModePoint);
|
||||
testResult = runTest(hipAddressModeWrap,hipFilterModeLinear);
|
||||
testResult = testResult & runTest(hipAddressModeClamp,hipFilterModeLinear);
|
||||
testResult = testResult & runTest(hipAddressModeBorder,hipFilterModePoint);
|
||||
testResult = testResult & runTest(hipAddressModeBorder,hipFilterModeLinear);
|
||||
if(testResult) {
|
||||
passed();
|
||||
} else {
|
||||
@@ -84,7 +84,6 @@ int runTest(hipTextureAddressMode addressMode, hipTextureFilterMode filterMode)
|
||||
texDesc.readMode = hipReadModeElementType;
|
||||
|
||||
texDesc.addressMode[0] = addressMode;
|
||||
texDesc.addressMode[1] = addressMode;
|
||||
texDesc.filterMode = filterMode;
|
||||
texDesc.normalizedCoords = false;
|
||||
|
||||
@@ -107,16 +106,12 @@ int runTest(hipTextureAddressMode addressMode, hipTextureFilterMode filterMode)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(testResult){
|
||||
for(int i = N-offset; i < N; i++){
|
||||
if (output[i] != 0){
|
||||
testResult = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// For hipResourceTypeLinear, reading of out-of-boundary address is undefined!
|
||||
// So we won't verify those data
|
||||
|
||||
HIPCHECK(hipDestroyTextureObject(texObj));
|
||||
HIPCHECK(hipFree(texBuf));
|
||||
HIPCHECK(hipFree(texBufOut));
|
||||
printf("%s(addressMode %d, filterMode %d) %s\n", __FUNCTION__, addressMode, filterMode, testResult ? "succeed" : "failed");
|
||||
return testResult;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user