-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webgl backend for bitwise AND API #7654
Conversation
program = new BinaryOpProgram(BITWISEAND, a.shape, b.shape); | ||
} | ||
|
||
return webglBackend.runWebGLProgram(program, [a, b], $dtype); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe wrap it with binaryKernelFunc
like tfjs-backend-webgl/kernels/Add.ts
to utilize the CPU forward implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to check webgl version for this, which is different from other binary ops. If using binaryKernelFunc
, then we either have to change a lot for binaryKernelFunc
or make a wrapper to call binaryKernelFunc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Implemented the CPU forward logic in the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just left some nits.
b55d5de
to
40a678c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work, thanks!
`Unsupported webgl version. Current webgl version: ${versionNumber}`); | ||
} | ||
|
||
// The type of a and b are ensured to be `int` in core, therefore no need to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: int -> int32
2f10aa1
to
90b51bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, thanks Fengwu!
Implement webgl kernels for bitwise
AND
APIyarn test
undertfjs-backend-webgl
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.