Commit 6ab58fbf authored by Shucai Xiao's avatar Shucai Xiao
Browse files

changes to fix unit test errors

parent 74a96965
......@@ -46,7 +46,7 @@ void* get_device_ptr(void* hptr)
return result;
}
hip_ptr allocate_gpu(int sz, bool host = false)
hip_ptr allocate_gpu(std::size_t sz, bool host = false)
{
if(sz > get_available_gpu_memory())
MIGRAPHX_THROW("Memory not available to allocate buffer: " + std::to_string(sz));
......@@ -62,7 +62,7 @@ hip_ptr allocate_gpu(int sz, bool host = false)
return hip_ptr{result};
}
hip_host_ptr register_on_gpu(void* ptr, int sz)
hip_host_ptr register_on_gpu(void* ptr, std::size_t sz)
{
auto status = hipHostRegister(ptr, sz, hipHostRegisterMapped);
if(status != hipSuccess)
......@@ -71,7 +71,7 @@ hip_host_ptr register_on_gpu(void* ptr, int sz)
}
template <class T>
std::vector<T> read_from_gpu(const void* x, int sz)
std::vector<T> read_from_gpu(const void* x, std::size_t sz)
{
gpu_sync();
std::vector<T> result(sz);
......@@ -81,7 +81,7 @@ std::vector<T> read_from_gpu(const void* x, int sz)
return result;
}
hip_ptr write_to_gpu(const void* x, int sz, bool host = false)
hip_ptr write_to_gpu(const void* x, std::size_t sz, bool host = false)
{
gpu_sync();
auto result = allocate_gpu(sz, host);
......
......@@ -12,7 +12,7 @@ extern hipError_t hipExtModuleLaunchKernel(hipFunction_t, // NOLINT
uint32_t,
uint32_t,
uint32_t,
int,
size_t,
hipStream_t,
void**,
void**,
......
......@@ -132,7 +132,7 @@ __device__ void roialign(const T& x_t, const U& rois_t, const V& ind_t, const W&
auto channel_num = x_lens[1];
// input dims of height and width, in all 2-dim arrays, the first dim
// is for height and second dim is for width
array<int, 2> in_dims = {x_lens[2], x_lens[3]};
array<int, 2> in_dims = {static_cast<int>(x_lens[2]), static_cast<int>(x_lens[3])};
const auto stride = index.nglobal();
auto out_s = y_t.get_shape();
......@@ -141,7 +141,7 @@ __device__ void roialign(const T& x_t, const U& rois_t, const V& ind_t, const W&
// output dims of height and width, in all 2-dim arrays, the first dim
// is for height and second dim is for width
const auto& out_lens = out_s.lens;
array<int, 2> out_dims = {out_lens[2], out_lens[3]};
array<int, 2> out_dims = {static_cast<int>(out_lens[2]), static_cast<int>(out_lens[3])};
for(index_int i = index.global; i < out_s.elements(); i += stride)
{
......
......@@ -3586,7 +3586,7 @@ TEST_CASE(resize_downsample_linear_test)
EXPECT(p == prog);
}
TEST_CASE(resize_outintest)
TEST_CASE(resize_outsize_test)
{
migraphx::program p;
auto* mm = p.get_main_module();
......@@ -3608,7 +3608,7 @@ TEST_CASE(resize_outintest)
auto r = mm->add_instruction(migraphx::make_op("gather", {{"axis", 0}}), lrsp, li);
mm->add_return({r});
auto prog = migraphx::parse_onnx("resize_outintest.onnx");
auto prog = migraphx::parse_onnx("resize_outsize_test.onnx");
EXPECT(p == prog);
}
......
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