-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
76 lines (52 loc) · 1.09 KB
/
main.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <iostream>
#include <cstdio>
#include <vector>
#include <iostream>
#include "Constant.h"
#include "CUDA_kernel.cuh"
void PrintCudaCards()
{
int GPU_N;
printf("Starting MultiGPU\n");
cudaGetDeviceCount(&GPU_N);
if (GPU_N > 4)
{
GPU_N = 4;
}
printf("CUDA-capable device count: %i\n", GPU_N);
}
int main(void)
{
srand(time(0));
PrintCudaCards();
int icard;
int num_devices;
cudaGetDeviceCount(&num_devices);
if (num_devices>1)
{
std::cout << "Please enter an integer value of NVidia card ( 1 or 2) : ";
std::cin >> icard;
if (icard == 2)
cudaSetDevice(1);
if (icard == 1)
cudaSetDevice(0);
}
/*
int iload;
std::cout << "Please enter an integer 1 to load DNA from saved file: ";
std::cin >> iload;
bool LoadDNAfromfile = false;
if (iload == 1)
LoadDNAfromfile = true;
*/
int Tick = 0;
Constant constant;
//Load Constants of world
printf("Begin exp \n");
ComputeLSTM(constant);
int isave;
std::cout << "End exp ";
std::cin >> isave;
return 0;
}