Open attila-dusnoki-htec opened 1 year ago
We get the following errors when compiling kernel for int32 mod:
/tmp/comgr-483e18/input/main.cpp:13:83: error: cannot convert between vector values of different size ('safe_vec<type, size>' (aka 'vec<conditional_t<is_same<double, bool>{}, uint8_t, double>, 2U>') and 'int __attribute__((ext_vector_type(2)))' (vector of 2 'int' values))
auto z2 = migraphx::convert<int32_t>(migraphx::fmod((migraphx::remainder(x0, x1)) + x1, x1));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
/tmp/comgr-483e18/input/main.cpp:24:53: note: in instantiation of function template specialization 'migraphx::inner_pointwise<int __attribute__((ext_vector_type(2))), int __attribute__((ext_vector_type(2)))>' requested here
pointwise(idx, vectorize<2, 0>())(MIGRAPHX_LIFT(inner_pointwise), private_p0,private_p1,private_p2);
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:66: note: while substituting deduced template arguments into function template 'operator()' [with private_lifts_xs:auto = <int & __attribute__((ext_vector_type(2))), int & __attribute__((ext_vector_type(2)))>]
[&](auto i) { out[i] = implicit_conversion(f(xs[i]...)); });
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:64: note: in instantiation of function template specialization 'migraphx::pointwise_tensor(index, (lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>)::(anonymous class)::operator()<unsigned int>' requested here
static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: note: while substituting deduced template arguments into function template 'invoke_loop' [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
invoke_loop(f, start, _c<0>);
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
for_stride<false>(global, n, nglobal(), f);
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
idx.global_stride(out.get_shape().elements(),
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:66: error: no matching function for call to object of type '(lambda at /tmp/comgr-483e18/input/main.cpp:24:39)'
[&](auto i) { out[i] = implicit_conversion(f(xs[i]...)); });
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:64: note: in instantiation of function template specialization 'migraphx::pointwise_tensor(index, (lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>)::(anonymous class)::operator()<unsigned int>' requested here
static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: note: while substituting deduced template arguments into function template 'invoke_loop' [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
invoke_loop(f, start, _c<0>);
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
for_stride<false>(global, n, nglobal(), f);
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
idx.global_stride(out.get_shape().elements(),
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
^
/tmp/comgr-483e18/input/main.cpp:24:39: note: candidate template ignored: substitution failure [with private_lifts_xs:auto = <int & __attribute__((ext_vector_type(2))), int & __attribute__((ext_vector_type(2)))>]
pointwise(idx, vectorize<2, 0>())(MIGRAPHX_LIFT(inner_pointwise), private_p0,private_p1,private_p2);
^
/tmp/comgr-483e18/include/migraphx/kernels/functional.hpp:35:5: note: expanded from macro 'MIGRAPHX_LIFT'
[](auto&&... private_lifts_xs) MIGRAPHX_RETURNS( \
^
In file included from /tmp/comgr-483e18/input/main.cpp:2:
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: error: no matching function for call to 'invoke_loop'
invoke_loop(f, start, _c<0>);
^~~~~~~~~~~
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
for_stride<false>(global, n, nglobal(), f);
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
idx.global_stride(out.get_shape().elements(),
^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:154:27: note: candidate template ignored: substitution failure [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]: no matching function for call to object of type '(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23)'
static constexpr auto invoke_loop(F f, I i, D d) -> decltype(f(i, d))
^ ~
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:27: note: candidate template ignored: substitution failure [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
^
3 errors generated when compiling for gfx90a.
terminate called after throwing an instance of 'migraphx::version_2_7_0::exception'
what(): /code/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:170: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed.
Aborted (core dumped)
The issue seems like that the conversion between safe_vec<type::douable, size> and vector of 2 'int32' values does not exist.
Tracking issue: https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/issues/2268
Failing tests: