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
parent 18e70b1e6b
commit 1ba06f63c4
293 changed files with 43980 additions and 45830 deletions
+32 -32
View File
@@ -17,45 +17,45 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include"test_common.h"
#include<iostream>
#include<time.h>
#include "test_common.h"
#include <iostream>
#include <time.h>
#define NUM_SIZE 8
#define NUM_ITER 1 << 30
static size_t size[NUM_SIZE];
void setup(){
for(int i=0;i<NUM_SIZE;i++){
size[i] = 1<<(i+6); // start at 8 bytes
}
void setup() {
for (int i = 0; i < NUM_SIZE; i++) {
size[i] = 1 << (i + 6); // start at 8 bytes
}
}
void valSet(int *A, int val, size_t size){
size_t len = size/sizeof(int);
for(int i=0;i<len;i++){
A[i] = val;
}
void valSet(int* A, int val, size_t size) {
size_t len = size / sizeof(int);
for (int i = 0; i < len; i++) {
A[i] = val;
}
}
int main(){
setup();
int *A, *Ad;
for(int i=0;i<NUM_SIZE;i++){
std::cout<<size[i]<<std::endl;
A = (int*)malloc(size[i]);
valSet(A, 1, size[i]);
hipMalloc(&Ad, size[i]);
std::cout<<"Malloc success at size: "<<size[i]<<std::endl;
clock_t start ,end;
start = clock();
for(int j=0;j<NUM_ITER;j++){
// std::cout<<"At iter: "<<j<<std::endl;
hipMemcpy(Ad, A, size[i], hipMemcpyHostToDevice);
}
hipDeviceSynchronize();
end = clock();
double uS = (double)(end - start)*1000/(NUM_ITER*CLOCKS_PER_SEC);
std::cout<<uS<<std::endl;
}
int main() {
setup();
int *A, *Ad;
for (int i = 0; i < NUM_SIZE; i++) {
std::cout << size[i] << std::endl;
A = (int*)malloc(size[i]);
valSet(A, 1, size[i]);
hipMalloc(&Ad, size[i]);
std::cout << "Malloc success at size: " << size[i] << std::endl;
clock_t start, end;
start = clock();
for (int j = 0; j < NUM_ITER; j++) {
// std::cout<<"At iter: "<<j<<std::endl;
hipMemcpy(Ad, A, size[i], hipMemcpyHostToDevice);
}
hipDeviceSynchronize();
end = clock();
double uS = (double)(end - start) * 1000 / (NUM_ITER * CLOCKS_PER_SEC);
std::cout << uS << std::endl;
}
}