mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-24 14:54:47 +00:00
Merge commit 'ad57f6ef0bcaeef7988bfd3954aac06554f12afb' into develop
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <sstream>
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
namespace ck {
|
||||
|
||||
// To be removed, which really does not tell the location of failed HIP functional call
|
||||
inline void hip_check_error(hipError_t x)
|
||||
{
|
||||
@@ -30,3 +32,5 @@ inline void hip_check_error(hipError_t x)
|
||||
throw std::runtime_error(ostr.str()); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
} // namespace ck
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#include "ck/tensor_description/tensor_descriptor.hpp"
|
||||
|
||||
namespace ck {
|
||||
|
||||
template <typename T>
|
||||
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v)
|
||||
{
|
||||
@@ -25,17 +27,19 @@ std::ostream& operator<<(std::ostream& os, const std::array<T, N>& v)
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
std::ostream& operator<<(std::ostream& os, const ck::TensorDescriptor<Ts...>& desc)
|
||||
std::ostream& operator<<(std::ostream& os, const TensorDescriptor<Ts...>& desc)
|
||||
{
|
||||
constexpr ck::index_t nDim = ck::remove_cvref_t<decltype(desc)>::GetNumOfDimension();
|
||||
constexpr index_t nDim = remove_cvref_t<decltype(desc)>::GetNumOfDimension();
|
||||
|
||||
os << "{";
|
||||
|
||||
ck::static_for<0, nDim - 1, 1>{}([&](auto i) { os << desc.GetLength(i) << ", "; });
|
||||
static_for<0, nDim - 1, 1>{}([&](auto i) { os << desc.GetLength(i) << ", "; });
|
||||
|
||||
os << desc.GetLength(ck::Number<nDim - 1>{});
|
||||
os << desc.GetLength(Number<nDim - 1>{});
|
||||
|
||||
os << "}";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ck
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "ck/stream_config.hpp"
|
||||
#include "ck/host_utility/hip_check_error.hpp"
|
||||
|
||||
namespace ck {
|
||||
|
||||
template <typename... Args, typename F>
|
||||
float launch_and_time_kernel(const StreamConfig& stream_config,
|
||||
F kernel,
|
||||
@@ -167,4 +169,7 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace ck
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "ck/stream_config.hpp"
|
||||
#include "ck/host_utility/hip_check_error.hpp"
|
||||
|
||||
namespace ck {
|
||||
|
||||
static inline int getAvailableComputeUnitCount(const StreamConfig& stream_config)
|
||||
{
|
||||
constexpr int MAX_MASK_DWORDS = 64;
|
||||
@@ -41,3 +43,5 @@ static inline int getAvailableComputeUnitCount(const StreamConfig& stream_config
|
||||
|
||||
return (ret);
|
||||
};
|
||||
|
||||
} // namespace ck
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
namespace ck {
|
||||
|
||||
template <typename T>
|
||||
__global__ void set_buffer_value(T* p, T x, uint64_t buffer_element_size)
|
||||
{
|
||||
@@ -48,3 +50,5 @@ void DeviceMem::SetValue(T x) const
|
||||
|
||||
set_buffer_value<T><<<1, 1024>>>(static_cast<T*>(mpDeviceBuf), x, mMemSize / sizeof(T));
|
||||
}
|
||||
|
||||
} // namespace ck
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "ck/tensor_operation/gpu/device/tensor_layout.hpp"
|
||||
|
||||
namespace ck {
|
||||
|
||||
template <typename Range>
|
||||
std::ostream& LogRange(std::ostream& os, Range&& range, std::string delim)
|
||||
{
|
||||
@@ -1159,3 +1161,5 @@ struct Tensor
|
||||
Descriptor mDesc;
|
||||
Data mData;
|
||||
};
|
||||
|
||||
} // namespace ck
|
||||
|
||||
Reference in New Issue
Block a user