Skip to content

Conversation

@souptc
Copy link
Member

@souptc souptc commented Dec 19, 2018

current kernel memory type interface can't support variadic inputs. Cheng the interface to query-based so we could have a customized default memory type.

@souptc souptc requested a review from a team as a code owner December 19, 2018 23:30
const MemTypeMap& MemoryType() const {
return output_memory_type_args_;
OrtMemType OutputMemoryType(size_t output_index) const {
auto it = output_memory_type_args_.find(output_index);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not introduced by your PR, but why we use map to store the types, instead of vector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess in most case people only declare memory type for very few input/output, map seems more suitable.


class KernelDefBuilder {
public:
explicit KernelDefBuilder(OrtMemType inputs_mem_type, OrtMemType outputs_mem_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to move this as an explicit setter method.

@souptc souptc merged commit c453b48 into master Dec 20, 2018
@souptc souptc deleted the chenta/variadic_inputs branch December 20, 2018 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants