Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Based on the CUDA example */
- #include <stdio.h>
- #include <nvml.h>
- int main(void)
- {
- nvmlReturn_t result;
- int i;
- /* Change loop counter to see if there is a leak */
- for(i = 0; i < 1000; ++i) {
- result = nvmlInit();
- if (NVML_SUCCESS != result) {
- printf("Failed to initialize NVML: %s\n", nvmlErrorString(result));
- printf("Press ENTER to continue...\n");
- getchar();
- return 1;
- }
- result = nvmlShutdown();
- if (NVML_SUCCESS != result) {
- printf("Failed to shutdown NVML: %s\n", nvmlErrorString(result));
- return 1;
- }
- }
- printf("All done.\n");
- printf("Press ENTER to continue...\n");
- getchar();
- return 0;
- Error:
- result = nvmlShutdown();
- if (NVML_SUCCESS != result)
- printf("Failed to shutdown NVML: %s\n", nvmlErrorString(result));
- printf("Press ENTER to continue...\n");
- getchar();
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement