From 8983f78d21dd404815891898acfd7a879e925e9b Mon Sep 17 00:00:00 2001 From: Lakhan Singh Date: Tue, 12 Jun 2018 15:22:05 +0530 Subject: [PATCH 01/12] [GETandALGN]: Get channel and alignment details [ROCm/clr commit: 7d6f1b8e388935f3f4d048fb1767ce5aeef2c024] --- .../tests/src/texture/hipGetAlgntoffset2D.cpp | 98 ++++++++++++ .../tests/src/texture/hipGetChanDesc.cpp | 139 ++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp create mode 100644 projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp new file mode 100644 index 0000000000..66f60a4eec --- /dev/null +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -0,0 +1,98 @@ +/* +Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/* HIT_START + * BUILD: %t %s ../test_common.cpp + * RUN: %t + * HIT_END + */ +#include +#include +#include +#include + +#include +#include "test_common.h" + +using namespace std; +#define HIP_ENABLE_PRINTF +#define R 8 //rows, height +#define C 8 //columns, width + + +texture tex; + +bool testResult = true; + +void runTest(void); + +int main(int argc, char** argv) { + runTest(); + + if (testResult) { + passed(); + } else { + exit(EXIT_FAILURE); + } +} + + +void runTest() +{ + +string out; +int val[R][C],i,j; +size_t offset; + +for(i=0;i +#include +#include + +#include +#include "test_common.h" + +using namespace std; +#define R 8 //rows, height +#define C 8 //columns, width + + +texture tex; + +bool testResult = true; + +void runTest(void); + +int main(int argc, char** argv) { + runTest(); + + if (testResult) { + passed(); + } else { + exit(EXIT_FAILURE); + } +} + + +void runTest() +{ + +string out; +int val[R][C],i,j; + +for(i=0;i Date: Fri, 15 Jun 2018 11:30:02 +0530 Subject: [PATCH 02/12] Made changes as suggested. [ROCm/clr commit: 936b878d7208415feacd6705a5fb1a7684795198] --- .../tests/src/texture/hipGetAlgntoffset2D.cpp | 28 ++---- .../tests/src/texture/hipGetChanDesc.cpp | 87 ++----------------- 2 files changed, 14 insertions(+), 101 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index 66f60a4eec..ead492dbfc 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2015-Present Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -25,16 +25,10 @@ THE SOFTWARE. * RUN: %t * HIT_END */ -#include -#include -#include -#include - #include #include "test_common.h" using namespace std; -#define HIP_ENABLE_PRINTF #define R 8 //rows, height #define C 8 //columns, width @@ -59,7 +53,6 @@ int main(int argc, char** argv) { void runTest() { -string out; int val[R][C],i,j; size_t offset; @@ -73,26 +66,19 @@ for(i=0;i -#include -#include #include #include "test_common.h" @@ -36,9 +33,6 @@ using namespace std; #define R 8 //rows, height #define C 8 //columns, width - -texture tex; - bool testResult = true; void runTest(void); @@ -57,83 +51,16 @@ int main(int argc, char** argv) { void runTest() { -string out; -int val[R][C],i,j; - -for(i=0;i Date: Wed, 11 Jul 2018 11:51:08 +0530 Subject: [PATCH 03/12] Update hipGetAlgntoffset2D.cpp [ROCm/clr commit: b3b198f7450b6da775dfcb1e5bad8a8c2a2d664d] --- .../clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index ead492dbfc..34376a0a76 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -37,10 +37,10 @@ texture tex; bool testResult = true; -void runTest(void); +bool runTest(void); int main(int argc, char** argv) { - runTest(); + testResult=runTest(); if (testResult) { passed(); @@ -50,7 +50,7 @@ int main(int argc, char** argv) { } -void runTest() +bool runTest() { int val[R][C],i,j; @@ -81,4 +81,5 @@ HIPCHECK(hipGetTextureAlignmentOffset(&offset,&tex)); HIPCHECK(hipUnbindTexture(&tex)); HIPCHECK(hipFreeArray(hipArray)); +return testResult; } From b89f2310b863423eca5d6a21c86ff4e7a5a8a2bf Mon Sep 17 00:00:00 2001 From: lthakur Date: Wed, 11 Jul 2018 11:53:16 +0530 Subject: [PATCH 04/12] Update hipGetChanDesc.cpp [ROCm/clr commit: 5ba01d5033ffb23d86dd014373e3b46eab399aff] --- projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp index a3e8c7c3e7..254392ffd2 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp + * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc * RUN: %t * HIT_END */ @@ -35,10 +35,10 @@ using namespace std; bool testResult = true; -void runTest(void); +bool runTest(void); int main(int argc, char** argv) { - runTest(); + testResult=runTest(); if (testResult) { passed(); @@ -48,7 +48,7 @@ int main(int argc, char** argv) { } -void runTest() +bool runTest() { hipChannelFormatDesc chan_test,chan_desc=hipCreateChannelDesc(32,0,0,0,hipChannelFormatKindSigned); @@ -63,4 +63,5 @@ else testResult=false; HIPCHECK(hipFreeArray(hipArray)); +return testResult; } From 01b3ffc69fc6b24dfbbe846e177b1ab11ad35dd5 Mon Sep 17 00:00:00 2001 From: lthakur Date: Wed, 11 Jul 2018 11:54:05 +0530 Subject: [PATCH 05/12] Update hipGetAlgntoffset2D.cpp [ROCm/clr commit: d8b5f60e12e7e696c90a22e976bacfe8e3628a46] --- projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index 34376a0a76..b1ab647755 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp + * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc * RUN: %t * HIT_END */ From 6ccf6807f6d3a2d04b8df2cc9d0009e0a3d00096 Mon Sep 17 00:00:00 2001 From: lthakur Date: Wed, 11 Jul 2018 15:23:21 +0530 Subject: [PATCH 06/12] Update hipGetAlgntoffset2D.cpp [ROCm/clr commit: d395531f47276b901fc6671949c06215268f4e42] --- projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index b1ab647755..5b6ddc3974 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc + * BUILD: %t %s ../test_common.cpp * RUN: %t * HIT_END */ From 138d5f3d0c9bf7e8b6fc67a70abb0e59d6822e33 Mon Sep 17 00:00:00 2001 From: lthakur Date: Wed, 11 Jul 2018 15:24:00 +0530 Subject: [PATCH 07/12] Update hipGetChanDesc.cpp [ROCm/clr commit: 7003fe76f211c54233b001466832995dd506f88f] --- projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp index 254392ffd2..8a72f14829 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc + * BUILD: %t %s ../test_common.cpp * RUN: %t * HIT_END */ From da77083acc9fdb850da0899068726ee6bfafb769 Mon Sep 17 00:00:00 2001 From: lthakur Date: Tue, 17 Jul 2018 10:32:30 +0530 Subject: [PATCH 08/12] Removed unused ,chan_test, variable. [ROCm/clr commit: c2b508abfe9d261ba6b4ea9306dae6e365219e19] --- projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index 5b6ddc3974..a164222e8c 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -63,7 +63,7 @@ for(i=0;i Date: Tue, 17 Jul 2018 13:35:22 +0530 Subject: [PATCH 09/12] Update hipGetAlgntoffset2D.cpp Removed bool variable 'testResult' from global scope and confined it to the function. [ROCm/clr commit: 7b6da4453b392223d707764d6e444a2234fc0770] --- .../clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index a164222e8c..213c49caaa 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -35,12 +35,10 @@ using namespace std; texture tex; -bool testResult = true; - bool runTest(void); int main(int argc, char** argv) { - testResult=runTest(); + bool testResult=runTest(); if (testResult) { passed(); @@ -81,5 +79,5 @@ HIPCHECK(hipGetTextureAlignmentOffset(&offset,&tex)); HIPCHECK(hipUnbindTexture(&tex)); HIPCHECK(hipFreeArray(hipArray)); -return testResult; +return true; } From 5ea8ae2ea63a8339f8acada79954b415da36b9b6 Mon Sep 17 00:00:00 2001 From: lthakur Date: Tue, 17 Jul 2018 13:37:08 +0530 Subject: [PATCH 10/12] Update hipGetAlgntoffset2D.cpp Removed unwanted space. [ROCm/clr commit: 9f8d41df13cdc92f8a160d31864be2a6a7aa9812] --- .../clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index 213c49caaa..2343d7a7fb 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -32,7 +32,6 @@ using namespace std; #define R 8 //rows, height #define C 8 //columns, width - texture tex; bool runTest(void); @@ -47,10 +46,8 @@ int main(int argc, char** argv) { } } - bool runTest() { - int val[R][C],i,j; size_t offset; @@ -59,10 +56,7 @@ for(i=0;i Date: Tue, 17 Jul 2018 13:40:54 +0530 Subject: [PATCH 11/12] Update hipGetChanDesc.cpp Removed bool variable 'testResult' from global scope and confined it to the function. [ROCm/clr commit: cac0f2cc95460c8e6bd9630d28b43f8b72be2215] --- projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp index 8a72f14829..9034668ccf 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetChanDesc.cpp @@ -33,12 +33,10 @@ using namespace std; #define R 8 //rows, height #define C 8 //columns, width -bool testResult = true; - bool runTest(void); int main(int argc, char** argv) { - testResult=runTest(); + bool testResult=runTest(); if (testResult) { passed(); @@ -47,12 +45,10 @@ int main(int argc, char** argv) { } } - bool runTest() { - +bool testResult=true; hipChannelFormatDesc chan_test,chan_desc=hipCreateChannelDesc(32,0,0,0,hipChannelFormatKindSigned); - hipArray *hipArray; HIPCHECK(hipMallocArray(&hipArray, &chan_desc,C,R,0)); HIPCHECK(hipGetChannelDesc(&chan_test,hipArray)); From 313cdfd49443f9f15ddda4dbd431f0a1275155f7 Mon Sep 17 00:00:00 2001 From: lthakur Date: Wed, 1 Aug 2018 10:41:30 +0530 Subject: [PATCH 12/12] Added offset value verification. Added offset value verification. [ROCm/clr commit: b7a4b2c3007482ad333d7a2d56b260f9f3cf77f3] --- .../clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp index 2343d7a7fb..3a4cc7dfc8 100644 --- a/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp +++ b/projects/clr/hipamd/tests/src/texture/hipGetAlgntoffset2D.cpp @@ -71,5 +71,8 @@ HIPCHECK(hipBindTextureToArray(&tex, hipArray, &chan_desc)); HIPCHECK(hipGetTextureAlignmentOffset(&offset,&tex)); HIPCHECK(hipUnbindTexture(&tex)); HIPCHECK(hipFreeArray(hipArray)); -return true; +if(offset != 0) + return false; + else + return true; }