Skip to content

Commit

Permalink
[js/webgpu] resolve codescan alert (#19343)
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire authored Jan 31, 2024
1 parent d73131c commit dd1f6cc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions js/web/lib/wasm/jsep/backend-webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,11 @@ export class WebGpuBackend {

captureBegin(): void {
LOG_DEBUG('info', 'captureBegin');
let sessionCommandList = this.capturedCommandList.get(this.currentSessionId!);
let sessionPendingKernels = this.capturedPendingKernels.get(this.currentSessionId!);
if (!sessionCommandList) {
sessionCommandList = [];
this.capturedCommandList.set(this.currentSessionId!, sessionCommandList);
sessionPendingKernels = [];
this.capturedPendingKernels.set(this.currentSessionId!, sessionPendingKernels);
if (!this.capturedCommandList.get(this.currentSessionId!)) {
this.capturedCommandList.set(this.currentSessionId!, []);
}
if (!this.capturedPendingKernels.get(this.currentSessionId!)) {
this.capturedPendingKernels.set(this.currentSessionId!, []);
}
// flush the left commands before we change the status.
this.flush();
Expand Down

0 comments on commit dd1f6cc

Please sign in to comment.