Skip to content

Add missing <cstdint> and <cstddef> headers. #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/StreamModels.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include <cstdint>
#include <memory>

#if defined(CUDA)
Expand Down
1 change: 1 addition & 0 deletions src/acc/ACCStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>

Expand Down
1 change: 1 addition & 0 deletions src/cuda/CUDAStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include <sstream>
Expand Down
1 change: 1 addition & 0 deletions src/hip/HIPStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include <sstream>
Expand Down
1 change: 1 addition & 0 deletions src/kokkos/KokkosStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>

Expand Down
1 change: 1 addition & 0 deletions src/legacy/HCStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include <sstream>
Expand Down
23 changes: 16 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <array>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <iostream>
Expand All @@ -28,7 +29,7 @@ size_t num_times = 100;
size_t deviceIndex = 0;
bool use_float = false;
bool output_as_csv = false;
// Default unit of memory is MegaBytes (as per STREAM)
// Default unit of memory is MegaBytes (as per STREAM)
Unit unit{Unit::Kind::MegaByte};
bool silence_errors = false;
std::string csv_separator = ",";
Expand Down Expand Up @@ -390,13 +391,21 @@ void check_solution(const size_t num_times,
// Calculate the L^infty-norm relative error
for (size_t i = 0; i < a.size(); ++i) {
T vA = a[i], vB = b[i], vC = c[i];
T eA = std::fabs(vA - goldA) / std::fabs(goldA);
T eB = std::fabs(vB - goldB) / std::fabs(goldB);
T eC = std::fabs(vC - goldC) / std::fabs(goldC);

check("a", a[i], goldA, eA, i);
check("b", b[i], goldB, eB, i);
check("c", c[i], goldC, eC, i);
if (!(vA == T(0) && goldA == T(0))) {
T eA = std::fabs(vA - goldA) / std::fabs(goldA);
check("a", a[i], goldA, eA, i);
}

if (!(vB == T(0) && goldB == T(0))) {
T eB = std::fabs(vB - goldB) / std::fabs(goldB);
check("b", b[i], goldB, eB, i);
}

if (!(vC == T(0) && goldC == T(0))) {
T eC = std::fabs(vC - goldC) / std::fabs(goldC);
check("c", c[i], goldC, eC, i);
}
}

if (failed > 0 && !silence_errors)
Expand Down
1 change: 1 addition & 0 deletions src/ocl/OCLStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <sstream>
#include <stdexcept>
Expand Down
1 change: 1 addition & 0 deletions src/omp/OMPStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>

Expand Down
1 change: 1 addition & 0 deletions src/raja/RAJAStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include "RAJA/RAJA.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/std-data/STDDataStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once
#include "dpl_shim.h"

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include "Stream.h"
Expand Down
1 change: 1 addition & 0 deletions src/std-indices/STDIndicesStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once
#include "dpl_shim.h"

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include "Stream.h"
Expand Down
1 change: 1 addition & 0 deletions src/std-ranges/STDRangesStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once
#include "dpl_shim.h"

#include <cstdint>
#include <iostream>
#include <stdexcept>
#include "Stream.h"
Expand Down
1 change: 1 addition & 0 deletions src/sycl/SYCLStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstdint>
#include <sstream>

#include "Stream.h"
Expand Down
1 change: 1 addition & 0 deletions src/sycl2020-acc/SYCLStream2020.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstddef>
#include <sstream>
#include <memory>

Expand Down
1 change: 1 addition & 0 deletions src/sycl2020-usm/SYCLStream2020.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cstddef>
#include <sstream>
#include <memory>

Expand Down
3 changes: 2 additions & 1 deletion src/tbb/TBBStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <cstddef>
#include <iostream>
#include <vector>
#include "tbb/tbb.h"
Expand Down Expand Up @@ -36,7 +37,7 @@ template <class T>
class TBBStream : public Stream<T>
{
protected:

tbb_partitioner partitioner;
tbb::blocked_range<size_t> range;
// Device side pointers
Expand Down
1 change: 1 addition & 0 deletions src/thrust/ThrustStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <cstdint>
#include <iostream>
#include <vector>
#if defined(MANAGED)
Expand Down