forked from QMCPACK/qmcpack
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CUDA gcc 13 conflict. Similarily to QMCPACK#4814
- Loading branch information
Showing
3 changed files
with
11 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
#// File created by: Ye Luo, [email protected], Argonne National Laboratory | ||
#////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
set(CUDA_RT_SRCS CUDAfill.cpp CUDAallocator.cpp CUDAruntime.cpp CUDADeviceManager.cpp) | ||
set(CUDA_RT_SRCS CUDAfill.cpp CUDAallocator.cpp CUDAerror.cpp CUDAruntime.cpp CUDADeviceManager.cpp) | ||
set(CUDA_LA_SRCS cuBLAS_missing_functions.cu) | ||
|
||
add_library(platform_cuda_runtime ${CUDA_RT_SRCS}) | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
//// This file is distributed under the University of Illinois/NCSA Open Source License. | ||
//// See LICENSE file in top directory for details. | ||
//// | ||
//// Copyright (c) 2019 QMCPACK developers. | ||
//// Copyright (c) 2024 QMCPACK developers. | ||
//// | ||
//// File developed by: Ye Luo, [email protected], Argonne National Laboratory | ||
//// | ||
|
@@ -13,10 +13,14 @@ | |
#ifndef QMCPLUSPLUS_CUDA_ERROR_H | ||
#define QMCPLUSPLUS_CUDA_ERROR_H | ||
|
||
#include <iostream> | ||
#include <string> | ||
#include <sstream> | ||
#include <stdexcept> | ||
#include <string> // Positioned here to avoid conflict between CUDA and GCC >= 12 header files. https://github.com/QMCPACK/qmcpack/pull/4814 | ||
#include "config.h" | ||
#ifndef QMC_CUDA2HIP | ||
#include <cuda_runtime.h> | ||
#else | ||
#include <hip/hip_runtime.h> | ||
#include "Platforms/ROCm/cuda2hip.h" | ||
#endif | ||
|
||
#define cudaErrorCheck(ans, cause) \ | ||
{ \ | ||
|
@@ -30,18 +34,6 @@ | |
} | ||
|
||
/// prints CUDA error messages. Always use cudaErrorCheck macro. | ||
inline void cudaAssert(cudaError_t code, const std::string& cause, const char* filename, int line, bool abort = true) | ||
{ | ||
if (code != cudaSuccess) | ||
{ | ||
std::ostringstream err; | ||
err << "cudaAssert: " << cudaGetErrorName(code) << " " << cudaGetErrorString(code) << ", file " << filename | ||
<< ", line " << line << std::endl | ||
<< cause << std::endl; | ||
std::cerr << err.str(); | ||
if (abort) | ||
throw std::runtime_error(cause); | ||
} | ||
} | ||
void cudaAssert(cudaError_t code, const std::string& cause, const char* filename, int line, bool abort = true); | ||
|
||
#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