Apply .clangformat to all repo source files

Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344
This commit is contained in:
Maneesh Gupta
2018-03-12 11:29:03 +05:30
rodzic 18e70b1e6b
commit 1ba06f63c4
293 zmienionych plików z 43980 dodań i 45830 usunięć
@@ -29,77 +29,76 @@ THE SOFTWARE.
#include "hip/hip_runtime.h"
#include "test_common.h"
#define WIDTH 1024
#define HEIGHT 1024
#define WIDTH 1024
#define HEIGHT 1024
#define NUM (WIDTH*HEIGHT)
#define NUM (WIDTH * HEIGHT)
#define THREADS_PER_BLOCK_X 16
#define THREADS_PER_BLOCK_Y 16
#define THREADS_PER_BLOCK_Z 1
#define THREADS_PER_BLOCK_X 16
#define THREADS_PER_BLOCK_Y 16
#define THREADS_PER_BLOCK_Z 1
int main() {
int* hostA;
int* hostB;
int *hostA;
int *hostB;
int* deviceA;
int* deviceB;
int *deviceA;
int *deviceB;
int i;
int errors;
int i;
int errors;
hostA = (int*)malloc(NUM * sizeof(int));
hostB = (int*)malloc(NUM * sizeof(int));
hostA = (int *)malloc(NUM * sizeof(int));
hostB = (int *)malloc(NUM * sizeof(int));
// initialize the input data
for (i = 0; i < NUM; i++) {
hostB[i] = i;
}
// initialize the input data
for (i = 0; i < NUM; i++) {
hostB[i] = i;
}
HIPCHECK(hipMalloc((void**)&deviceA, NUM * sizeof(int)));
HIPCHECK(hipMalloc((void**)&deviceB, NUM * sizeof(int)));
HIPCHECK(hipMalloc((void**)&deviceA, NUM * sizeof(int)));
HIPCHECK(hipMalloc((void**)&deviceB, NUM * sizeof(int)));
hipStream_t s;
HIPCHECK(hipStreamCreate(&s));
hipStream_t s;
HIPCHECK(hipStreamCreate(&s));
// hostB -> deviceB -> hostA
// hostB -> deviceB -> hostA
#define ASYNC 1
#if ASYNC
HIPCHECK(hipMemcpyAsync(deviceB, hostB, NUM*sizeof(int), hipMemcpyHostToDevice, s));
HIPCHECK(hipMemcpyAsync(hostA, deviceB, NUM*sizeof(int), hipMemcpyDeviceToHost, s));
HIPCHECK(hipMemcpyAsync(deviceB, hostB, NUM * sizeof(int), hipMemcpyHostToDevice, s));
HIPCHECK(hipMemcpyAsync(hostA, deviceB, NUM * sizeof(int), hipMemcpyDeviceToHost, s));
#else
HIPCHECK(hipMemcpy(deviceB, hostB, NUM*sizeof(int), hipMemcpyHostToDevice));
HIPCHECK(hipMemcpy(hostA, deviceB, NUM*sizeof(int), hipMemcpyDeviceToHost));
HIPCHECK(hipMemcpy(deviceB, hostB, NUM * sizeof(int), hipMemcpyHostToDevice));
HIPCHECK(hipMemcpy(hostA, deviceB, NUM * sizeof(int), hipMemcpyDeviceToHost));
#endif
HIPCHECK(hipStreamSynchronize(s));
HIPCHECK(hipDeviceSynchronize());
HIPCHECK(hipStreamSynchronize(s));
HIPCHECK(hipDeviceSynchronize());
// verify the results
errors = 0;
for (i = 0; i < NUM; i++) {
if (hostA[i] != (hostB[i])) {
errors++;
// verify the results
errors = 0;
for (i = 0; i < NUM; i++) {
if (hostA[i] != (hostB[i])) {
errors++;
}
}
}
HIPCHECK(hipStreamDestroy(s));
HIPCHECK(hipStreamDestroy(s));
HIPCHECK(hipFree(deviceA));
HIPCHECK(hipFree(deviceB));
HIPCHECK(hipFree(deviceA));
HIPCHECK(hipFree(deviceB));
free(hostA);
free(hostB);
free(hostA);
free(hostB);
//hipResetDefaultAccelerator();
// hipResetDefaultAccelerator();
if(errors != 0){
HIPASSERT(1 == 2);
}else{
passed();
}
if (errors != 0) {
HIPASSERT(1 == 2);
} else {
passed();
}
return errors;
return errors;
}