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

Function CleanupNoFailure

cpp/0_Introduction/vectorAddDrv/vectorAddDrv.cpp:194–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194int CleanupNoFailure()
195{
196 // Free device memory
197 checkCudaErrors(cuMemFree(d_A));
198 checkCudaErrors(cuMemFree(d_B));
199 checkCudaErrors(cuMemFree(d_C));
200
201 // Free host memory
202 if (h_A) {
203 free(h_A);
204 }
205
206 if (h_B) {
207 free(h_B);
208 }
209
210 if (h_C) {
211 free(h_C);
212 }
213
214 checkCudaErrors(cuModuleUnload(cuModule));
215 checkCudaErrors(cuCtxDestroy(cuContext));
216
217 return EXIT_SUCCESS;
218}
219// Allocates an array with random float entries.
220void RandomInit(float *data, int n)
221{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected