Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,482 changes: 382 additions & 7,100 deletions package-lock.json

Large diffs are not rendered by default.

97 changes: 64 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
},
{
"id": "ToolchainView",
"name": "Toolchain"
"name": "Compiler"
},
{
"id": "TargetDeviceView",
"name": "Target Devices"
"id": "ExecutorView",
"name": "Executor"
}
]
},
Expand Down Expand Up @@ -167,15 +167,15 @@
},
{
"command": "one.explorer.runCfg",
"title": "Run with the toolchain (Ctrl+F7)",
"title": "Run with the compiler (Ctrl+F7)",
"category": "ONE",
"icon": "$(play)"
"icon": "$(debug-coverage)"
},
{
"command": "one.explorer.inferModel",
"title": "Infer model with the executor",
"category": "ONE",
"icon": "$(play)"
"icon": "$(debug-start)"
},
{
"command": "one.explorer.profileModel",
Expand Down Expand Up @@ -225,46 +225,58 @@
"category": "ONE"
},
{
"command": "one.toolchain.refresh",
"title": "Toolchain Refresh",
"command": "one.compiler.refresh",
"title": "Refresh Compiler",
"category": "ONE",
"icon": "$(refresh)"
},
{
"command": "one.toolchain.install",
"title": "Toolchain Install",
"command": "one.compiler.install",
"title": "Install Compiler",
"category": "ONE",
"icon": "$(add)",
"enablement": "!one.job:running"
},
{
"command": "one.toolchain.uninstall",
"title": "Toolchain Uninstall",
"command": "one.compiler.uninstall",
"title": "Uninstall Compiler",
"category": "ONE",
"icon": "$(x)"
},
{
"command": "one.toolchain.setDefaultToolchain",
"title": "Set Default Toolchain",
"command": "one.compiler.setDefaultCompiler",
"title": "Set Default Compiler",
"category": "ONE",
"icon": "$(check)"
},
{
"command": "one.toolchain.runCfg",
"title": "Run"
"command": "one.compiler.runCfg",
"title": "Compile"
},
{
"command": "one.toolchain.inferModel",
"command": "one.executor.inferModel",
"title": "Infer"
},
{
"command": "one.toolchain.profileModel",
"command": "one.executor.profileModel",
"title": "Profile"
},
{
"command": "one.toolchain.getModelInfo",
"command": "one.executor.getModelInfo",
"title": "Get Model Info"
},
{
"command": "one.executor.refresh",
"title": "Refresh all executors",
"category": "ONE",
"icon": "$(refresh)"
},
{
"command": "one.executor.setDefaultExecutor",
"title": "Set Default Executor",
"category": "ONE",
"icon": "$(check)"
},
{
"command": "one.device.refresh",
"title": "Refresh all devices",
Expand Down Expand Up @@ -337,15 +349,20 @@
"group": "navigation@1"
},
{
"command": "one.toolchain.refresh",
"command": "one.compiler.refresh",
"when": "view == ToolchainView",
"group": "navigation"
},
{
"command": "one.toolchain.install",
"command": "one.compiler.install",
"when": "view == ToolchainView && !one.job:running",
"group": "navigation"
},
{
"command": "one.executor.refresh",
"when": "view == ExecutorView",
"group": "navigation"
},
{
"command": "one.device.refresh",
"when": "view == TargetDeviceView",
Expand Down Expand Up @@ -409,13 +426,18 @@
"group": "inline"
},
{
"command": "one.toolchain.setDefaultToolchain",
"when": "view == ToolchainView && viewItem == toolchain && !one.job:running",
"command": "one.compiler.setDefaultCompiler",
"when": "view == ToolchainView && viewItem =~ /compiler/ && !(viewItem =~ /name/ || viewItem =~ /default/) && !one.job:running",
"group": "inline"
},
{
"command": "one.toolchain.uninstall",
"when": "view == ToolchainView && viewItem =~ /toolchain/ && !one.job:running",
"command": "one.executor.setDefaultExecutor",
"when": "view == ExecutorView && viewItem =~ /executor/ && !(viewItem =~ /name/ || viewItem =~ /default/) && !one.job:running",
"group": "inline"
},
{
"command": "one.compiler.uninstall",
"when": "view == ToolchainView && viewItem =~ /compiler/ && !one.job:running",
"group": "inline"
},
{
Expand Down Expand Up @@ -462,7 +484,11 @@
"when": "false"
},
{
"command": "one.toolchain.setDefaultToolchain",
"command": "one.compiler.setDefaultCompiler",
"when": "false"
},
{
"command": "one.executor.setDefaultExecutor",
"when": "false"
},
{
Expand Down Expand Up @@ -498,31 +524,35 @@
"when": "false"
},
{
"command": "one.toolchain.install",
"command": "one.compiler.install",
"when": "true"
},
{
"command": "one.toolchain.uninstall",
"command": "one.compiler.uninstall",
"when": "false"
},
{
"command": "one.compiler.refresh",
"when": "false"
},
{
"command": "one.toolchain.refresh",
"command": "one.compiler.runCfg",
"when": "false"
},
{
"command": "one.toolchain.runCfg",
"command": "one.executor.inferModel",
"when": "false"
},
{
"command": "one.toolchain.inferModel",
"command": "one.executor.profileModel",
"when": "false"
},
{
"command": "one.toolchain.profileModel",
"command": "one.executor.getModelInfo",
"when": "false"
},
{
"command": "one.toolchain.getModelInfo",
"command": "one.executor.refresh",
"when": "false"
},
{
Expand Down Expand Up @@ -616,6 +646,7 @@
"configparser": "^0.3.9",
"flatbuffers": "2.0.7",
"ini": "^2.0.0",
"jq": "^1.7.2",
"which": "^2.0.2"
}
}
4 changes: 2 additions & 2 deletions src/Backend/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const registerBackend = (backend: Backend) => {
// NOTE: This might not 100% guaratee the activating extension has been done.
// - link: https://github.com/Samsung/ONE-vscode/pull/1101#issuecomment-1195099002
// TODO: Consider better way to refresh toolchainView after backend's registration.
vscode.commands.executeCommand("one.toolchain.refresh");
vscode.commands.executeCommand("one.device.refresh");
vscode.commands.executeCommand("one.compiler.refresh");
vscode.commands.executeCommand("one.executor.refresh");
};

