Fixed texture 2D mapping for pitched arrays & 3D Texture read (#1415)

Texture 2D image mapping for pitched arrays:
github issue: Texture Object's Buffer seems to be Misaligned #886
JIRA ticket: SWDEV-199313

SWDEV-151670 : Fixed issue with 3D texture with 4 components
SWDEV-151671 : Issue with 2D layered texture with 4 components
Tá an tiomantas seo le fáil i:
ansurya
2019-11-07 13:17:46 +05:30
tiomanta ag Maneesh Gupta
tuismitheoir 579a4f36fa
tiomantas e07926ce0f
D'athraigh 9 comhad le 698 breiseanna agus 414 scriosta
+30
Féach ar an gComhad
@@ -153,6 +153,36 @@ int parseStandardArguments(int argc, char* argv[], bool failOnUndefinedArg);
unsigned setNumBlocks(unsigned blocksPerCU, unsigned threadsPerBlock, size_t N);
template<typename T> // pointer type
void checkArray(T hData, T hOutputData, size_t width, size_t height,size_t depth)
{
for (int i = 0; i < depth; i++) {
for (int j = 0; j < height; j++) {
for (int k = 0; k < width; k++) {
int offset = i*width*height + j*width + k;
if (hData[offset] != hOutputData[offset]) {
std::cerr << '[' << i << ',' << j << ',' << k << "]:" << hData[offset] << "----" << hOutputData[offset]<<" ";
failed("mistmatch at:%d %d %d",i,j,k);
}
}
}
}
}
template<typename T>
void checkArray(T input, T output, size_t height, size_t width)
{
for(int i=0; i<height; i++ ){
for(int j=0; j<width; j++ ){
int offset = i*width + j;
if( input[offset] != output[offset] ){
std::cerr << '[' << i << ',' << j << ',' << "]:" << input[offset] << "----" << output[offset]<<" ";
failed("mistmatch at:%d %d",i,j);
}
}
}
}
template <typename T>
__global__ void vectorADD(const T* A_d, const T* B_d, T* C_d, size_t NELEM) {