From fb5d20181f030f68abfaf724f40d6cbb024b356d Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 7 Jun 2023 16:26:09 -0700 Subject: [PATCH 1/3] clang compiler reqs --- src/common.hpp | 2 ++ src/mode/arr.hpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common.hpp b/src/common.hpp index c444df7..eb58c94 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -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 diff --git a/src/mode/arr.hpp b/src/mode/arr.hpp index d41d6ce..c79c78d 100644 --- a/src/mode/arr.hpp +++ b/src/mode/arr.hpp @@ -79,7 +79,7 @@ template class Arr : public Field { 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( remainingMemory / (nSrcsRcvrs * sizeof(Arrival)), (size_t)0x7FFFFFFF); if(arrinfo->MaxNArr == 0) { EXTERR("Insufficient memory to allocate arrivals"); From 63bd48d8a1439f4491657e1699d929780407ddf6 Mon Sep 17 00:00:00 2001 From: Jan-Kristian Mathisen Date: Tue, 22 Aug 2023 14:55:54 +0200 Subject: [PATCH 2/3] Fixes build error caused by trying to print cuda complex type with ostream --- src/module/atten.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/atten.cpp b/src/module/atten.cpp index 81c4892..88cce6b 100644 --- a/src/module/atten.cpp +++ b/src/module/atten.cpp @@ -184,7 +184,7 @@ template cpx crci( ret = cpx(c, alphaT); if(alphaT > c) { - PRTFile << "Complex sound speed: " << ret << "\n"; + PRTFile << "Complex sound speed: " << std::complex(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"); From bbfb1f6af7a9d48711767082c05f5f951e57617d Mon Sep 17 00:00:00 2001 From: oldstylejoe Date: Fri, 20 Oct 2023 17:35:39 -0700 Subject: [PATCH 3/3] pass char* in variadic --- config/cuda/SetupCUDA.cmake | 2 +- src/mode/arr.cpp | 6 ++++-- src/mode/ray.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/cuda/SetupCUDA.cmake b/config/cuda/SetupCUDA.cmake index 32445f2..3a65aaa 100644 --- a/config/cuda/SetupCUDA.cmake +++ b/config/cuda/SetupCUDA.cmake @@ -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}) diff --git a/src/mode/arr.cpp b/src/mode/arr.cpp index 1aef613..746ada0 100644 --- a/src/mode/arr.cpp +++ b/src/mode/arr.cpp @@ -305,12 +305,14 @@ template 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()); } } diff --git a/src/mode/ray.cpp b/src/mode/ray.cpp index 4be5ff1..7f58bdc 100644 --- a/src/mode/ray.cpp +++ b/src/mode/ray.cpp @@ -248,11 +248,13 @@ template 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()); } }