Added gpuWarmUp function to shorten latency in first GPU call.

This commit is contained in:
Pedro Martinez Mediano 2017-05-24 17:02:52 +10:00
parent cced321abb
commit ff868bf79f
2 changed files with 12 additions and 0 deletions

View File

@ -285,3 +285,13 @@ void device_reset(void) {
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
void gpuWarmUp(void) {
cudaSetDevice(0);
}
#ifdef __cplusplus
}
#endif

View File

@ -26,6 +26,8 @@ int findRadiiAlgorithm2(float *radii, const float *data, const int *indexes,
int computeSumDigammas(float *sumDiGammas, int *nx, int *ny, unsigned int N);
void device_reset(void);
void gpuWarmUp(void);
#ifdef __cplusplus
}
#endif