Merge pull request #2789 from rbberger/gpu_hip_fixes

More GPU fixes for HIP
This commit is contained in:
Axel Kohlmeyer
2021-06-04 01:08:53 -04:00
committed by GitHub
6 changed files with 13 additions and 8 deletions

View File

@ -8,10 +8,6 @@
#ifndef HIP_DEVICE
#define HIP_DEVICE
// workaround after GPU package Feb2021 update
// todo: make new neighbor code work with HIP
#define LAL_USE_OLD_NEIGHBOR
#include <hip/hip_runtime.h>
#include <unordered_map>
#include <string>

View File

@ -128,12 +128,12 @@ class UCL_Const {
_cq));
}
/// Get device ptr associated with object
inline const void* begin() const { return &_global; }
inline const hipDeviceptr_t * begin() const { return &_global; }
inline void clear() {}
private:
hipStream_t _cq;
void* _global;
hipDeviceptr_t _global;
size_t _global_bytes;
friend class UCL_Kernel;
};

View File

@ -33,6 +33,10 @@
#endif
#endif
#if defined(USE_HIP)
#define LAL_USE_OLD_NEIGHBOR
#endif
namespace LAMMPS_AL {
class Neighbor {

View File

@ -40,6 +40,10 @@ _texture_2d( pos_tex,int4);
#endif
#endif
#ifdef USE_HIP
#define LAL_USE_OLD_NEIGHBOR
#endif
__kernel void calc_cell_id(const numtyp4 *restrict x_,
unsigned *restrict cell_id,
int *restrict particle_id,

View File

@ -3,6 +3,7 @@ From: ubuntu:20.04
%environment
export PATH=/usr/lib/ccache:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-4.2.0/llvm/lib
%post
export DEBIAN_FRONTEND=noninteractive
apt-get update

View File

@ -5,7 +5,7 @@ From: ubuntu:20.04
export PATH=/usr/lib/ccache:/usr/local/cuda-11.0/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64
export CUDADIR=/usr/local/cuda-11.0
export CUDA_PATH=/usr/local/cuda-11.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/lib64:/opt/rocm/lib:/opt/rocm-4.2.0/llvm/lib
export LIBRARY_PATH=/usr/local/cuda-11.0/lib64/stubs
%post
export DEBIAN_FRONTEND=noninteractive
@ -131,7 +131,7 @@ From: ubuntu:20.04
###########################################################################
export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64
git clone -b rocm-3.7.x https://github.com/ROCmSoftwarePlatform/hipCUB.git
git clone -b rocm-4.2.x https://github.com/ROCmSoftwarePlatform/hipCUB.git
mkdir hipCUB/build
cd hipCUB/build
CXX=hipcc cmake -D BUILD_TEST=off ..