-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgraphicCardProp.cu
54 lines (49 loc) · 1.44 KB
/
graphicCardProp.cu
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
/**
* Copyright © [2011], Empa, Juergen Hofmann
*/
/**********************************************************
*
* $Log: graphicCardProp.cu $
* Revision 1.2 2010/12/21 06:47:32 Hofmann
* remove not used keywords
*
* Revision 1.1 2010/12/15 09:52:49 Hofmann
* Initial revision
*
**********************************************************/
#include "typesFDK.h"
#include "recon.h"
#include <vector>
#include <iostream>
using namespace std;
extern "C"
void GetGraphicCardProp(vector<GraphicCardProp> &gpuPropV)
{
// get graphic card property
////////////////////////////
// get number of available graphic devices
const unsigned MB = 1024*1024;
int cnt;
cudaDeviceProp prop;
HANDLE_ERROR(cudaGetDeviceCount(&cnt));
for(int i = 0; i < cnt; i++)
{
HANDLE_ERROR(cudaGetDeviceProperties(&prop,i));
GraphicCardProp gpuProp;
/*
gpuProp.name = prop.name;
//cout << "\n\n ---->>>> " << prop.name << "\n\n";
basic_string <char>::size_type indexCh;
const char *cstr = "Tesla";
indexCh = gpuProp.name.find(cstr,0);
if (indexCh != string::npos)
if(prop.tccDriver) gpuProp.tccDriver = true;
*/
gpuProp.globalMem = prop.totalGlobalMem/MB;
gpuProp.maxThrPerBlk = prop.maxThreadsPerBlock;
gpuProp.majorRev = prop.major;
gpuProp.minorRev = prop.minor;
gpuProp.multProcCnt = prop.multiProcessorCount ;
gpuPropV.push_back(gpuProp);
}
}