Skip to content

Commit 2e6e678

Browse files
authored
Fix Clang compile warnings from 3.98 (#510)
* [Codex] Fix macOS/clang data_serialization (no test gating) * [Revert] lns::fraction() implemented by Codex
1 parent d359b54 commit 2e6e678

File tree

8 files changed

+17
-26
lines changed

8 files changed

+17
-26
lines changed

applications/performance/stream/stream.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ try {
194194

195195
ReportTestSuiteHeader(test_suite, reportTestCases);
196196

197+
#if MANUAL_TESTING
197198
size_t startSample = 11;
198199
size_t endSample = 13;
199-
#if MANUAL_TESTING
200200
Sweep<float>(startSample, endSample);
201201
Sweep < fixpnt<8, 4> >(startSample, endSample);
202202

@@ -215,23 +215,23 @@ try {
215215
#endif
216216

217217
#if REGRESSION_LEVEL_2
218-
startSample = 10;
219-
endSample = 11; // just one pass through the operators
218+
size_t startSample = 10;
219+
size_t endSample = 11; // just one pass through the operators
220220
Sweep<float>(startSample, endSample);
221221
Sweep<cfloat<32, 8, std::uint32_t, true, false, false>>(startSample, endSample);
222222
#endif
223223

224224
#if REGRESSION_LEVEL_3
225-
startSample = 10;
226-
endSample = 11; // just one pass through the operators
225+
size_t startSample = 10;
226+
size_t endSample = 11; // just one pass through the operators
227227
Sweep<int>(startSample, endSample);
228228
Sweep<float>(startSample, endSample);
229229
Sweep<double>(startSample, endSample);
230230
#endif
231231

232232
#if REGRESSION_LEVEL_4
233-
startSample = 10;
234-
endSample = 11; // just one pass through the operators
233+
size_t startSample = 10;
234+
size_t endSample = 11; // just one pass through the operators
235235
Sweep<int>(startSample, endSample);
236236
Sweep<float>(startSample, endSample);
237237
Sweep<double>(startSample, endSample);

applications/precision/numeric/midpoint.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ try {
8282

8383
std::cout << "lerp and midpoint operators\n";
8484

85-
using int32 = integer<32>;
86-
using fixpnt32 = fixpnt<32,16>;
87-
using posit32 = posit<32,2>;
88-
using areal32 = areal<32,8>;
89-
using lns32 = lns<32,23>;
85+
//using int32 = integer<32>;
86+
//using fixpnt32 = fixpnt<32,16>;
87+
//using posit32 = posit<32,2>;
88+
//using areal32 = areal<32,8>;
89+
//using lns32 = lns<32,23>;
9090

9191
// check difficult midpoint and lerp operations on different number systems
9292

applications/precision/tapered/error_propagation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ try {
7676
constexpr double x_max = 1.01;
7777
constexpr double x_step = (x_max - x_min) / nrSamples;
7878
double x = x_min;
79-
qd qa(x_step), q_step(x_step), qb;
79+
qd qa(x_step), qb;
8080
Posit pa(x_step), p_step(x_step), pb;
8181
Cfloat ca(x_step), c_step(x_step), cb;
8282
Lns la(x_step), l_step(x_step), lb;

benchmark/energy/instrumented/mixed_precision_blas_demo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ void demonstrateGEMM() {
7575

7676
// Posit16 with Posit32 accumulator
7777
using p16 = posit<16, 1>;
78-
using p32 = posit<32, 2>;
7978
std::vector<p16> A_p16(A_double.begin(), A_double.end());
8079
std::vector<p16> B_p16(B_double.begin(), B_double.end());
8180
std::vector<p16> C_p16(m * n, p16(0));
@@ -193,7 +192,7 @@ void demonstrateAccuracyVsEnergy() {
193192
std::vector<float> x_f32(x.begin(), x.end());
194193
std::vector<float> y_f32(y.begin(), y.end());
195194
MixedPrecisionStats stats_f32;
196-
auto result_f32 = mp_dot<MP_FP32_Only>(x_f32, y_f32, &stats_f32);
195+
mp_dot<MP_FP32_Only>(x_f32, y_f32, &stats_f32);
197196

198197
// FP16+FP32acc
199198
std::vector<half> x_f16(x.begin(), x.end());

include/sw/blas/mixed_precision.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ mp_dot(const std::vector<typename MPC::input_type>& x,
100100
const std::vector<typename MPC::input_type>& y,
101101
MixedPrecisionStats* stats = nullptr) {
102102

103-
using InputT = typename MPC::input_type;
104103
using ComputeT = typename MPC::compute_type;
105104
using AccumT = typename MPC::accumulator_type;
106105
using OutputT = typename MPC::output_type;
@@ -144,7 +143,6 @@ void mp_gemm(size_t m, size_t n, size_t k,
144143
std::vector<typename MPC::output_type>& C,
145144
MixedPrecisionStats* stats = nullptr) {
146145

147-
using InputT = typename MPC::input_type;
148146
using ComputeT = typename MPC::compute_type;
149147
using AccumT = typename MPC::accumulator_type;
150148
using OutputT = typename MPC::output_type;
@@ -279,10 +277,8 @@ double estimateMixedPrecisionEnergy(const MixedPrecisionStats& stats,
279277
return BitWidth::bits_64;
280278
};
281279

282-
BitWidth input_bw = toBitWidth(MPC::input_bits);
283280
BitWidth compute_bw = toBitWidth(MPC::compute_bits);
284281
BitWidth accum_bw = toBitWidth(MPC::accum_bits);
285-
BitWidth output_bw = toBitWidth(MPC::output_bits);
286282

287283
double energy = 0.0;
288284

@@ -508,4 +504,3 @@ inline void reportMixedPrecisionBenchmark(std::ostream& os,
508504
}
509505

510506
}} // namespace sw::blas
511-

linalg/data/test_matrices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace sw { namespace blas {
2727
fo.close();
2828
}
2929

30-
static void GenerateMatrixDataFiles(const std::vector<std::string>& testMatrixNames) {
30+
[[maybe_unused]] static void GenerateMatrixDataFiles(const std::vector<std::string>& testMatrixNames) {
3131
for (auto matrixName : testMatrixNames) {
3232
WriteMatrixDataFile(matrixName + std::string(".dat"), getTestMatrix(matrixName));
3333
}

static/areal/standard/double_precision.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ int ValidateSubnormalConversion(bool reportTestCases) {
369369
bool exact = (roundtrip == subnormal);
370370
bool isUncertain = (a.block(0) & 1) != 0;
371371

372-
// Calculate relative error
373-
double relError = (subnormal != 0.0) ? std::abs((roundtrip - subnormal) / subnormal) : 0.0;
374-
375372
// The conversion should be correct if:
376373
// 1. The value is exact (no ubit set), OR
377374
// 2. The ubit is set (indicating uncertainty due to precision loss)

static/posit/api/api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ try {
213213
// parsing of text input
214214
{
215215
// TODO: implement parse
216-
constexpr unsigned nbits = 128;
217-
constexpr unsigned es = 2;
216+
//constexpr unsigned nbits = 128;
217+
//constexpr unsigned es = 2;
218218
//parse<nbits, es> a, b, c, d;
219219
//a.assign("123456789.987654321");
220220
//parse("123456789.987654321", b);

0 commit comments

Comments
 (0)