#include #include #include #include #include #include #include namespace migraphx { inline namespace MIGRAPHX_INLINE_NS { namespace gpu { // NOLINTNEXTLINE static const char* const scatternd_kernel = R"__migraphx__( #include #include #include #include #include namespace migraphx { extern "C" { __global__ void scatternd_kernel(void* in_indices, void* in_updates, void* output) { make_tensors()(in_indices, in_updates, output)([](auto&&... xs) { scatternd(xs..., REDUCTION); }); } } } // namespace migraphx int main() {} )__migraphx__"; operation compile_scatternd(context&, const std::vector& io_shapes, const std::string& reduction) { hip_compile_options options; auto out_s = io_shapes.back(); options.local = 1024; options.global = compute_global(io_shapes.at(1).elements(), options.local); options.inputs = io_shapes; options.output = out_s; options.kernel_name = "scatternd_kernel"; options.virtual_inputs = io_shapes; options.params += " -DREDUCTION=assign_" + reduction + "{}"; return compile_hip_code_object(scatternd_kernel, options); } } // namespace gpu } // namespace MIGRAPHX_INLINE_NS } // namespace migraphx