We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/Project-HAMi/HAMi-core/blob/main/src/allocator/allocator.c#L100
int add_chunk(CUdeviceptr *address,size_t size){ size_t addr=0; size_t allocsize; CUresult res = CUDA_SUCCESS; CUdevice dev; cuCtxGetDevice(&dev); if (oom_check(dev,size)) return -1; allocated_list_entry *e; INIT_ALLOCATED_LIST_ENTRY(e,addr,size); if (size <= IPCSIZE) res = CUDA_OVERRIDE_CALL(cuda_library_entry,cuMemAlloc_v2,&e->entry->address,size); else{ //size = round_up(size,ALIGN); e->entry->length = size; res = cuMemoryAllocate(&e->entry->address,size,&e->entry->length,e->entry->allocHandle); } if (res!=CUDA_SUCCESS){ LOG_ERROR("cuMemoryAllocate failed res=%d",res); return res; } LIST_ADD(device_overallocated,e); //uint64_t t_size; *address = e->entry->address; allocsize = size; cuCtxGetDevice(&dev); add_gpu_device_memory_usage(getpid(),dev,allocsize,2); return 0; } CUresult cuMemoryAllocate(CUdeviceptr* dptr, size_t bytesize, size_t* bytesallocated,void* data){ CUresult res; if (bytesallocated!=NULL) *bytesallocated = bytesize; res = CUDA_OVERRIDE_CALL(cuda_library_entry,cuMemAlloc_v2,dptr,bytesize); return res; }
I think there is no difference between the implement of size <= IPCSIZE and size > IPCSIZE condition.
size <= IPCSIZE
size > IPCSIZE
what's the meaning of comment //size = round_up(size,ALIGN); ?
//size = round_up(size,ALIGN);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github.com/Project-HAMi/HAMi-core/blob/main/src/allocator/allocator.c#L100
I think there is no difference between the implement of
size <= IPCSIZE
andsize > IPCSIZE
condition.what's the meaning of comment
//size = round_up(size,ALIGN);
?The text was updated successfully, but these errors were encountered: