Skip to content

Commit

Permalink
review update
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Grützmacher <[email protected]>
  • Loading branch information
upsj and Thomas Grützmacher committed May 4, 2020
1 parent a51b281 commit 0aa89d6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cuda/components/precision_conversion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ namespace cuda {
namespace components {


#include "common/components/precision_conversion.hpp.inc"
constexpr int default_block_size = 512;


constexpr int default_block_size = 512;
#include "common/components/precision_conversion.hpp.inc"


template <typename SourceType, typename TargetType>
Expand Down
6 changes: 3 additions & 3 deletions cuda/test/components/precision_conversion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ protected:
}
dvals = vals;
dcvals = cvals;
gko::uint64 rawdouble = 0x4218888000889111ULL;
gko::uint32 rawfloat = 0x50c44400ULL;
gko::uint64 rawrounded = 0x4218888000000000ULL;
gko::uint64 rawdouble{0x4218888000889111ULL};
gko::uint32 rawfloat{0x50c44400UL};
gko::uint64 rawrounded{0x4218888000000000ULL};
std::memcpy(vals2.get_data(), &rawdouble, sizeof(double));
std::memcpy(expected_float.get_data(), &rawfloat, sizeof(float));
std::memcpy(expected_double.get_data(), &rawrounded, sizeof(double));
Expand Down
4 changes: 2 additions & 2 deletions hip/components/precision_conversion.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ namespace hip {
namespace components {


#include "common/components/precision_conversion.hpp.inc"
constexpr int default_block_size = 512;


constexpr int default_block_size = 512;
#include "common/components/precision_conversion.hpp.inc"


template <typename SourceType, typename TargetType>
Expand Down
6 changes: 3 additions & 3 deletions hip/test/components/precision_conversion.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class PrecisionConversion : public ::testing::Test {
}
dvals = vals;
dcvals = cvals;
gko::uint64 rawdouble = 0x4218888000889111ULL;
gko::uint32 rawfloat = 0x50c44400ULL;
gko::uint64 rawrounded = 0x4218888000000000ULL;
gko::uint64 rawdouble{0x4218888000889111ULL};
gko::uint32 rawfloat{0x50c44400UL};
gko::uint64 rawrounded{0x4218888000000000ULL};
std::memcpy(vals2.get_data(), &rawdouble, sizeof(double));
std::memcpy(expected_float.get_data(), &rawfloat, sizeof(float));
std::memcpy(expected_double.get_data(), &rawrounded, sizeof(double));
Expand Down
6 changes: 3 additions & 3 deletions omp/test/components/precision_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class PrecisionConversion : public ::testing::Test {
}
dvals = vals;
dcvals = cvals;
gko::uint64 rawdouble = 0x4218888000889111ULL;
gko::uint32 rawfloat = 0x50c44400ULL;
gko::uint64 rawrounded = 0x4218888000000000ULL;
gko::uint64 rawdouble{0x4218888000889111ULL};
gko::uint32 rawfloat{0x50c44400UL};
gko::uint64 rawrounded{0x4218888000000000ULL};
std::memcpy(vals2.get_data(), &rawdouble, sizeof(double));
std::memcpy(expected_float.get_data(), &rawfloat, sizeof(float));
std::memcpy(expected_double.get_data(), &rawrounded, sizeof(double));
Expand Down
6 changes: 3 additions & 3 deletions reference/test/components/precision_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class PrecisionConversion : public ::testing::Test {
vals.get_data()[i] = dist(rand);
cvals.get_data()[i] = {dist(rand), dist(rand)};
}
gko::uint64 rawdouble = 0x4218888000889111ULL;
gko::uint32 rawfloat = 0x50c44400ULL;
gko::uint64 rawrounded = 0x4218888000000000ULL;
gko::uint64 rawdouble{0x4218888000889111ULL};
gko::uint32 rawfloat{0x50c44400UL};
gko::uint64 rawrounded{0x4218888000000000ULL};
std::memcpy(vals2.get_data(), &rawdouble, sizeof(double));
std::memcpy(expected_float.get_data(), &rawfloat, sizeof(float));
std::memcpy(expected_double.get_data(), &rawrounded, sizeof(double));
Expand Down

0 comments on commit 0aa89d6

Please sign in to comment.