Skip to content

Commit

Permalink
[webgpu] Add program label for shader (#5905)
Browse files Browse the repository at this point in the history
* [webgpu] Add program label for shader

This is used for tracing.

* Add label for pipeline

Co-authored-by: Jiajia Qin <[email protected]>
Co-authored-by: Ping Yu <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2021
1 parent 5b33e5c commit a2b5ccf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tfjs-backend-webgpu/src/kernels/webgpu_program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ export const compileProgram =

const source = shader_preprocessor.makeShader(
inputsData, outputData, program, isFromPixel);
const module = device.createShaderModule({code: source});
const pipeline = device.createComputePipeline(
{layout: pipelineLayout, compute: {module, entryPoint: 'main'}});
const module = device.createShaderModule(
{code: source, label: program.constructor.name});
const pipeline = device.createComputePipeline({
layout: pipelineLayout,
compute: {module, entryPoint: 'main'},
label: program.constructor.name
});

return pipeline;
};
Expand Down

0 comments on commit a2b5ccf

Please sign in to comment.