-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* HIP compatibility, remove need for hipify-perl * split GPU N-body code into additional units handle gpu-direct with interface compile_definition removed duplicate cartesian multipole implementation
- Loading branch information
Showing
78 changed files
with
1,149 additions
and
1,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
#pragma once | ||
|
||
#ifdef __HIPCC__ | ||
|
||
#include <hipcub/hipcub.hpp> | ||
|
||
namespace cub = hipcub; | ||
|
||
#else | ||
|
||
#include <cub/cub.cuh> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/*! @file | ||
* @brief CUDA/HIP runtime API compatiblity wrapper | ||
* | ||
* @author Sebastian Keller <[email protected]> | ||
*/ | ||
|
||
#pragma once | ||
|
||
#if defined(__HIP_PLATFORM_AMD__) || defined(__HIPCC__) | ||
|
||
#include <hip/hip_runtime.h> | ||
|
||
#define cudaDeviceProp hipDeviceProp_t | ||
#define cudaDeviceSynchronize hipDeviceSynchronize | ||
#define cudaErrorInvalidValue hipErrorInvalidValue | ||
#define cudaError_t hipError_t | ||
#define cudaEventCreate hipEventCreate | ||
#define cudaEventDestroy hipEventDestroy | ||
#define cudaEventElapsedTime hipEventElapsedTime | ||
#define cudaEventRecord hipEventRecord | ||
#define cudaEventSynchronize hipEventSynchronize | ||
#define cudaEvent_t hipEvent_t | ||
#define cudaFree hipFree | ||
#define cudaFreeHost hipFreeHost | ||
#define cudaGetDevice hipGetDevice | ||
#define cudaGetDeviceCount hipGetDeviceCount | ||
#define cudaGetDeviceProperties hipGetDeviceProperties | ||
#define cudaGetErrorName hipGetErrorName | ||
#define cudaGetErrorString hipGetErrorString | ||
#define cudaGetLastError hipGetLastError | ||
#define cudaMalloc hipMalloc | ||
#define cudaMallocHost hipMallocHost | ||
#define cudaMallocManaged hipMallocManaged | ||
#define cudaMemAttachGlobal hipMemAttachGlobal | ||
#define cudaMemcpy hipMemcpy | ||
#define cudaMemcpyDeviceToDevice hipMemcpyDeviceToDevice | ||
#define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost | ||
#define cudaMemcpyFromSymbol hipMemcpyFromSymbol | ||
#define cudaMemcpyHostToDevice hipMemcpyHostToDevice | ||
#define cudaMemcpyToSymbol hipMemcpyToSymbol | ||
#define cudaMemoryTypeDevice hipMemoryTypeDevice | ||
#define cudaMemoryTypeManaged hipMemoryTypeManaged | ||
#define cudaMemset hipMemset | ||
#define cudaPointerAttributes hipPointerAttribute_t | ||
#define cudaPointerGetAttributes hipPointerGetAttributes | ||
#define cudaSetDevice hipSetDevice | ||
#define cudaStreamCreate hipStreamCreate | ||
#define cudaStreamDestroy hipStreamDestroy | ||
#define cudaStreamSynchronize hipStreamSynchronize | ||
#define cudaStream_t hipStream_t | ||
#define cudaSuccess hipSuccess | ||
|
||
#define GPU_SYMBOL HIP_SYMBOL | ||
|
||
#else | ||
|
||
#include <cuda_runtime.h> | ||
|
||
#define GPU_SYMBOL(x) x | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,7 @@ | |
* @author Sebastian Keller <[email protected]> | ||
*/ | ||
|
||
#include <cub/cub.cuh> | ||
|
||
#include "cstone/cuda/cub.hpp" | ||
#include "cstone/cuda/errorcheck.cuh" | ||
#include "cstone/focus/rebalance.hpp" | ||
#include "cstone/focus/rebalance_gpu.h" | ||
|
@@ -159,7 +158,7 @@ bool protectAncestorsGpu(const KeyType* prefixes, | |
protectAncestorsKernel<<<iceil(numNodes, numThreads), numThreads>>>(prefixes, parents, nodeOps, numNodes); | ||
|
||
int numNodesModify; | ||
checkGpuErrors(cudaMemcpyFromSymbol(&numNodesModify, nodeOpSum, sizeof(int))); | ||
checkGpuErrors(cudaMemcpyFromSymbol(&numNodesModify, GPU_SYMBOL(nodeOpSum), sizeof(int))); | ||
|
||
return numNodesModify == 0; | ||
} | ||
|
@@ -197,7 +196,7 @@ ResolutionStatus enforceKeysGpu(const KeyType* forcedKeys, | |
} | ||
|
||
int status; | ||
checkGpuErrors(cudaMemcpyFromSymbol(&status, enforceKeyStatus_device, sizeof(ResolutionStatus))); | ||
checkGpuErrors(cudaMemcpyFromSymbol(&status, GPU_SYMBOL(enforceKeyStatus_device), sizeof(ResolutionStatus))); | ||
return static_cast<ResolutionStatus>(status); | ||
} | ||
|
||
|
@@ -215,4 +214,4 @@ template ResolutionStatus enforceKeysGpu(const uint64_t* forcedKeys, | |
const TreeNodeIndex* parents, | ||
TreeNodeIndex* nodeOps); | ||
|
||
} // namespace cstone | ||
} // namespace cstone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
* @author Sebastian Keller <[email protected]> | ||
*/ | ||
|
||
#include "cstone/cuda/cuda_runtime.hpp" | ||
#include "cstone/primitives/math.hpp" | ||
#include "cstone/primitives/stl.hpp" | ||
#include "cstone/util/array.hpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.