"...git@developer.sourcefind.cn:OpenDAS/torch-harmonics.git" did not exist on "54502a1789335ab43f8c65bfbf9cd8e8d01ae5ad"
Commit a22e479b authored by Umang Yadav's avatar Umang Yadav
Browse files

Move byte to ck::byte

parent 504e97e3
...@@ -39,7 +39,7 @@ struct get_carrier<3> ...@@ -39,7 +39,7 @@ struct get_carrier<3>
{ {
using value_type = uint32_t; using value_type = uint32_t;
std::byte bytes[3]; ck::byte bytes[3];
static_assert(sizeof(bytes) <= sizeof(value_type)); static_assert(sizeof(bytes) <= sizeof(value_type));
// replacement of host std::copy_n() // replacement of host std::copy_n()
...@@ -66,14 +66,14 @@ struct get_carrier<3> ...@@ -66,14 +66,14 @@ struct get_carrier<3>
public: public:
__device__ carrier& operator=(value_type value) noexcept __device__ carrier& operator=(value_type value) noexcept
{ {
copy_n(reinterpret_cast<const std::byte*>(&value), 3, &bytes[0]); copy_n(reinterpret_cast<const ck::byte*>(&value), 3, &bytes[0]);
return *this; return *this;
} }
__device__ operator value_type() const noexcept __device__ operator value_type() const noexcept
{ {
std::byte result[sizeof(value_type)]; ck::byte result[sizeof(value_type)];
copy_n(&bytes[0], 3, result); copy_n(&bytes[0], 3, result);
...@@ -108,8 +108,8 @@ __device__ auto amd_wave_read_first_lane(const Object& obj) ...@@ -108,8 +108,8 @@ __device__ auto amd_wave_read_first_lane(const Object& obj)
constexpr Size SgprSize = 4; constexpr Size SgprSize = 4;
constexpr Size ObjectSize = sizeof(Object); constexpr Size ObjectSize = sizeof(Object);
auto* const from_obj = reinterpret_cast<const std::byte*>(&obj); auto* const from_obj = reinterpret_cast<const ck::byte*>(&obj);
alignas(Object) std::byte to_obj[ObjectSize]; alignas(Object) ck::byte to_obj[ObjectSize];
constexpr Size RemainedSize = ObjectSize % SgprSize; constexpr Size RemainedSize = ObjectSize % SgprSize;
constexpr Size CompleteSgprCopyBoundary = ObjectSize - RemainedSize; constexpr Size CompleteSgprCopyBoundary = ObjectSize - RemainedSize;
......
...@@ -14,11 +14,13 @@ using uint8_t = unsigned char; ...@@ -14,11 +14,13 @@ using uint8_t = unsigned char;
using int16_t = signed short; using int16_t = signed short;
using uint16_t = unsigned short; using uint16_t = unsigned short;
using float_t = float; using float_t = float;
namespace std {
using byte = unsigned char;
}
#endif // __HIPCC_RTC__ #endif // __HIPCC_RTC__
namespace ck { namespace ck {
#ifdef __HIPCC_RTC__
using byte = unsigned char;
#else
using std::byte;
#endif
using bhalf_t = ushort; using bhalf_t = ushort;
using half_t = _Float16; using half_t = _Float16;
...@@ -980,10 +982,13 @@ template <> ...@@ -980,10 +982,13 @@ template <>
struct NumericLimits<int32_t> struct NumericLimits<int32_t>
{ {
__host__ __device__ static constexpr int32_t Lowest() noexcept { return -2147483647 - 1; } __host__ __device__ static constexpr int32_t Lowest() noexcept { return -2147483647 - 1; }
__host__ __device__ static constexpr int32_t Min() noexcept { return -2147483647 - 1; } __host__ __device__ static constexpr int32_t Min() noexcept { return -2147483647 - 1; }
__host__ __device__ static constexpr int32_t Max() noexcept { return 2147483647; } __host__ __device__ static constexpr int32_t Max() noexcept { return 2147483647; }
__host__ __device__ static constexpr int32_t Infinity() noexcept { return 0; } __host__ __device__ static constexpr int32_t Infinity() noexcept { return 0; }
__host__ __device__ static constexpr int32_t QuietNaN() { return 0; } __host__ __device__ static constexpr int32_t QuietNaN() { return 0; }
}; };
...@@ -991,9 +996,13 @@ template <> ...@@ -991,9 +996,13 @@ template <>
struct NumericLimits<int16_t> struct NumericLimits<int16_t>
{ {
__host__ __device__ static constexpr int16_t Lowest() noexcept { return -32768; } __host__ __device__ static constexpr int16_t Lowest() noexcept { return -32768; }
__host__ __device__ static constexpr int16_t Min() noexcept { return -32768; } __host__ __device__ static constexpr int16_t Min() noexcept { return -32768; }
__host__ __device__ static constexpr int16_t Max() noexcept { return 32767; } __host__ __device__ static constexpr int16_t Max() noexcept { return 32767; }
__host__ __device__ static constexpr int16_t Infinity() noexcept { return 0; } __host__ __device__ static constexpr int16_t Infinity() noexcept { return 0; }
__host__ __device__ static constexpr int16_t QuietNaN() { return 0; } __host__ __device__ static constexpr int16_t QuietNaN() { return 0; }
}; };
...@@ -1001,9 +1010,13 @@ template <> ...@@ -1001,9 +1010,13 @@ template <>
struct NumericLimits<int8_t> struct NumericLimits<int8_t>
{ {
__host__ __device__ static constexpr int8_t Lowest() noexcept { return -128; } __host__ __device__ static constexpr int8_t Lowest() noexcept { return -128; }
__host__ __device__ static constexpr int8_t Min() noexcept { return -128; } __host__ __device__ static constexpr int8_t Min() noexcept { return -128; }
__host__ __device__ static constexpr int8_t Max() noexcept { return 127; } __host__ __device__ static constexpr int8_t Max() noexcept { return 127; }
__host__ __device__ static constexpr int8_t Infinity() noexcept { return 0; } __host__ __device__ static constexpr int8_t Infinity() noexcept { return 0; }
__host__ __device__ static constexpr int8_t QuietNaN() { return 0; } __host__ __device__ static constexpr int8_t QuietNaN() { return 0; }
}; };
...@@ -1011,9 +1024,13 @@ template <> ...@@ -1011,9 +1024,13 @@ template <>
struct NumericLimits<uint32_t> struct NumericLimits<uint32_t>
{ {
__host__ __device__ static constexpr uint32_t Lowest() noexcept { return 0; } __host__ __device__ static constexpr uint32_t Lowest() noexcept { return 0; }
__host__ __device__ static constexpr uint32_t Min() noexcept { return 0; } __host__ __device__ static constexpr uint32_t Min() noexcept { return 0; }
__host__ __device__ static constexpr uint32_t Max() noexcept { return 4294967295U; } __host__ __device__ static constexpr uint32_t Max() noexcept { return 4294967295U; }
__host__ __device__ static constexpr uint32_t Infinity() noexcept { return 0; } __host__ __device__ static constexpr uint32_t Infinity() noexcept { return 0; }
__host__ __device__ static constexpr uint32_t QuietNaN() { return 0; } __host__ __device__ static constexpr uint32_t QuietNaN() { return 0; }
}; };
...@@ -1021,9 +1038,13 @@ template <> ...@@ -1021,9 +1038,13 @@ template <>
struct NumericLimits<uint16_t> struct NumericLimits<uint16_t>
{ {
__host__ __device__ static constexpr uint16_t Lowest() noexcept { return 0; } __host__ __device__ static constexpr uint16_t Lowest() noexcept { return 0; }
__host__ __device__ static constexpr uint16_t Min() noexcept { return 0; } __host__ __device__ static constexpr uint16_t Min() noexcept { return 0; }
__host__ __device__ static constexpr uint16_t Max() noexcept { return 65535U; } __host__ __device__ static constexpr uint16_t Max() noexcept { return 65535U; }
__host__ __device__ static constexpr uint16_t Infinity() noexcept { return 0; } __host__ __device__ static constexpr uint16_t Infinity() noexcept { return 0; }
__host__ __device__ static constexpr uint16_t QuietNaN() { return 0; } __host__ __device__ static constexpr uint16_t QuietNaN() { return 0; }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment