Skip to content

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

Merged
merged 1 commit into from
Jan 4, 2018
Merged

OpenCL: fix insert tensor operation for OpenCL backend. #220

merged 1 commit into from
Jan 4, 2018

Conversation

rdzhabarov
Copy link
Contributor

This is covered by tests while running Execution Engine in the OpenCL mode.

2-dimensional tensors appear if concat is used on fully connected nodes.

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.

This comment was marked as off-topic.

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.

This comment was marked as off-topic.

// 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.

Copy link
Contributor

@nadavrot nadavrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks Roman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants