polish free message

This commit is contained in:
Dun Liang 2021-03-19 15:38:21 +08:00
parent e674efba84
commit 433cae596e
2 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,7 @@
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.2.2.52'
__version__ = '1.2.2.53'
from . import lock
with lock.lock_scope():
ori_int = int

View File

@ -12,6 +12,7 @@
namespace jittor {
CudaHostAllocator cuda_host_allocator;
extern bool no_cuda_error_when_free;
const char* CudaHostAllocator::name() const {return "cuda_host";}
@ -24,6 +25,7 @@ void* CudaHostAllocator::alloc(size_t size, size_t& allocation) {
void CudaHostAllocator::free(void* mem_ptr, size_t size, const size_t& allocation) {
if (size==0) return;
if (no_cuda_error_when_free) return;
checkCudaErrors(cudaFreeHost(mem_ptr));
}