@@ -115,8 +115,8 @@ ParseResult ParseRpcMessage(butil::IOBuf* source, Socket* socket,
115115
116116#if BRPC_WITH_GDR
117117 void * prefetch_d2h_data = NULL ;
118- uint64_t data_meta = source->get_first_data_meta ();
119- bool is_gpu_memory = (data_meta > 0 && data_meta <= UINT_MAX );
118+ uint32_t data_meta = source->get_first_data_meta_high32 ();
119+ bool is_gpu_memory = (data_meta == static_cast < uint32_t >(butil::IOBuf::GPU_MEMORY) );
120120 butil::gdr::BlockPoolAllocator* host_allocator = butil::gdr::BlockPoolAllocators::singleton ()->get_cpu_allocator ();
121121 if (is_gpu_memory) {
122122 prefetch_d2h_data = host_allocator->AllocateRaw (prefetch_d2h_size);
@@ -859,8 +859,8 @@ void ProcessRpcRequest(InputMessageBase* msg_base) {
859859 int body_without_attachment_size = req_size - meta.attachment_size ();
860860#if BRPC_WITH_GDR
861861 int meta_size = msg->meta .size ();
862- uint64_t data_meta = msg->payload .get_first_data_meta ();
863- bool is_gpu_memory = (data_meta > 0 && data_meta <= UINT_MAX );
862+ uint32_t data_meta = msg->payload .get_first_data_meta_high32 ();
863+ bool is_gpu_memory = (data_meta == static_cast < uint32_t >(butil::IOBuf::GPU_MEMORY) );
864864 if (is_gpu_memory) {
865865 int64_t real_prefetch_d2h_size = msg->meta .get_first_data_meta ();
866866 if (header_size + meta_size + body_without_attachment_size <= real_prefetch_d2h_size) {
@@ -1054,8 +1054,8 @@ void ProcessRpcResponse(InputMessageBase* msg_base) {
10541054 butil::IOBuf* res_buf_ptr = &msg->payload ;
10551055
10561056#if BRPC_WITH_GDR
1057- uint64_t data_meta = msg->payload .get_first_data_meta ();
1058- bool is_gpu_memory = (data_meta > 0 && data_meta <= UINT_MAX );
1057+ uint32_t data_meta = msg->payload .get_first_data_meta_high32 ();
1058+ bool is_gpu_memory = (data_meta == static_cast < uint32_t >(butil::IOBuf::GPU_MEMORY) );
10591059#endif // BRPC_WITH_GDR
10601060 if (meta.has_attachment_size ()) {
10611061 if (meta.attachment_size () > res_size) {
0 commit comments