8000 index_put_ for complex tensors on CUDA (#51148) · pytorch/pytorch@4a2aa0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a2aa0f

Browse files
anjali411facebook-github-bot
authored andcommitted
index_put_ for complex tensors on CUDA (#51148)
Summary: Pull Request resolved: #51148 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D26102025 Pulled By: anjali411 fbshipit-source-id: b1b6fd12fda03c4520a3c3200226edf352496188
1 parent 0b5303e commit 4a2aa0f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

aten/src/ATen/native/cuda/Indexing.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void index_put_accum_kernel(Tensor & self, const c10::List<c10::optional<Tensor>
230230
std::min(std::max<int>(1,nElemBefore), at::cuda::getCurrentDeviceProperties()->maxGridSize[2]));
231231
dim3 block(C10_WARP_SIZE, indices_per_block);
232232

233-
AT_DISPATCH_ALL_TYPES_AND3(at::ScalarType::Half, at::ScalarType::Bool, at::ScalarType::BFloat16,
233+
AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3(at::ScalarType::Half, at::ScalarType::Bool, at::ScalarType::BFloat16,
234234
value_.scalar_type(), "indexing_backward", [&] {
235235
indexing_backward_kernel<scalar_t, UNROLL><<<grid, block, 0, stream>>>(
236236
sorted_indices.data_ptr<int64_t>(),

test/test_indexing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,9 @@ def test_int_indices(self, device):
762762
self.assertEqual(v[:, [0, 4, 2]].shape, (5, 3, 3))
763763
self.assertEqual(v[:, [[0, 1], [4, 3]]].shape, (5, 2, 2, 3))
764764

765-
@dtypes(torch.float, torch.bfloat16, torch.long, torch.bool)
766-
@dtypesIfCPU(torch.float, torch.long, torch.bool, torch.bfloat16)
767-
@dtypesIfCUDA(torch.half, torch.long, torch.bool, torch.bfloat16)
765+
@dtypes(torch.cfloat, torch.cdouble, torch.float, torch.bfloat16, torch.long, torch.bool)
766+
@dtypesIfCPU(torch.cfloat, torch.cdouble, torch.float, torch.long, torch.bool, torch.bfloat16)
767+
@dtypesIfCUDA(torch.cfloat, torch.cdouble, torch.half, torch.long, torch.bool, torch.bfloat16)
768768
def test_index_put_src_datatype(self, device, dtype):
769769
src = torch.ones(3, 2, 4, device=device, dtype=dtype)
770770
vals = torch.ones(3, 2, 4, device=device, dtype=dtype)

0 commit comments

Comments
 (0)
0