diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:16:04 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:16:04 +0900 |
commit | 0aa930a41f2d1ebf1fa90ec42da8f96d15a4dcbb (patch) | |
tree | 6a77b463f700e090df586672c26b9fe765fd115b /flang/runtime/CUDA/allocator.cpp | |
parent | ec6892d1c979ce0b84c86918d5cdbb03037b409a (diff) | |
parent | 6d16b1c5c468a79ecf867293023c89ac518ecdda (diff) | |
download | llvm-users/chapuni/cov/single/nextcount-base.zip llvm-users/chapuni/cov/single/nextcount-base.tar.gz llvm-users/chapuni/cov/single/nextcount-base.tar.bz2 |
Merge branch 'users/chapuni/cov/single/pair' into users/chapuni/cov/single/nextcount-baseusers/chapuni/cov/single/nextcount-base
Diffstat (limited to 'flang/runtime/CUDA/allocator.cpp')
-rw-r--r-- | flang/runtime/CUDA/allocator.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/flang/runtime/CUDA/allocator.cpp b/flang/runtime/CUDA/allocator.cpp index d848f18..85b3daf 100644 --- a/flang/runtime/CUDA/allocator.cpp +++ b/flang/runtime/CUDA/allocator.cpp @@ -33,7 +33,7 @@ void RTDEF(CUFRegisterAllocator)() { } } -void *CUFAllocPinned(std::size_t sizeInBytes, std::int64_t) { +void *CUFAllocPinned(std::size_t sizeInBytes) { void *p; CUDA_REPORT_IF_ERROR(cudaMallocHost((void **)&p, sizeInBytes)); return p; @@ -41,20 +41,15 @@ void *CUFAllocPinned(std::size_t sizeInBytes, std::int64_t) { void CUFFreePinned(void *p) { CUDA_REPORT_IF_ERROR(cudaFreeHost(p)); } -void *CUFAllocDevice(std::size_t sizeInBytes, std::int64_t stream) { +void *CUFAllocDevice(std::size_t sizeInBytes) { void *p; - if (stream >= 0) { - CUDA_REPORT_IF_ERROR( - cudaMallocAsync(&p, sizeInBytes, (cudaStream_t)stream)); - } else { - CUDA_REPORT_IF_ERROR(cudaMalloc(&p, sizeInBytes)); - } + CUDA_REPORT_IF_ERROR(cudaMalloc(&p, sizeInBytes)); return p; } void CUFFreeDevice(void *p) { CUDA_REPORT_IF_ERROR(cudaFree(p)); } -void *CUFAllocManaged(std::size_t sizeInBytes, std::int64_t) { +void *CUFAllocManaged(std::size_t sizeInBytes) { void *p; CUDA_REPORT_IF_ERROR( cudaMallocManaged((void **)&p, sizeInBytes, cudaMemAttachGlobal)); @@ -63,7 +58,7 @@ void *CUFAllocManaged(std::size_t sizeInBytes, std::int64_t) { void CUFFreeManaged(void *p) { CUDA_REPORT_IF_ERROR(cudaFree(p)); } -void *CUFAllocUnified(std::size_t sizeInBytes, std::int64_t) { +void *CUFAllocUnified(std::size_t sizeInBytes) { // Call alloc managed for the time being. return CUFAllocManaged(sizeInBytes); } |