Skip to content

Commit

Permalink
Fix empty dispatch for bitwise_not (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVieriu97 authored and kulinseth committed Oct 31, 2022
1 parent 897e314 commit 77bdce7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aten/src/ATen/native/mps/operations/BitwiseOps.mm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ void handle_tensor_scalar_binary_op(const at::Tensor& self, const at::Scalar& ot
getMetalType(self),
getMetalType(self),
"bitwise_not");
uint32_t length = output.numel();
if (length == 0) {
return output_;
}

dispatch_sync(stream->queue(), ^(){
id<MTLCommandBuffer> buffer = stream->commandBuffer();
id<MTLComputeCommandEncoder> commandEncoder = [buffer computeCommandEncoder];
Expand Down

0 comments on commit 77bdce7

Please sign in to comment.