Browse Source

fix(mgb/cuda): fix cuda host alloc set device

GitOrigin-RevId: f4756e8981
tags/v1.0.0-rc1
Megvii Engine Team Xinran Xu 4 years ago
parent
commit
e8571cca51
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      src/core/impl/comp_node/cuda/comp_node.cpp

+ 2
- 3
src/core/impl/comp_node/cuda/comp_node.cpp View File

@@ -423,9 +423,8 @@ void CudaCompNodeImpl::free_device(void *ptr) {
}

void* CudaCompNodeImpl::alloc_host(size_t size) {
// no need for activate() here because under
// unified addressing, host memory can be accessed
// and freed on any device
// need activate because it create cuda cuda context in current device
activate();
return sd->host_alloc->alloc(size);
}



Loading…
Cancel
Save