mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[BugFix] replace ftok with custom_ftok in get_output/save_output ops (#6822)
* [BugFix] replace ftok with custom_ftok in get_output/save_output ops * [Test] add unit test for custom_ftok * [Chore] create custom_ftok.h * [Chore] reorganize header file * [Fix] fix cache messager msg_queue_id+rank_id conflict
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "save_with_output_msg.h"
|
||||
#include "custom_ftok.h"
|
||||
|
||||
void save_kernel(const paddle::Tensor& x,
|
||||
const paddle::Tensor& not_need_stop,
|
||||
@@ -68,7 +69,7 @@ void save_kernel(const paddle::Tensor& x,
|
||||
#ifdef SAVE_WITH_OUTPUT_DEBUG
|
||||
std::cout << "msg_queue_id is: " << msg_queue_id << std::endl;
|
||||
#endif
|
||||
static key_t key = ftok("/dev/shm", msg_queue_id);
|
||||
static key_t key = custom_ftok("/dev/shm", msg_queue_id);
|
||||
|
||||
static int msgid = msgget(key, IPC_CREAT | 0666);
|
||||
#ifdef SAVE_WITH_OUTPUT_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user