Skip to content

Commit

Permalink
Restructuring build process to isolate projects that depend on complex<>
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Aug 28, 2024
1 parent 11f88e3 commit 99f13b9
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 56 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ option(BUILD_NUMBERS "Set to ON to build all the number syst
option(BUILD_NUMERICS "Set to ON to build all the numeric components" OFF)
option(BUILD_BENCHMARKS "Set to ON to build all the benchmark components" OFF)
option(BUILD_MIXEDPRECISION_SDK "Set to ON to build the mixed-precision SDK" OFF)
option(BUILD_COMPLEX "Set to ON to build complex support components" OFF)

# or, build individual components
# utilities and educational examples
Expand Down Expand Up @@ -606,6 +607,7 @@ if(BUILD_ALL)
set(BUILD_NUMBERS ON)
set(BUILD_MIXEDPRECISION_SDK ON)
set(BUILD_APP_ENVIRONMENT ON)
set(BUILD_COMPLEX ON)

# build the BLAS test/verification suites
set(BUILD_LINEAR_ALGEBRA_BLAS ON)
Expand Down Expand Up @@ -637,6 +639,10 @@ if(BUILD_DEMONSTRATION)
set(BUILD_PLAYGROUND ON)
endif(BUILD_DEMONSTRATION)

if(BUILD_COMPLEX)

endif(BUILD_COMPLEX)

if(BUILD_NUMBERS)
# build the different test/verification suites for each number system
set(BUILD_NUMBER_INTERNALS ON)
Expand Down
17 changes: 6 additions & 11 deletions applications/performance/complex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
file (GLOB SOURCES "./*.cpp")

# Compiler specific environments
# message(STATUS "CMAKE_CXX_COMPILER ID is -${CMAKE_CXX_COMPILER_ID}-")

# exclude AppleClang as XCode14 and Xcode15 have std::complex libs that do not support user defined types5
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
message(STATUS "Ignoring complex tests for AppleClang")

else()
message(STATUS "Adding complex test for all other non-AppleClang environments")
compile_all("true" "complex" "Applications/Performance/Complex" "${SOURCES}")

endif()
if(BUILD_COMPLEX)
message(STATUS "Adding complex test for Application environment")
compile_all("true" "complex" "Complex/Applications/Performance" "${SOURCES}")
else(BUILD_COMPLEX)
message(STATUS "Ignoring complex tests for application/performance")
endif(BUILD_COMPLEX)
20 changes: 10 additions & 10 deletions elastic/decimal/api/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace sw::universal {
static constexpr unsigned edecimal_TABLE_WIDTH = 15;

// report edecimal binary operator error
void ReportBinaryedecimalError(const std::string& test_case, const std::string& op, const edecimal& lhs, const edecimal& rhs, const edecimal& dref, const long& ref) {
void ReportBinaryEdecimalError(const std::string& test_case, const std::string& op, const edecimal& lhs, const edecimal& rhs, const edecimal& dref, const long& ref) {
std::cerr << test_case << " "
<< std::setprecision(20)
<< std::setw(edecimal_TABLE_WIDTH) << lhs
Expand All @@ -29,7 +29,7 @@ void ReportBinaryedecimalError(const std::string& test_case, const std::string&
}

// report edecimal binary operator success
void ReportBinaryedecimalSuccess(const std::string& test_case, const std::string& op, const edecimal& lhs, const edecimal& rhs, const edecimal& dref, const long& ref) {
void ReportBinaryEdecimalSuccess(const std::string& test_case, const std::string& op, const edecimal& lhs, const edecimal& rhs, const edecimal& dref, const long& ref) {
std::cerr << test_case << " "
<< std::setprecision(20)
<< std::setw(edecimal_TABLE_WIDTH) << lhs
Expand All @@ -53,10 +53,10 @@ int VerifyAddition(long ub, bool bReportIndividualTestCases) {
edecimal dref = d1 + d2;
if (dref != ref) {
++nrOfFailedTests;
if (bReportIndividualTestCases) ReportBinaryedecimalError("FAIL", "add", d1, d2, dref, ref);
if (bReportIndividualTestCases) ReportBinaryEdecimalError("FAIL", "add", d1, d2, dref, ref);
}
else {
// if (bReportIndividualTestCases) ReportBinaryedecimalSuccess("SUCCESS", "add", d1, d2, dref, ref);
// if (bReportIndividualTestCases) ReportBinaryEdecimalSuccess("SUCCESS", "add", d1, d2, dref, ref);
}
}
}
Expand All @@ -74,10 +74,10 @@ int VerifySubtraction(long ub, bool bReportIndividualTestCases) {
edecimal dref = d1 - d2;
if (dref != ref) {
++nrOfFailedTests;
if (bReportIndividualTestCases) ReportBinaryedecimalError("FAIL", "sub", d1, d2, dref, ref);
if (bReportIndividualTestCases) ReportBinaryEdecimalError("FAIL", "sub", d1, d2, dref, ref);
}
else {
// if (bReportIndividualTestCases) ReportBinaryedecimalSuccess("SUCCESS", "seb", d1, d2, dref, ref);
// if (bReportIndividualTestCases) ReportBinaryEdecimalSuccess("SUCCESS", "seb", d1, d2, dref, ref);
}
}
}
Expand All @@ -95,10 +95,10 @@ int VerifyMultiplication(long ub, bool bReportIndividualTestCases) {
edecimal dref = d1 * d2;
if (dref != ref) {
++nrOfFailedTests;
if (bReportIndividualTestCases) ReportBinaryedecimalError("FAIL", "mul", d1, d2, dref, ref);
if (bReportIndividualTestCases) ReportBinaryEdecimalError("FAIL", "mul", d1, d2, dref, ref);
}
else {
// if (bReportIndividualTestCases) ReportBinaryedecimalSuccess("SUCCESS", "mul", d1, d2, dref, ref);
// if (bReportIndividualTestCases) ReportBinaryEdecimalSuccess("SUCCESS", "mul", d1, d2, dref, ref);
}
}
}
Expand Down Expand Up @@ -136,10 +136,10 @@ int VerifyDivision(long ub, bool bReportIndividualTestCases) {
}
if (dref != ref) {
++nrOfFailedTests;
if (bReportIndividualTestCases) ReportBinaryedecimalError("FAIL", "div", d1, d2, dref, ref);
if (bReportIndividualTestCases) ReportBinaryEdecimalError("FAIL", "div", d1, d2, dref, ref);
}
else {
//if (bReportIndividualTestCases) ReportBinaryedecimalSuccess("SUCCESS", "div", d1, d2, dref, ref);
//if (bReportIndividualTestCases) ReportBinaryEdecimalSuccess("SUCCESS", "div", d1, d2, dref, ref);
}
}
}
Expand Down
15 changes: 7 additions & 8 deletions playground/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ set(REAL_SRCS efunc_posits.cpp

compile_all("true" "playground" "Playground" "${REAL_SRCS}")

# exclude AppleClang as XCode14 and Xcode15 have std::complex libs that do not support user defined types5
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
message(STATUS "Ignoring complex playground tests for AppleClang")
# NOTE: AppleClang as XCode14 and Xcode15 have std::complex libs that do not support user defined types5
if(BUILD_COMPLEX)
message(STATUS "Adding playground complex test")
compile_all("true" "playground" "Complex/Playground" "${COMPLEX_SRCS}")

else()
message(STATUS "Adding complex test for all other non-AppleClang environments")
compile_all("true" "playground" "Playground" "${COMPLEX_SRCS}")

endif()
else(BUILD_COMPLEX)
message(STATUS "Removing complex environment test from Playground")
endif(BUILD_COMPLEX)
15 changes: 6 additions & 9 deletions static/fixpnt/binary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ compile_all("true" "fixpnt" "Number Systems/static/fixed-point/binary/fixpnt/mat
# Compiler specific environments
message(STATUS "CMAKE_CXX_COMPILER ID is -${CMAKE_CXX_COMPILER_ID}-")

# exclude XCode15
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
message(STATUS "Ignoring complex tests for AppleClang")

else()
message(STATUS "Adding complex test for all other non-AppleClang environments")
compile_all("true" "fixpnt" "Number Systems/static/fixed-point/binary/fixpnt/complex" "${COMPLEX_SRC}")

endif()
if(BUILD_COMPLEX)
message(STATUS "Adding complex test for fixpnt")
compile_all("true" "fixpnt" "Complex/Number System/static/fixed-point/binary/fixpnt/complex" "${COMPLEX_SRC}")
else(BUILD_COMPLEX)
message(STATUS "Removing complex environment regression suite for fixpnt")
endif(BUILD_COMPLEX)

12 changes: 6 additions & 6 deletions static/integer/decimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ file(GLOB ARITHMETIC_SRC "arithmetic/*.cpp")
file(GLOB MATH_SRC "math/*.cpp")
file(GLOB PERFORMANCE_SRC "performance/*.cpp")

compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/api" "${API_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/conversion" "${CONVERSION_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/logic" "${LOGIC_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/arithmetic" "${ARITHMETIC_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/math" "${MATH_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/integer/performance" "${PERFORMANCE_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/api" "${API_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/conversion" "${CONVERSION_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/logic" "${LOGIC_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/arithmetic" "${ARITHMETIC_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/math" "${MATH_SRC}")
compile_all("true" "dint" "Number Systems/static/integer/decimal/dint/performance" "${PERFORMANCE_SRC}")
12 changes: 0 additions & 12 deletions tools/cmake.compiler.conditional

This file was deleted.

1 change: 1 addition & 0 deletions tools/cmake/summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function(universal_print_configuration_summary)
universal_status(" BUILD_NUMERICS : ${BUILD_NUMERICS}")
universal_status(" BUILD_BENCHMARKS : ${BUILD_BENCHMARKS}")
universal_status(" BUILD_MIXEDPRECISION_SDK : ${BUILD_MIXEDPRECISION_SDK}")
universal_status(" BUILD_COMPLEX : ${BUILD_COMPLEX}")
universal_status("")
universal_status(" BUILD_CMD_LINE_TOOLS : ${BUILD_CMD_LINE_TOOLS}")
universal_status(" BUILD_EDUCATION : ${BUILD_EDUCATION}")
Expand Down

0 comments on commit 99f13b9

Please sign in to comment.