MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / freeDevice

Method freeDevice

extensions/include/cuMat/src/Context.h:311–327  ·  view source on GitHub ↗

* \brief Frees memory previously allocated with allocateDevice(size_t). * Passing a NULL-pointer should be a no-op. * \param memory the memory to be freed */

Source from the content-addressed store, hash-verified

309 * \param memory the memory to be freed
310 */
311 void freeDevice(void* memory)
312 {
313 CUMAT_PROFILING_INC(DeviceMemFree);
314#if CUMAT_CONTEXT_DEBUG_MEMORY==1
315 if (memory != nullptr) {
316 allocationsDevice_--;
317 CUMAT_ASSERT(allocationsDevice_ >= 0 && "You freed more pointers than were allocated");
318 }
319#endif
320#if CUMAT_CONTEXT_USE_CUB_ALLOCATOR==1
321 if (memory != nullptr) {
322 CUMAT_SAFE_CALL(getCubAllocator().DeviceFree(device_, memory));
323 }
324#else
325 CUMAT_SAFE_CALL(cudaFree(memory));
326#endif
327 }
328
329#if CUMAT_CONTEXT_DEBUG_MEMORY==1
330 //For testing only

Callers 2

releaseFunction · 0.80
DevicePointer.hFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected