Skip to content

Commit

Permalink
Merge pull request #1478 from lattice/tweak/typos
Browse files Browse the repository at this point in the history
typos
  • Loading branch information
maddyscientist authored Jun 27, 2024
2 parents fbbe14c + 11d9102 commit 1029d62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ add_subdirectory(targets/generic)
target_include_directories(quda PRIVATE ../include/targets/generic)
add_subdirectory(interface)

# ignore any unkown pragmas
# ignore any unknown pragmas
target_compile_options(quda_cpp PUBLIC $<$<COMPILE_LANGUAGE:CXX>:
$<$<CXX_COMPILER_ID:Clang>:-Wno-unknown-pragmas>
$<$<CXX_COMPILER_ID:GNU>:-Wno-unknown-pragmas>
>)

# add some deifnitions that cause issues with cmake 3.7 and nvcc only to cpp files
# add some definitions that cause issues with cmake 3.7 and nvcc only to cpp files
target_compile_definitions(quda_cpp PUBLIC -DQUDA_HASH="${HASH}")
if(GITVERSION)
target_compile_definitions(quda_cpp PUBLIC -DGITVERSION="${GITVERSION}")
Expand Down
13 changes: 7 additions & 6 deletions tests/host_reference/contract_ft_reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,16 @@ int contractionFT_reference(Float **spinorX, Float **spinorY, const double *cons
const int ntol = 7;
auto epsilon = std::numeric_limits<Float>::epsilon();
auto fact = epsilon;
fact *= sqrt((double)nSpin * 6 * V * 2 / reduction_slices); // account for repeated roundoff in float ops
fact *= 10; // account for variation in phase computation
std::array<double, ntol> tolerance {1.0e-5 * fact, 1.0e-4 * fact, 1.0e-3 * fact, 1.0e-2 * fact,
1.0e-1 * fact, 1.0e+0 * fact, 1.0e+1 * fact};
fact *= sqrt((double)nSpin * 6 * V * comm_size() * 2 / reduction_slices); // account for repeated roundoff in float ops
fact *= 10; // account for variation in phase computation
std::vector<double> tolerance(ntol);
std::generate(tolerance.begin(), tolerance.end(), [step = 1e-6 * fact]() mutable { return step *= 10; });

int check_tol = 5;
std::array<int, ntol> fails = {};
std::vector<int> fails(ntol, 0.0);

for (size_t idx = 0; idx < n_floats; ++idx) {
double rel = abs(d_result[idx] - h_result[idx]) / (abs(h_result[idx]) + epsilon);
double rel = abs(d_result[idx] - h_result[idx]);
// printfQuda("%5ld: %10.3e %10.3e: %10.3e\n", idx, d_result[idx], h_result[idx], rel);
for (int d = 0; d < ntol; ++d)
if (rel > tolerance[d]) ++fails[d];
Expand Down

0 comments on commit 1029d62

Please sign in to comment.