4 #include "cuda_runtime.h"
9 /*----------------------------------------------------------------------*\
11 \*---------------------------------------------------------------------*/
14 * idDevice in [0,nbDevice-1]
20 * sm=1.2 major=1 minor=2
24 /*--------------------------------------*\
26 \*-------------------------------------*/
29 /*--------------------------------------*\
31 \*-------------------------------------*/
40 * wrapper for cudaDeviceSynchronize()
42 static void synchronize(void);
49 * message = nameKernel by example
51 static void checkKernelError(const char *message
= NULL
);
56 * checkDimOPtimiser(dg, db);
58 static void checkDimError(const dim3
& dg
, const dim3
& db
);
60 static void checkDimOptimiser(const dim3
& dg
, const dim3
& db
);
61 static void assertDim(const dim3
& dg
, const dim3
& db
);
63 static int dim(const dim3
& dim
);
64 static int nbThread(const dim3
& dg
, const dim3
& db
);
66 static void print(const dim3
& dg
, const dim3
& db
);
72 static int getRuntimeVersion(void);
73 static int getDriverVersion(void);
75 static int getDeviceCount(void);
76 static int getDeviceId(void);
78 static cudaDeviceProp
getDeviceProp(int idDevice
);
79 static cudaDeviceProp
getDeviceProp(void);
81 static string
getNameSimple(int idDevice
);
82 static string
getNameSimple(void);
84 static string
getName(int idDevice
);
85 static string
getName(void);
87 static dim3
getMaxGridDim(int idDevice
);
88 static dim3
getMaxGridDim(void);
90 static dim3
getMaxBlockDim(int idDevice
);
91 static dim3
getMaxBlockDim(void);
93 static int getWarpSize(int idDevice
);
94 static int getWarpSize(void);
96 static int getMaxThreadPerBlock(int idDevice
);
97 static int getMaxThreadPerBlock(void);
99 static int getMPCount(void);
100 static int getMPCount(int idDevice
);
102 static int getCapacityMajor(int idDevice
);
103 static int getCapacityMajor(void);
105 static int getCapacityMinor(int idDevice
);
106 static int getCapacityMinor(void);
108 static int getAsyncEngineCount(int idDevice
);
109 static int getAsyncEngineCount(void);
115 static void printAll(void);
116 static void printAllSimple(void);
118 static void print(int idDevice
);
119 static void print(void);
121 static void printCurrent(void);
127 static bool isCuda(void);
129 static bool isFermi(int idDevice
);
130 static bool isFermi(void);
132 static bool isKepler(int idDevice
);
133 static bool isKepler(void);
135 static bool isUVAEnable(int idDevice
);
136 static bool isUVAEnable(void);
138 static bool isAtomicShareMemoryEnable(int idDevice
);
139 static bool isAtomicShareMemoryEnable(void);
141 static bool isHostMapMemoryEnable(int idDevice
);
142 static bool isHostMapMemoryEnable(void);
144 static bool isECCEnable(int idDevice
);
145 static bool isECCEnable(void);
147 static bool isAsyncEngine(int idDevice
);
148 static bool isAsyncEngine(void);
157 static void loadCudaDriver(int deviceID
, bool isMapMemoryEnable
= true);
161 static void loadCudaDriver(bool isMapMemoryEnable
= true);
165 static void loadCudaDriverAll(bool isMapMemoryEnable
= true);
172 * use delete[] ptrMatrixP2PCompatibility after usage
173 * raw major vectoriser
175 static int* p2pMatrixCompatibility(void);
178 * to be used after HANDLE_ERROR(cudaGLSetGLDevice(deviceId));
180 static void p2pEnableALL(void);
182 static void printP2PmatrixCompatibility(void);
184 /*--------------------------------------*\
186 \*-------------------------------------*/
194 /*----------------------------------------------------------------------*\
196 \*---------------------------------------------------------------------*/