How a allocate two tempory memory in the Operator Cpp
Hi, all people , I want two tempory cpu memory in the Operator, but when I use
std::vector<ResourceRequest> BackwardResource(
const std::vector<TShape> &in_shape) const override {
return {ResourceRequest::kTempSpace,ResourceRequest::kTempSpace};
}
but when I use ctx.requested[0].get_host_space_typed and ctx.requested[0].get_host_space_typed
is seem the same memory !!!!! How I solve it !!!? Thank you !!
but when I use ctx.requested[0].get_host_space_typed and ctx.requested[1].get_host_space_typed
Based on your second post, it seems that you have found out the correct answer, right? The same Resource instance reuses the allocated memory space if the requested size is not bigger.
No,when allocating the memory , the two tempspace point to the same address!
@apache/mxnet-committers: This issue has been inactive for the past 90 days. It has no label and needs triage.
For general "how-to" questions, our user forum (and Chinese version) is a good place to get help.