* \brief Frees memory previously allocated with allocateHost(size_t). * Passing a NULL-pointer should be a no-op. * \param memory the memory to be freed */
| 291 | * \param memory the memory to be freed |
| 292 | */ |
| 293 | void freeHost(void* memory) |
| 294 | { |
| 295 | CUMAT_PROFILING_INC(HostMemFree); |
| 296 | #if CUMAT_CONTEXT_DEBUG_MEMORY==1 |
| 297 | if (memory != nullptr) { |
| 298 | allocationsHost_--; |
| 299 | CUMAT_ASSERT(allocationsHost_ >= 0 && "You freed more pointers than were allocated"); |
| 300 | } |
| 301 | #endif |
| 302 | //TODO: add a plugin-mechanism for custom allocators |
| 303 | CUMAT_SAFE_CALL(cudaFreeHost(memory)); |
| 304 | } |
| 305 | |
| 306 | /** |
| 307 | * \brief Frees memory previously allocated with allocateDevice(size_t). |
nothing calls this directly
no outgoing calls
no test coverage detected