-
Notifications
You must be signed in to change notification settings - Fork 73
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
[GPU/OpenCL] Handling pre-compiled and existing kernels #2535
Conversation
Added feature for reading kernel binaries. Managing already created kernels. Added static flag and bitmask to check existing kernels. Signed-off-by: Debadri Samaddar <s.debadri@samsung.com>
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2535. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
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.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
LGTM. Later, kernel path policy should be aware of security and privileges of Android and Tizen devices. In such devices, it should be able to accept different paths per app or the caller. However, as long as the kernel path is configurable, it can wait until opencl support becomes mature. |
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
nntrainer/layers/layer_context.cpp
Outdated
|
||
// checking bitmask for already initialized kernel. eg: 010 & 000 -> 0 but 010 | ||
// & 110 -> 010 | ||
if (layerKernel == (kernelInitializedMask & layerKernel)) { |
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.
if (layerKernel & kernelInitializedMask) {
I think that this statement has the same effect.
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.
Yes...nice observation.
nntrainer/layers/layer_context.cpp
Outdated
getKernelName(layerKernel) + "_kernel.bin", | ||
std::ios::binary | std::ios::in); | ||
|
||
if (fs) { |
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.
if (fs) { | |
if (fs.good()) { |
Is there any case that fs
can be null?
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.
I don't think the fs
object can be null.
Updated ifstream object valid condition Signed-off-by: Debadri Samaddar <s.debadri@samsung.com>
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.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
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
Handling existing kernels:
clCreateKernel
to read pre-compiled kernel binaries.Signed-off-by: Debadri Samaddar s.debadri@samsung.com