Skip to content

Commit 86f4ad1

Browse files
committed
Updates to GPU memory allocation to align with P2P paper
1 parent 4459deb commit 86f4ad1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sw/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ if(EN_GPU)
152152
)
153153

154154
# Add GPU libraries
155-
target_link_libraries(Coyote PUBLIC hip::device numa pthread drm drm_amdgpu rt dl hsa-runtime64 hsakmt)
155+
target_link_libraries(Coyote PUBLIC hip::device numa pthread drm drm_amdgpu rt dl hsa-runtime64 hsakmt rocm_smi64)
156156
endif()
157157

158158
##############################

sw/include/coyote/cGpu.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <stdexcept>
3535

3636
#include <hsa.h>
37+
#include <hip/hip_runtime.h>
3738
#include <hsa/hsa_ext_amd.h>
3839

3940
namespace coyote {

sw/src/cThread.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,8 @@ void* cThread::getMem(CoyoteAlloc&& alloc) {
486486
#endif
487487

488488
// Allocate the GPU memory
489-
err = hsa_memory_allocate(*info_params.region, alloc.size, (void **) &(mem));
490-
if (err != HSA_STATUS_SUCCESS) {
491-
std::cerr << "ERROR: cThread::getMem() - Failed to allocate GPU memory!" << std::endl;;
489+
if (hipMalloc((void **) &mem, alloc.size)) {
490+
std::cerr << "ERROR: cThread::getMem() - hipMalloc failed to allocate GPU memory!" << std::endl;;
492491
return nullptr;
493492
}
494493

0 commit comments

Comments
 (0)