-
Notifications
You must be signed in to change notification settings - Fork 699
OpenCL: fix insert tensor operation for OpenCL backend. #220
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
Conversation
lib/Backends/OpenCL/OpenCL.cpp
Outdated
enqueueKernel(commands_, kernel, deviceId_, {idim.n}); | ||
kernels.push_back(kernel); | ||
// Currently support tensors of 2 and 4 dimensions. | ||
// TODO: rdzhabarov, allow other dimensions here. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
lib/Backends/OpenCL/OpenCL.cpp
Outdated
auto odim = ShapeNHWC(CI->getDest()->getType()->dims()); | ||
auto idim = ShapeNHWC(CI->getSrc()->getType()->dims()); | ||
auto offset = ShapeNHWC(CI->getOffsets()); | ||
addInsertTensorInstruction(kernels, kernel, odim, idim, offset); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
lib/Backends/OpenCL/OpenCL.cpp
Outdated
// Currently support tensors of 2 and 4 dimensions. | ||
// TODO: Handle other dimensions. | ||
const size_t numDimensions = CI->getDest()->getType()->dims().size(); | ||
std::unique_ptr<ShapeNHWC> odim, idim, offset; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Perfect! Thanks Roman!
This is covered by tests while running Execution Engine in the OpenCL mode.
2-dimensional tensors appear if
concat
is used onfully connected nodes
.