@@ -22,7 +22,6 @@ namespace at { namespace native {
22
22
// Utility functions
23
23
// --------------------------------------------------------------------
24
24
25
- #ifndef __HIP_PLATFORM_HCC__
26
25
namespace {
27
26
IntTensor _to_csr_int (const LongTensor& rowIndices, int64_t dim, int64_t nnz) {
28
27
IntTensor csr = at::empty ({dim+1 }, CUDA (kInt ));
@@ -32,7 +31,6 @@ namespace {
32
31
return csr;
33
32
}
34
33
}
35
- #endif
36
34
37
35
// NB: Deleted spaddcmul (aka addcmul_, but not actually wired up), spaddcdiv (not
38
36
// wired at all)
@@ -42,7 +40,6 @@ namespace {
42
40
// --------------------------------------------------------------------
43
41
44
42
Tensor& s_addmm_out_sparse_dense_cuda (Tensor& r_, const Tensor& t, const SparseTensor& sparse_, const Tensor& dense, Scalar beta, Scalar alpha) {
45
- #ifndef __HIP_PLATFORM_HCC__
46
43
AT_ASSERT (t.is_cuda ()); // dispatch argument
47
44
AT_CHECK (r_.is_cuda (), " addmm: expected 'out' to be CUDA, but got CPU" );
48
45
AT_CHECK (sparse_.is_cuda (), " addmm: expected 'mat1' to be CUDA, but got CPU" );
@@ -141,9 +138,6 @@ Tensor& s_addmm_out_sparse_dense_cuda(Tensor& r_, const Tensor& t, const SparseT
141
138
142
139
r_.copy_ (r__);
143
140
return r_;
144
- #else
145
- AT_ERROR (" s_addmm_out_sparse_dense_cuda: HIP not supported" );
146
- #endif
147
141
}
148
142
149
143
Tensor s_addmm_sparse_dense_cuda (
@@ -175,7 +169,6 @@ Tensor& s_addmm_sparse_dense_cuda_(
175
169
// --------------------------------------------------------------------
176
170
177
171
SparseTensor& hspmm_out_sparse_cuda (SparseTensor& r_, const SparseTensor& sparse_, const Tensor& dense/* , Scalar alpha */ ) {
178
- #ifndef __HIP_PLATFORM_HCC__
179
172
AT_ASSERT (sparse_.is_cuda ()); // dispatch argument
180
173
AT_CHECK (r_.is_cuda (), " hspmm: expected 'out' to be CUDA, but got CPU" );
181
174
AT_CHECK (dense.is_cuda (), " hspmm: expected 'mat2' to be CUDA, but got CPU" );
@@ -231,9 +224,6 @@ SparseTensor& hspmm_out_sparse_cuda(SparseTensor& r_, const SparseTensor& sparse
231
224
_get_sparse_impl (r_)->set_indices_and_values_unsafe (indices, values);
232
225
233
226
return r_;
234
- #else
235
- AT_ERROR (" hspmm_out_sparse_cuda: HIP not supported" );
236
- #endif
237
227
}
238
228
239
229
SparseTensor hspmm_sparse_cuda (const SparseTensor& sparse, const Tensor& dense) {
@@ -248,7 +238,6 @@ SparseTensor hspmm_sparse_cuda(const SparseTensor& sparse, const Tensor& dense)
248
238
// --------------------------------------------------------------------
249
239
250
240
Tensor& add_out_dense_sparse_cuda (Tensor& r_, const Tensor& dense, SparseTensorRef sparse_, at::Scalar value) {
251
- #ifndef __HIP_PLATFORM_HCC__
252
241
const SparseTensor& sparse = sparse_.tref ;
253
242
254
243
AT_ASSERT (dense.is_cuda ()); // dispatch argument
@@ -339,17 +328,13 @@ Tensor& add_out_dense_sparse_cuda(Tensor& r_, const Tensor& dense, SparseTensorR
339
328
THCudaCheck (cudaGetLastError ());
340
329
341
330
return r_;
342
- #else
343
- AT_ERROR (" add_out_dense_sparse_cuda: HIP not supported" );
344
- #endif
345
331
}
346
332
347
333
// --------------------------------------------------------------------
348
334
// add(SparseTensor, SparseTensor, Scalar) [broadcasts]
349
335
// --------------------------------------------------------------------
350
336
351
337
SparseTensor& add_out_sparse_cuda (SparseTensor& r_, const SparseTensor& t, const SparseTensor& src, Scalar value) {
352
- #ifndef __HIP_PLATFORM_HCC__
353
338
AT_ASSERT (t.is_cuda ()); // dispatch argument
354
339
AT_CHECK (src.is_cuda (), " add: expected 'other' to be CUDA, but got CPU" );
355
340
AT_CHECK (r_.is_cuda (), " add: expected 'out' to be CUDA, but got CPU" );
@@ -396,17 +381,13 @@ SparseTensor& add_out_sparse_cuda(SparseTensor& r_, const SparseTensor& t, const
396
381
// }
397
382
398
383
return r_;
399
- #else
400
- AT_ERROR (" s_add_out_sparse_cuda: HIP not supported" );
401
- #endif
402
384
}
403
385
404
386
// --------------------------------------------------------------------
405
387
// mul(SparseTensor, SparseTensor) [broadcasts]
406
388
// --------------------------------------------------------------------
407
389
408
390
SparseTensor& mul_out_sparse_cuda (SparseTensor& r_, const SparseTensor& t_, const SparseTensor& src_) {
409
- #ifndef __HIP_PLATFORM_HCC__
410
391
if (src_.dim () == 0 ) {
411
392
return mul_out_sparse_zerodim (r_, t_, src_);
412
393
} else if (t_.dim () == 0 ) {
@@ -474,9 +455,6 @@ SparseTensor& mul_out_sparse_cuda(SparseTensor& r_, const SparseTensor& t_, cons
474
455
_get_sparse_impl (r_)->set_coalesced (true );
475
456
476
457
return r_;
477
- #else
478
- AT_ERROR (" mul_out_sparse_cuda: HIP not supported" );
479
- #endif
480
458
}
481
459
482
460
}} // namespace at::native
0 commit comments