Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动 timeloop-mapper",
"type": "cppdbg",
"request": "launch",
// 1. 指定您的主可执行程序路径
"program": "/home/arch/.local/bin/timeloop-mapper",
// 2. 在这里填写程序的命令行参数,每个参数是一个独立的字符串
"args": [
"/home/arch/accelergy-timeloop-infrastructure/src/timeloop/workspace/tutorial_exercises/01_accelergy_timeloop_2020_ispass/timeloop/06-mapper-convlayer-eyeriss/output/parsed-processed-input.yaml"

],
"stopAtEntry": false,
// 3. 指定程序的工作目录,通常是项目根目录
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
// 4. (可选) 如果gdb不在系统路径中,可以在这里指定它的绝对路径
// "miDebuggerPath": "/usr/bin/gdb",

}
]
}
23 changes: 22 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,27 @@
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"*.h++": "cpp"
"*.h++": "cpp",
"hash_map": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"coroutine": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"forward_list": "cpp",
"source_location": "cpp",
"format": "cpp",
"future": "cpp",
"numbers": "cpp",
"queue": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"stack": "cpp",
"stdfloat": "cpp",
"text_encoding": "cpp",
"typeindex": "cpp",
"valarray": "cpp",
"variant": "cpp"
}
}
28 changes: 28 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ 生成活动文件",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
}
],
"version": "2.0.0"
}
22 changes: 22 additions & 0 deletions include/loop-analysis/nest-analysis-tile-info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ struct DataMovementInfo
void Reset();

void Validate();

friend std::ostream& operator << (std::ostream& out, const DataMovementInfo& info)
{
out << "DataMovementInfo: size=" << info.size
<< ", total_child_accesses=" << info.total_child_accesses
<< ", link_transfers=" << info.link_transfers
<< ", replication_factor=" << info.replication_factor
<< ", fanout=" << info.fanout
<< ", is_on_storage_boundary=" << std::boolalpha << info.is_on_storage_boundary
<< ", is_master_spatial=" << std::boolalpha << info.is_master_spatial
<< ", rmw_first_update=" << std::boolalpha << info.rmw_first_update
<< ", no_coalesce=" << std::boolalpha << info.no_coalesce;
return out;
}
};

struct ComputeInfo
Expand All @@ -155,6 +169,14 @@ struct ComputeInfo
ComputeInfo();

void Reset();

friend std::ostream& operator << (std::ostream& out, const ComputeInfo& info)
{
out << "ComputeInfo: replication_factor=" << info.replication_factor
<< ", accesses=" << info.accesses
<< ", max_temporal_iterations=" << info.max_temporal_iterations;
return out;
}
};

// compound tile info types to capture per-dataspace info
Expand Down
8 changes: 7 additions & 1 deletion include/loop-analysis/nest-analysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ class NestAnalysis
std::vector<analysis::LoopState>::reverse_iterator cur,
const std::unordered_map<std::uint64_t, problem::OperationSpace>& spatial_deltas,
problem::PerDataSpace<std::unordered_set<std::uint64_t>>& unaccounted_delta,
problem::PerDataSpace<AccessStatMatrix>& access_stats);
problem::PerDataSpace<AccessStatMatrix>& access_stats,
bool enable_debug_print = false
);

void ComputeNetworkLinkTransfers(
std::vector<analysis::LoopState>::reverse_iterator cur,
Expand All @@ -208,6 +210,10 @@ class NestAnalysis
void ComputeDataDensity();
void PrintSpaceTimeStamp();

void LogStrategyDecision(int level, unsigned pvi,
std::uint64_t accesses_without_links,
std::uint64_t accesses_with_links);

public:
// API
NestAnalysis();
Expand Down
12 changes: 6 additions & 6 deletions include/workload/util/per-data-space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ class PerDataSpace : public DynamicArray<T>

friend std::ostream& operator << (std::ostream& out, const PerDataSpace<T>& x)
{
// for (unsigned pvi = 0; pvi < GetShape()->NumDataSpaces; pvi++)
// {
// out << std::setw(10) << GetShape()->DataSpaceIDToName.at(pvi) << ": " << x[pvi] << std::endl;
// }
for (unsigned pvi = 0; pvi < x.size(); pvi++)
// 使用这个信息更丰富的版本
for (unsigned pvi = 0; pvi < problem::GetShape()->NumDataSpaces; pvi++)
{
out << pvi << ": " << x[pvi] << std::endl;
out << std::setw(12) << std::left << problem::GetShape()->DataSpaceIDToName.at(pvi) + ":" << x[pvi];
if (pvi < problem::GetShape()->NumDataSpaces - 1) {
out << std::endl;
}
}
return out;
}
Expand Down
1 change: 1 addition & 0 deletions src/applications/mapper/mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ Mapper::Mapper(config::CompoundConfig* config,

// layout modeling
std::cout << "Start Parsering Layout" << std::endl;
std::cout<< "Hello timeloop in mapper !" << std::endl;
config::CompoundConfigNode compound_config_node_layout;
bool existing_layout = rootNode.lookup("layout", compound_config_node_layout);
if (existing_layout){
Expand Down
4 changes: 2 additions & 2 deletions src/applications/model/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <iostream>
#include <csignal>
#include <cstring>

// #include <dbg.h>
#include "applications/model/model.hpp"
#include "compound-config/compound-config.hpp"
#include "util/args.hpp"
Expand Down Expand Up @@ -65,7 +65,7 @@ int main(int argc, char* argv[])
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGINT, &action, NULL);

// dbg("dbg-macro is fuctioning correctly");
std::vector<std::string> input_files;
std::string output_dir = ".";
bool success = ParseArgs(argc, argv, input_files, output_dir);
Expand Down
1 change: 1 addition & 0 deletions src/applications/model/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Model::Model(config::CompoundConfig* config,

// layout modeling
std::cout << "Start Parsering Layout" << std::endl;
std::cout<< "Hello timeloop in model !" << std::endl;
config::CompoundConfigNode compound_config_node_layout;
bool existing_layout = rootNode.lookup("layout", compound_config_node_layout);

Expand Down
Loading