Skip to content

Commit

Permalink
[GPU] Insert scratchpad memory in concat when it's null
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-y committed Feb 2, 2025
1 parent ce69c62 commit 2c25496
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ struct concatenation_onednn : typed_primitive_onednn_impl<concatenation, dnnl::c
std::unordered_map<int, dnnl::memory> get_arguments(concatenation_inst& instance) const override {
std::unordered_map<int, dnnl::memory> args;

if (_scratchpad_md.get_size() != 0) {
// onednn primitive can have only 1 scratchpad memory.
auto scratchpad = instance.get_intermediates_memories()[0];
args.insert({DNNL_ARG_SCRATCHPAD, scratchpad->get_onednn_memory(_scratchpad_md, 0)});
}

int input_idx = DNNL_ARG_MULTIPLE_SRC;
for (size_t i = 0; i < instance.inputs_memory_count(); i++) {
auto& input = instance.input_memory(i);
Expand Down

0 comments on commit 2c25496

Please sign in to comment.