-
Notifications
You must be signed in to change notification settings - Fork 0
/
general.h
49 lines (33 loc) · 1.34 KB
/
general.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>;
#include <cstring>
#include <time.h>
#include <string>
#include <vector>
#include <iterator>
#include <random>
#include <numeric>
using namespace std;
void xavier_init(std::vector<std::vector<double>>& weights, int input_size, int output_size);
double frand();
double getSum(vector<double> x);
double max(vector<double> x);
char* createFilename(char* path, string name, char* extension);
void generateRandArray(int* arr, int scale, int size);
void printArray(int* arr, int size);
void printArray(double* arr, int size);
void printExecution(char* s, clock_t start, clock_t end);
void sum_array_cpu(int* a, int* b, int* c, int size);
void sum_arrays_cpu(int* a, int* b, int* c, int* d, int size);
void compare_arrays(int* a, int* b, int size);
void compare_arrays(double* a, double* b, int size);
int getSum(int* a, int size);
int getSum(double* a, int size);
void transpose(int* mat, int* trans, int nx, int ny);
void average3D(vector<vector<vector<double>>>* a, vector<vector<double>>* b);
void compare3D(vector<vector<vector<double>>> a, vector<vector<vector<double>>> b);
bool compare2D(vector<vector<double>> a, vector<vector<double>> b);
void shuffleData(std::vector<vector<double>>& images, vector<vector<double>>& labels);