Skip to content

Commit

Permalink
Refactor out overlay type (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad authored Oct 31, 2024
1 parent a92dc6d commit 4d0dc29
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/overlays/avg_parallelism_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions src/overlays/depth_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions src/overlays/diff_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
8 changes: 1 addition & 7 deletions src/overlays/generic_sdfg_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/logical_group_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/memory_location_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/memory_volume_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions src/overlays/operational_intensity_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion src/overlays/runtime_micro_seconds_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/simulated_operational_intensity_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions src/overlays/static_flops_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4d0dc29

Please sign in to comment.