Skip to content

Commit

Permalink
Merge pull request #25 from A-New-BellHope/MacCMake
Browse files Browse the repository at this point in the history
Mac c make
  • Loading branch information
oldstylejoe authored Nov 30, 2023
2 parents 25d7621 + bbfb1f6 commit ca51464
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/cuda/SetupCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ message(STATUS "CUDA extra flags: " ${CUDA_EXTRA_FLAGS})

# Determine the GPU compute capabilities / gencodes to compile for
function(get_compute_for_gpu OUT_VAR GPU_NAME)
set(GPU_DATABASE "30:GTX 770,GTX 760,GT 740,GTX 690,GTX 680,GTX 670,GTX 660 Ti,GTX 660,GTX 650 Ti BOOST,GTX 650 Ti,GTX 650;35:GTX Titan Z,GTX Titan Black,GTX Titan,GTX 780 Ti,GTX 780;50:GTX 750 Ti,GTX 750;52:GTX Titan X,GTX 980 Ti,GTX 980,GTX 970,GTX 960,GTX 950;61:TITAN Xp,Titan X,GTX 1080 Ti,GTX 1080,GTX 1070 Ti,GTX 1070,GTX 1070 with Max-Q Design,GTX 1060,GTX 1050 Ti,GTX 1050;70:TITAN V;75:TITAN RTX,RTX 2080 Ti,RTX 2080 Super,RTX 2080,RTX 2070 Super,RTX 2070,RTX 2060 Super,RTX 2060,GTX 1660 Ti,GTX 1660 Super,GTX 1660,GTX 1650 Super,GTX 1650;86:RTX 3090 Ti,RTX 3090,RTX 3080 Ti,RTX 3080,RTX 3070 Ti,RTX 3070,RTX 3060 Ti,RTX 3060,RTX 3050 Ti,RTX 3050;89:RTX 4090,RTX 4080,RTX 4070 Ti")
set(GPU_DATABASE "30:GTX 770,GTX 760,GT 740,GTX 690,GTX 680,GTX 670,GTX 660 Ti,GTX 660,GTX 650 Ti BOOST,GTX 650 Ti,GTX 650;35:GTX Titan Z,GTX Titan Black,GTX Titan,GTX 780 Ti,GTX 780;50:GTX 750 Ti,GTX 750;52:GTX Titan X,GTX 980 Ti,GTX 980,GTX 970,GTX 960,GTX 950;61:TITAN Xp,Titan X,GTX 1080 Ti,GTX 1080,GTX 1070 Ti,GTX 1070,GTX 1070 with Max-Q Design,GTX 1060,GTX 1050 Ti,GTX 1050;70:TITAN V;75:TITAN RTX,RTX 2080 Ti,RTX 2080 Super,RTX 2080,RTX 2070 Super,RTX 2070,RTX 2060 Super,RTX 2060,GTX 1660 Ti,GTX 1660 Super,GTX 1660,GTX 1650 Super,GTX 1650;86:RTX 3090 Ti,RTX 3090,RTX 3080 Ti,RTX 3080,RTX 3070 Ti,RTX 3070,RTX 3060 Ti,RTX 3060,RTX 3050 Ti,RTX 3050;89:RTX 4090,RTX 4080,RTX 4070 Ti,RTX 4060 Laptop GPU")
foreach(COMPUTE_ROW ${GPU_DATABASE})
string(REGEX REPLACE ":.*" "" COMPUTE_CAPABILITY ${COMPUTE_ROW})
string(REGEX REPLACE ".*:" "" GPU_LIST ${COMPUTE_ROW})
Expand Down
2 changes: 2 additions & 0 deletions src/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ HOST_DEVICE inline size_t GetFieldAddr(
// clang-format on
}

std::ostream &operator<<(std::ostream &s, const vec2 &v);

} // namespace bhc

#define _BHC_INCLUDING_COMPONENTS_ 1
Expand Down
6 changes: 4 additions & 2 deletions src/mode/arr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,14 @@ template<bool O3D, bool R3D> void ReadOutArrivals(
if constexpr(O3D) {
if(dim != "'3D'") {
EXTERR(
"Incorrect dimensionality in arrivals file, must be '3D', got %s", dim);
"Incorrect dimensionality in arrivals file, must be '3D', got %s",
dim.c_str());
}
} else {
if(dim != "'2D'") {
EXTERR(
"Incorrect dimensionality in arrivals file, must be '2D', got %s", dim);
"Incorrect dimensionality in arrivals file, must be '2D', got %s",
dim.c_str());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/mode/arr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ template<bool O3D, bool R3D> class Arr : public Field<O3D, R3D> {
remainingMemory -= nSrcs * sizeof(int32_t);
remainingMemory -= 32 * 3; // Possible padding used for the three arrays
remainingMemory = std::max(remainingMemory, (int64_t)0);
arrinfo->MaxNArr = (int32_t)std::min(
arrinfo->MaxNArr = (int32_t)std::min<int32_t>(
remainingMemory / (nSrcsRcvrs * sizeof(Arrival)), (size_t)0x7FFFFFFF);
if(arrinfo->MaxNArr == 0) {
EXTERR("Insufficient memory to allocate arrivals");
Expand Down
6 changes: 4 additions & 2 deletions src/mode/ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ template<bool O3D, bool R3D> void ReadOutRay(
RAYFile.Read(dim);
if constexpr(O3D) {
if(dim != "xyz") {
EXTERR("Dimensionality in RAYFile is '%s', must be 'xyz' for 3D/Nx2D", dim);
EXTERR(
"Dimensionality in RAYFile is '%s', must be 'xyz' for 3D/Nx2D",
dim.c_str());
}
} else {
if(dim != "rz") {
EXTERR("Dimensionality in RAYFile is '%s', must be 'rz' for 2D", dim);
EXTERR("Dimensionality in RAYFile is '%s', must be 'rz' for 2D", dim.c_str());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/module/atten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ template<bool O3D> cpx crci(
ret = cpx(c, alphaT);

if(alphaT > c) {
PRTFile << "Complex sound speed: " << ret << "\n";
PRTFile << "Complex sound speed: " << std::complex<real>(ret.real(), ret.imag()) << "\n";
PRTFile << "Usually this means you have an attenuation that is way too high\n";
EXTWARN("attenuation: crci: The complex sound speed has an imaginary part > "
"real part");
Expand Down

0 comments on commit ca51464

Please sign in to comment.