Made changes as suggested.

[ROCm/hip commit: 90c8230cfa]
This commit is contained in:
Lakhan Singh
2018-06-15 11:30:02 +05:30
rodzic f1b844f51e
commit 093eedea5e
2 zmienionych plików z 14 dodań i 101 usunięć
@@ -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 <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <hip/hip_runtime.h>
#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<R;i++)
hipChannelFormatDesc chan_test,chan_desc=hipCreateChannelDesc(32,0,0,0,hipChannelFormatKindSigned);
hipArray *hipArray;
hipMallocArray(&hipArray, &chan_desc,C,R,0);
HIPCHECK(hipMallocArray(&hipArray, &chan_desc,C,R,0));
hipMemcpyToArray(hipArray,0,0, val, R*C*sizeof(int), hipMemcpyHostToDevice);
HIPCHECK(hipMemcpyToArray(hipArray,0,0, val, R*C*sizeof(int), hipMemcpyHostToDevice));
tex.addressMode[0]=hipAddressModeWrap;
tex.addressMode[1]=hipAddressModeWrap;
tex.filterMode=hipFilterModePoint;
tex.normalized=0;
hipBindTextureToArray(&tex, hipArray, &chan_desc);
HIPCHECK(hipBindTextureToArray(&tex, hipArray, &chan_desc));
out=hipGetErrorString(hipGetTextureAlignmentOffset(&offset,&tex));
if(strcmp(out.c_str(),"hipSuccess")==0)
testResult=true;
else
testResult=false;
HIPCHECK(hipGetTextureAlignmentOffset(&offset,&tex));
out=hipGetErrorString(hipUnbindTexture(&tex));
hipFree(hipArray);
HIPCHECK(hipUnbindTexture(&tex));
HIPCHECK(hipFreeArray(hipArray));
}