diff --git a/libgpujpeg/gpujpeg_common.h b/libgpujpeg/gpujpeg_common.h index 8f006efc..44e5f112 100644 --- a/libgpujpeg/gpujpeg_common.h +++ b/libgpujpeg/gpujpeg_common.h @@ -650,6 +650,10 @@ gpujpeg_pixel_format_get_name(enum gpujpeg_pixel_format pixel_format); GPUJPEG_API int gpujpeg_pixel_format_is_planar(enum gpujpeg_pixel_format pixel_format); +/** Calls cudaDeviceReset() */ +GPUJPEG_API void +gpujpeg_device_reset(void); + #ifdef __cplusplus } #endif diff --git a/src/gpujpeg_common.c b/src/gpujpeg_common.c index 44b55fc9..25171bd3 100644 --- a/src/gpujpeg_common.c +++ b/src/gpujpeg_common.c @@ -2029,4 +2029,10 @@ float gpujpeg_custom_timer_get_duration(cudaEvent_t start, cudaEvent_t stop) { return elapsedTime; } +void +gpujpeg_device_reset(void) +{ + cudaDeviceReset(); +} + /* vi: set expandtab sw=4 : */ diff --git a/src/main.c b/src/main.c index 63c72c41..22e941a4 100644 --- a/src/main.c +++ b/src/main.c @@ -816,7 +816,7 @@ main(int argc, char *argv[]) } #ifdef DEBUG - cudaDeviceReset(); // to allow "cuda-memcheck --leak-check full" + gpujpeg_device_reset(); // to allow "cuda-memcheck --leak-check full" #endif // defined DEBUG return ret;