mirror of https://github.com/Jittor/Jittor
polish free message
This commit is contained in:
parent
e674efba84
commit
433cae596e
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue