MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / FreeResource

Function FreeResource

cpp/5_Domain_Specific/postProcessGL/main.cpp:789–812  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

787//!
788////////////////////////////////////////////////////////////////////////////////
789void FreeResource()
790{
791 sdkDeleteTimer(&timer);
792
793 // unregister this buffer object with CUDA
794 checkCudaErrors(cudaGraphicsUnregisterResource(cuda_tex_screen_resource));
795#ifdef USE_TEXSUBIMAGE2D
796 checkCudaErrors(cudaGraphicsUnregisterResource(cuda_pbo_dest_resource));
797 deletePBO(&pbo_dest);
798#else
799 cudaFree(cuda_dest_resource);
800#endif
801 deleteTexture(&tex_screen);
802 deleteTexture(&tex_cudaResult);
803 deleteDepthBuffer(&depth_buffer);
804 deleteFramebuffer(&framebuffer);
805
806 if (iGLUTWindowHandle) {
807 glutDestroyWindow(iGLUTWindowHandle);
808 }
809
810 // finalize logs and leave
811 printf("postProcessGL.exe Exiting...\n");
812}
813
814void Cleanup(int iExitCode)
815{

Callers 1

CleanupFunction · 0.70

Calls 5

sdkDeleteTimerFunction · 0.85
deleteDepthBufferFunction · 0.85
deleteFramebufferFunction · 0.85
deletePBOFunction · 0.70
deleteTextureFunction · 0.70

Tested by

no test coverage detected