Update hipGetChanDesc.cpp

Removed bool variable 'testResult' from global scope and confined it to the function.
This commit is contained in:
lthakur
2018-07-17 13:40:54 +05:30
کامیت شده توسط GitHub
والد a185e8c1f9
کامیت e2eeee29da
@@ -33,12 +33,10 @@ using namespace std;
#define R 8 //rows, height #define R 8 //rows, height
#define C 8 //columns, width #define C 8 //columns, width
bool testResult = true;
bool runTest(void); bool runTest(void);
int main(int argc, char** argv) { int main(int argc, char** argv) {
testResult=runTest(); bool testResult=runTest();
if (testResult) { if (testResult) {
passed(); passed();
@@ -47,12 +45,10 @@ int main(int argc, char** argv) {
} }
} }
bool runTest() bool runTest()
{ {
bool testResult=true;
hipChannelFormatDesc chan_test,chan_desc=hipCreateChannelDesc(32,0,0,0,hipChannelFormatKindSigned); hipChannelFormatDesc chan_test,chan_desc=hipCreateChannelDesc(32,0,0,0,hipChannelFormatKindSigned);
hipArray *hipArray; hipArray *hipArray;
HIPCHECK(hipMallocArray(&hipArray, &chan_desc,C,R,0)); HIPCHECK(hipMallocArray(&hipArray, &chan_desc,C,R,0));
HIPCHECK(hipGetChannelDesc(&chan_test,hipArray)); HIPCHECK(hipGetChannelDesc(&chan_test,hipArray));