Skip to content

Commit

Permalink
update HIP libs path (hipfft, hiprand, hipcub) for compatibilit…
Browse files Browse the repository at this point in the history
…y with ROCm > 5.7
  • Loading branch information
Suyash Tandon committed Dec 9, 2024
1 parent cafe3b0 commit e0553df
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/acc/hip/hip_fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "src/acc/hip/hip_settings.h"
#include "src/acc/hip/hip_mem_utils.h"
#include <hip/hip_runtime.h>
#include <hipfft.h>
#include <hipfft/hipfft.h>

#ifdef DEBUG_HIP
#define HANDLE_HIPFFT_ERROR( err ) (HipfftHandleError( err, __FILE__, __LINE__ ))
Expand Down
4 changes: 2 additions & 2 deletions src/acc/hip/hip_kernels/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#define HIP_HELPER_KERNELS_H_

#include <hip/hip_runtime.h>
#include <hiprand.h>
#include <hiprand_kernel.h>
#include <hiprand/hiprand.h>
#include <hiprand/hiprand_kernel.h>
#include <vector>
#include <iostream>
#include <fstream>
Expand Down
4 changes: 2 additions & 2 deletions src/acc/hip/hip_kernels/helper.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "src/acc/hip/hip_kernels/helper.h"
#include "src/acc/hip/hip_settings.h"

#include <hiprand.h>
#include <hiprand_kernel.h>
#include <hiprand/hiprand.h>
#include <hiprand/hiprand_kernel.h>

/// Needed explicit template instantiations
template __global__ void hip_kernel_make_eulers_2D<true>(XFLOAT *,
Expand Down
2 changes: 1 addition & 1 deletion src/acc/hip/hip_mem_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef _HIP_ENABLED
#include <hip/hip_runtime.h>
#include <hiprand.h>
#include <hiprand/hiprand.h>
#include "src/acc/hip/hip_settings.h"
#include "src/acc/hip/custom_allocator.h"
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/acc/hip/hip_ml_optimiser.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <iostream>
#include "src/ml_optimiser.h"
#include <hip/hip_runtime.h>
#include <hiprand.h>
#include <hiprand_kernel.h>
#include <hiprand/hiprand.h>
#include <hiprand/hiprand_kernel.h>

#include "src/acc/acc_ptr.h"
#include "src/acc/acc_projector.h"
Expand Down
2 changes: 1 addition & 1 deletion src/acc/hip/hip_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "src/macros.h"
#include "src/error.h"

#include <hiprand.h>
#include <hiprand/hiprand.h>

// Required compute capability
#define HIP_CC_MAJOR 5
Expand Down
8 changes: 4 additions & 4 deletions src/acc/hip/hip_utils_cub.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ if (ptr.getAllocator() == NULL)
max_pair.deviceAlloc();
size_t temp_storage_size = 0;

DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMax( NULL, temp_storage_size, ~ptr, ~max_pair, ptr.getSize()));
DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMax( NULL, temp_storage_size, ~ptr, ~max_pair, static_cast<int>(ptr.getSize())));

if(temp_storage_size==0)
temp_storage_size=1;

HipCustomAllocator::Alloc* alloc = ptr.getAllocator()->alloc(temp_storage_size);

DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMax( alloc->getPtr(), temp_storage_size, ~ptr, ~max_pair, ptr.getSize(), ptr.getStream()));
DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMax( alloc->getPtr(), temp_storage_size, ~ptr, ~max_pair, static_cast<int>(ptr.getSize()), ptr.getStream()));

max_pair.cpToHost();
ptr.streamSync();
Expand Down Expand Up @@ -75,14 +75,14 @@ if (ptr.getAllocator() == NULL)
min_pair.deviceAlloc();
size_t temp_storage_size = 0;

DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMin( NULL, temp_storage_size, ~ptr, ~min_pair, ptr.getSize()));
DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMin( NULL, temp_storage_size, ~ptr, ~min_pair, static_cast<int>(ptr.getSize())));

if(temp_storage_size==0)
temp_storage_size=1;

HipCustomAllocator::Alloc* alloc = ptr.getAllocator()->alloc(temp_storage_size);

DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMin( alloc->getPtr(), temp_storage_size, ~ptr, ~min_pair, ptr.getSize(), ptr.getStream()));
DEBUG_HANDLE_ERROR(hipcub::DeviceReduce::ArgMin( alloc->getPtr(), temp_storage_size, ~ptr, ~min_pair, static_cast<int>(ptr.getSize()), ptr.getStream()));

min_pair.cpToHost();
ptr.streamSync();
Expand Down
2 changes: 1 addition & 1 deletion src/projector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifdef _CUDA_ENABLED
#include <cufft.h>
#elif _HIP_ENABLED
#include <hipfft.h>
#include <hipfft/hipfft.h>
#endif
#if defined _CUDA_ENABLED || defined _HIP_ENABLED
#include <sys/types.h>
Expand Down

0 comments on commit e0553df

Please sign in to comment.