From 4d0dc29ce5dd994a2447e4cc7752cda9e01192ec Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Thu, 31 Oct 2024 15:41:28 +0100 Subject: [PATCH] Refactor out overlay type (#180) --- src/overlays/avg_parallelism_overlay.ts | 4 ++-- src/overlays/depth_overlay.ts | 4 ++-- src/overlays/diff_overlay.ts | 4 ++-- src/overlays/generic_sdfg_overlay.ts | 8 +------- src/overlays/logical_group_overlay.ts | 4 ++-- src/overlays/memory_location_overlay.ts | 4 ++-- src/overlays/memory_volume_overlay.ts | 4 ++-- src/overlays/operational_intensity_overlay.ts | 4 ++-- src/overlays/runtime_micro_seconds_overlay.ts | 2 +- src/overlays/simulated_operational_intensity_overlay.ts | 4 ++-- src/overlays/static_flops_overlay.ts | 4 ++-- src/types.ts | 6 ++++++ 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/overlays/avg_parallelism_overlay.ts b/src/overlays/avg_parallelism_overlay.ts index b25371a..f955ffd 100644 --- a/src/overlays/avg_parallelism_overlay.ts +++ b/src/overlays/avg_parallelism_overlay.ts @@ -14,10 +14,10 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class AvgParallelismOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/depth_overlay.ts b/src/overlays/depth_overlay.ts index 43b9a0c..c4c43bc 100644 --- a/src/overlays/depth_overlay.ts +++ b/src/overlays/depth_overlay.ts @@ -14,10 +14,10 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class DepthOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/diff_overlay.ts b/src/overlays/diff_overlay.ts index 4fe3b25..913a54a 100644 --- a/src/overlays/diff_overlay.ts +++ b/src/overlays/diff_overlay.ts @@ -12,8 +12,8 @@ import { ControlFlowBlock, } from '../renderer/renderer_elements'; import { DiffMap } from '../sdfg_diff_viewer'; -import { Point2D } from '../types'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { OverlayType, Point2D } from '../types'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class DiffOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/generic_sdfg_overlay.ts b/src/overlays/generic_sdfg_overlay.ts index 25c7eca..581b675 100644 --- a/src/overlays/generic_sdfg_overlay.ts +++ b/src/overlays/generic_sdfg_overlay.ts @@ -19,16 +19,10 @@ import { SDFGNode, State, } from '../renderer/renderer_elements'; -import { Point2D, SimpleRect } from '../types'; +import { Point2D, SimpleRect, OverlayType } from '../types'; declare const vscode: any; -export enum OverlayType { - NODE, - EDGE, - BOTH, -} - export class GenericSdfgOverlay { public static readonly type: OverlayType = OverlayType.BOTH; diff --git a/src/overlays/logical_group_overlay.ts b/src/overlays/logical_group_overlay.ts index 0da209d..3fe3fe6 100644 --- a/src/overlays/logical_group_overlay.ts +++ b/src/overlays/logical_group_overlay.ts @@ -12,8 +12,8 @@ import { ControlFlowBlock, Edge, } from '../renderer/renderer_elements'; -import { Point2D } from '../types'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { OverlayType, Point2D } from '../types'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export type LogicalGroup = { name: string, diff --git a/src/overlays/memory_location_overlay.ts b/src/overlays/memory_location_overlay.ts index cdf4825..415ca3f 100644 --- a/src/overlays/memory_location_overlay.ts +++ b/src/overlays/memory_location_overlay.ts @@ -10,9 +10,9 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D } from '../types'; +import { OverlayType, Point2D } from '../types'; import { KELLY_COLORS } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; // Available data storage types in the SDFG. export enum StorageType { diff --git a/src/overlays/memory_volume_overlay.ts b/src/overlays/memory_volume_overlay.ts index 8c94a61..388f505 100644 --- a/src/overlays/memory_volume_overlay.ts +++ b/src/overlays/memory_volume_overlay.ts @@ -15,9 +15,9 @@ import { SDFGElement, State, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class MemoryVolumeOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/operational_intensity_overlay.ts b/src/overlays/operational_intensity_overlay.ts index daf37fd..ede3036 100644 --- a/src/overlays/operational_intensity_overlay.ts +++ b/src/overlays/operational_intensity_overlay.ts @@ -14,10 +14,10 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class OperationalIntensityOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/runtime_micro_seconds_overlay.ts b/src/overlays/runtime_micro_seconds_overlay.ts index 93245e1..31aca7f 100644 --- a/src/overlays/runtime_micro_seconds_overlay.ts +++ b/src/overlays/runtime_micro_seconds_overlay.ts @@ -10,9 +10,9 @@ import { getTempColorHslString } from '../utils/utils'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { GenericSdfgOverlay, - OverlayType, RuntimeReportOverlay, } from './generic_sdfg_overlay'; +import { OverlayType } from '../types'; export class RuntimeMicroSecondsOverlay extends RuntimeReportOverlay { diff --git a/src/overlays/simulated_operational_intensity_overlay.ts b/src/overlays/simulated_operational_intensity_overlay.ts index 407d8a2..af75d7b 100644 --- a/src/overlays/simulated_operational_intensity_overlay.ts +++ b/src/overlays/simulated_operational_intensity_overlay.ts @@ -14,10 +14,10 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class SimulatedOperationalIntensityOverlay extends GenericSdfgOverlay { diff --git a/src/overlays/static_flops_overlay.ts b/src/overlays/static_flops_overlay.ts index 8adaa2a..2cbb365 100644 --- a/src/overlays/static_flops_overlay.ts +++ b/src/overlays/static_flops_overlay.ts @@ -14,10 +14,10 @@ import { SDFGElement, SDFGNode, } from '../renderer/renderer_elements'; -import { Point2D, SymbolMap } from '../types'; +import { OverlayType, Point2D, SymbolMap } from '../types'; import { getGraphElementUUID } from '../utils/sdfg/sdfg_utils'; import { getTempColorHslString } from '../utils/utils'; -import { GenericSdfgOverlay, OverlayType } from './generic_sdfg_overlay'; +import { GenericSdfgOverlay } from './generic_sdfg_overlay'; export class StaticFlopsOverlay extends GenericSdfgOverlay { diff --git a/src/types.ts b/src/types.ts index 7ea1b24..3aa63c1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,6 +4,12 @@ export type SymbolMap = { [symbol: string]: number | undefined, }; +export enum OverlayType { + NODE, + EDGE, + BOTH, +}; + export type InvalidSDFGError = { message: string | undefined, sdfg_id: number | undefined,