export const API = {
Expand Down
11 changes: 11 additions & 0 deletions src/Backend/One/OneToolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class OneDebianToolchain extends DebianToolchain {
const value = configs.get("one.toolchain.githubToken", "");
if (!value) {
Balloon.showGithubTokenErrorMessage();
throw new Error("Github token is not set.");
}

let cmd = new Command("onecc-docker");
Expand All @@ -48,6 +49,16 @@ class OneDebianToolchain extends DebianToolchain {
cmd.push(cfg);
return cmd;
}

runInference(_model: string, _options?: Map<string, string>): Command {
throw new Error("Method not implemented.");
}
runProfile(_model: string, _options?: Map<string, string>): Command {
throw new Error("Method not implemented.");
}
runShow(_model: string, _option: string): Command {
throw new Error("Method not implemented.");
}
}

class OneCompiler implements Compiler {
Expand Down
56 changes: 56 additions & 0 deletions src/Compiler/CompilerNodeBuilder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as vscode from "vscode";
import { defaultCompiler } from "./DefaultCompiler";

class CompilerNode extends vscode.TreeItem {
readonly deviceName: string; // device name

constructor(
public readonly label: string,
public readonly collapsibleState: vscode.TreeItemCollapsibleState,
public readonly dname: string = ""
) {
super(label, collapsibleState);
this.deviceName = dname;
this.contextValue = "compiler";
this.iconPath = new vscode.ThemeIcon(
"tools",
new vscode.ThemeColor("debugIcon.stopForeground")
);
if (defaultCompiler.isEqual(this)) {
this.iconPath = new vscode.ThemeIcon(
"tools",
new vscode.ThemeColor("debugIcon.startForeground")
);
this.contextValue += ".default";
}
}

public compile(
_cfg: string,
_options?: Map<string, string>
): string | undefined {
throw new Error("Not implemented");
}
}

interface CompilerNodeBuilder {
buildNode(element?: CompilerNode): CompilerNode[];
}

export { CompilerNode, CompilerNodeBuilder };
Loading