"vscode:/vscode.git/clone" did not exist on "707341aebe301795d10159e9f2a04e2aba255e13"
Commit 4643f0e6 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Intialize random values in range

parent 0d5a0bc9
...@@ -18,11 +18,8 @@ bool run_permute_bundle(const Problem& problem) ...@@ -18,11 +18,8 @@ bool run_permute_bundle(const Problem& problem)
// initialize tensor by assigning DataType values // initialize tensor by assigning DataType values
using std::data, std::size; using std::data, std::size;
{ ck::utils::FillUniformDistribution<DataType>{-1.f, 1.f}(ck::span<DataType>{
auto* const elems = reinterpret_cast<DataType*>(data(a)); reinterpret_cast<DataType*>(data(a)), a.GetElementSpaceSize() * NumElemsInBundle});
ck::utils::FillUniformDistribution<DataType>{-1.f, 1.f}(
elems, elems + (a.GetElementSpaceSize() * NumElemsInBundle));
}
DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes()); DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes());
DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes()); DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes());
......
...@@ -14,7 +14,7 @@ bool run_permute_element(const Problem& problem) ...@@ -14,7 +14,7 @@ bool run_permute_element(const Problem& problem)
Tensor<ADataType> a(shape); Tensor<ADataType> a(shape);
Tensor<BDataType> b(transposed_shape); Tensor<BDataType> b(transposed_shape);
ck::utils::FillUniformDistribution<ADataType>{-1.f, 1.f}(begin(a), end(a)); ck::utils::FillUniformDistribution<ADataType>{-1.f, 1.f}(a);
DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes()); DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes());
DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes()); DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes());
......
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