Skip to content

Commit

Permalink
PG: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drizhina committed Oct 25, 2024
1 parent f6b546b commit 62a6b7a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/PowerGrid/src/tests/webgpu-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const consecutiveLaunches = 3;
category('webgpu', async () => {
const render = DG.Func.find({tags: ['scWebGPURender']})[0];
const hitTest = DG.Func.find({tags: ['scWebGPUPointHitTest']})[0];
// const gpuDevice = await getGPUDevice();
// if (!gpuDevice || !DG.Test.isInBenchmark)
// return;
const gpuDevice = await getGPUDevice();

types.forEach((t) => {
sizes.forEach((s) => {
test(`GPURender: ${s / 1000000.0}m ${t}s`, async () => {
if (!gpuDevice || !DG.Test.isInBenchmark)
return;
const view = grok.shell.addTableView(grok.data.demo.randomWalk(s, 2));
const sp: DG.ScatterPlotViewer = view.scatterPlot();
sp.props.markerType = t;
Expand All @@ -29,6 +29,8 @@ category('webgpu', async () => {
}, {benchmarkTimeout: 10000, benchmark: true});

test(`GPURender Color: ${s / 1000000.0}m ${t}s`, async () => {
if (!gpuDevice || !DG.Test.isInBenchmark)
return;
const view = grok.shell.addTableView(grok.data.demo.randomWalk(s, 2));
const sp: DG.ScatterPlotViewer = view.scatterPlot();
sp.props.markerType = t;
Expand All @@ -41,6 +43,8 @@ category('webgpu', async () => {
}, {benchmarkTimeout: 10000, benchmark: true});

test(`GPURender Size: ${s / 1000000.0}m ${t}s`, async () => {
if (!gpuDevice || !DG.Test.isInBenchmark)
return;
const view = grok.shell.addTableView(grok.data.demo.randomWalk(s, 2));
const sp: DG.ScatterPlotViewer = view.scatterPlot();
sp.props.markerType = t;
Expand All @@ -53,6 +57,8 @@ category('webgpu', async () => {
}, {benchmarkTimeout: 10000, benchmark: true});

test(`GPUHitTest: ${s / 1000000.0}m ${t}s`, async () => {
if (!gpuDevice || !DG.Test.isInBenchmark)
return;
const view = grok.shell.addTableView(grok.data.demo.randomWalk(s, 2));
const sp: DG.ScatterPlotViewer = view.scatterPlot();
sp.props.markerType = t;
Expand Down

0 comments on commit 62a6b7a

Please sign in to comment.