Skip to content

Commit ec378e4

Browse files
committed
clean up old Append and rename new AppendStruct
1 parent a8923b5 commit ec378e4

1 file changed

Lines changed: 4 additions & 91 deletions

File tree

src/core/device/swap_gpu.cc

Lines changed: 4 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -904,25 +904,12 @@ void SwapGPU::AppendAfterMalloc(Block* block_ptr,void* data_ptr,int size){
904904
*/
905905

906906
//append info
907-
stringstream strm1;
908-
strm1<<size;
909-
string temp_str1 = strm1.str();
910-
stringstream strm3;
911-
strm3<<block_ptr;
912-
string temp_str3 = strm3.str();
913-
stringstream strm4;
914-
auto t2 = (std::chrono::system_clock::now()).time_since_epoch().count();
915-
strm4<<t2;
916-
string temp_str4 = strm4.str();
917-
string block_info ="Malloc "+temp_str3+" "+temp_str1+" "+temp_str4;
918-
// Append(block_info);
919-
920-
921-
//add to AppendStruct
922-
DeviceOptInfoToAppend dev_opt_info("Malloc", temp_str3,size);
907+
stringstream strm;
908+
strm<<block_ptr;
909+
string temp_str = strm.str();
910+
DeviceOptInfoToAppend dev_opt_info("Malloc", temp_str,size);
923911
auto t = (std::chrono::system_clock::now()).time_since_epoch().count();
924912
dev_opt_info.t = t;
925-
dev_opt_info.size = size;
926913
AppendStruct(dev_opt_info);
927914

928915
}
@@ -1067,80 +1054,6 @@ void SwapGPU::AppendStruct(DeviceOptInfoToAppend dev_opt_info){
10671054

10681055

10691056

1070-
// void SwapGPU::Append(string block_info){
1071-
/*
1072-
Append Operation block info after each operation
1073-
Meantime execute following operations:
1074-
insert size for non-malloc operations
1075-
update global memory load
1076-
control swap flag on and off
1077-
update table_meta and table_sched
1078-
deploy swap at every index.
1079-
test moved from start of malloc/free to end of append, only global_index+1 changed
1080-
call PoolOpt to Construct Pool
1081-
*/
1082-
1083-
// vector<string> v = SplitOptString(block_info, " ");
1084-
// void* temp_ptr;
1085-
// stringstream convert(v[1]);
1086-
// convert>>temp_ptr;
1087-
// auto block_ptr = static_cast<Block*>(temp_ptr);
1088-
1089-
// // insert size, malloc : flag, block_, size, t; others: insert size t.
1090-
// if (v.size() != 4) {
1091-
// stringstream strm1;
1092-
// strm1<<block_ptr->size();
1093-
// string temp_str1 = strm1.str();
1094-
// block_info = v[0] + ' ' + v[1] + ' ' + temp_str1 + ' ' + v[2];
1095-
// }
1096-
1097-
// // update global load
1098-
// if (iteration_length < iteration_length_threshold){
1099-
// if (v[0] == "Malloc"){
1100-
// if (global_load.size()>0){
1101-
// global_load.push_back(global_load[global_load.size()-1]+block_ptr->size());
1102-
// } else {
1103-
// global_load.push_back(block_ptr->size());
1104-
// }
1105-
// } else if (v[0] == "Free"){
1106-
// global_load.push_back(global_load[global_load.size()-1]-block_ptr->size());
1107-
// } else {
1108-
// global_load.push_back(global_load[global_load.size()-1]);
1109-
// }
1110-
// }
1111-
1112-
// //append into vec_block
1113-
// vec_block.push_back(block_info);
1114-
// cout<<"0 "<<block_info<<endl;
1115-
1116-
// //change swap flag on and off
1117-
// if (async_swap_flag == 1){
1118-
// int r_global_index = (global_index-location_of_2nd_iteration)%iteration_length;
1119-
// if (block_ptr->size() != size_sequence[r_global_index]){
1120-
// async_swap_flag = 0;
1121-
// cout<<"!!!! async_swap_flag changed back to 0"<<endl;
1122-
// }
1123-
// }
1124-
1125-
// //update table_meta and table_sched
1126-
// UpdateMetaTables(block_ptr);
1127-
1128-
// //deploy swap at every index.
1129-
// DeploySwap();
1130-
1131-
// //test moved from start of malloc/free to end of append, only global_index+1 changed
1132-
// DetectionPlan();
1133-
1134-
// //NOTE: this global_index includes read/write and AppendLayer as well, in addition to malloc/free.
1135-
// global_index++;
1136-
1137-
// //call PoolOpt to Construct Pool
1138-
// if ((async_swap_flag == 1) && ((global_index - 4 * iteration_length) == three_more_iteration_global_index_threshold)){
1139-
// pool_->PoolOpt(vec_block_mf);
1140-
// }
1141-
1142-
// }
1143-
11441057
void* SwapGPU::UpdateGpuPtr(const Block* block_ptr){
11451058
/*
11461059
in case that block is not at device memory, swapIn ad hoc.

0 commit comments

Comments
 (0)