Home
last modified time | relevance | path

Searched full:device_guard (Results 1 – 25 of 71) sorted by relevance

123

/aosp_15_r20/external/pytorch/test/dynamo/
H A Dtest_deviceguard.py25 device_guard = DeviceGuard(self.device_interface, 1)
27 with device_guard as _:
29 self.assertEqual(device_guard.prev_idx, 0)
30 self.assertEqual(device_guard.idx, 1)
33 self.assertEqual(device_guard.prev_idx, 0)
34 self.assertEqual(device_guard.idx, 1)
37 device_guard = DeviceGuard(self.device_interface, None)
39 with device_guard as _:
41 self.assertEqual(device_guard.prev_idx, -1)
42 self.assertEqual(device_guard.idx, None)
[all …]
/aosp_15_r20/external/pytorch/aten/src/ATen/test/
H A Dcuda_stream_test.cpp136 at::cuda::CUDAGuard device_guard(1); in TEST() local
207 at::cuda::CUDAGuard device_guard{1}; in TEST() local
303 at::cuda::CUDAGuard device_guard(0); in TEST() local
330 at::cuda::CUDAGuard device_guard(0); in TEST() local
334 at::cuda::CUDAGuard device_guard(1); in TEST() local
356 at::cuda::CUDAGuard device_guard(0); in TEST() local
398 at::cuda::CUDAGuard device_guard(0); in TEST() local
414 at::cuda::CUDAGuard device_guard(0); in TEST() local
422 at::cuda::CUDAGuard device_guard(0); in TEST() local
/aosp_15_r20/external/pytorch/aten/src/ATen/native/
H A Dnative_functions.yaml939 device_guard: False
946 device_guard: False
1362 device_guard: False
1459 device_guard: False
1464 device_guard: False
1634 device_guard: False
1760 device_guard: False
1964 device_guard: False
1995 device_guard: False
2082 device_guard: False
[all …]
/aosp_15_r20/external/pytorch/torchgen/dest/
H A Dregister_dispatch_key.py497 if self.backend_index.device_guard:
505 device_guard = "// DeviceGuard omitted" # default
506 if f.device_guard and self.backend_index.device_guard:
513 device_guard = """
514 const DeviceGuard device_guard(device_or_default(device));"""
518 device_guard = (
519 f"globalContext().lazyInitCUDA();\n{device_guard}"
547device_guard = f"const OptionalDeviceGuard device_guard(device_of({device_of}));"
555 {device_guard}
840 if self.backend_index.device_guard:
/aosp_15_r20/external/pytorch/aten/src/ATen/native/cuda/
H A DCopy.cu188 CUDAGuard device_guard(src_device); in copy_device_to_device() local
204 device_guard.set_device(dst_device); in copy_device_to_device()
207 device_guard.set_device(src_device); in copy_device_to_device()
250 device_guard.set_device(dst_device); in copy_device_to_device()
345 cuda::OptionalCUDAGuard device_guard; in copy_kernel_cuda() local
348 device_guard.set_device(dst_device); in copy_kernel_cuda()
351 device_guard.set_device(src_device); in copy_kernel_cuda()
H A DLoops.cuh185 const OptionalDeviceGuard device_guard(iter.device(1)); in opmath_gpu_kernel_with_scalars() local
210 OptionalDeviceGuard device_guard; in opmath_symmetric_gpu_kernel_with_scalars() local
222 device_guard.reset_device(iter.device(1)); in opmath_symmetric_gpu_kernel_with_scalars()
/aosp_15_r20/external/pytorch/docs/cpp/source/notes/
H A Dtensor_cuda_stream.rst149 at::cuda::CUDAGuard device_guard{1};
156 // current device is reset to device 0 after device_guard is destroyed
237 at::cuda::CUDAGuard device_guard(1);
241 // device index is reset to 0 after device_guard is destroyed
249 at::cuda::CUDAGuard device_guard(1);
254 // current device index is reset to 0 after `device_guard` is destroyed
/aosp_15_r20/external/pytorch/torch/csrc/cuda/
H A Dnccl.cpp588 at::cuda::OptionalCUDAGuard device_guard; in broadcast() local
591 device_guard.set_index(device); in broadcast()
640 at::cuda::OptionalCUDAGuard device_guard; in reduce() local
643 device_guard.set_index(device); in reduce()
694 at::cuda::OptionalCUDAGuard device_guard; in all_reduce() local
697 device_guard.set_index(device); in all_reduce()
736 at::cuda::OptionalCUDAGuard device_guard; in reduce_scatter() local
739 device_guard.set_index(device); in reduce_scatter()
777 at::cuda::OptionalCUDAGuard device_guard; in all_gather() local
780 device_guard.set_index(device); in all_gather()
H A Dcomm.cpp182 at::cuda::CUDAGuard device_guard(static_cast<DeviceIndex>(devices[0])); in _broadcast_out_impl() local
193 device_guard.set_index(static_cast<DeviceIndex>(devices[i])); in _broadcast_out_impl()
207 device_guard.set_index(static_cast<DeviceIndex>(devices[i])); in _broadcast_out_impl()
/aosp_15_r20/external/pytorch/torch/csrc/distributed/c10d/quantization/
H A Dquantization_gpu.cu60 at::cuda::OptionalCUDAGuard device_guard; in _float_to_bfloat16_cuda() local
61 device_guard.set_index(input.get_device()); in _float_to_bfloat16_cuda()
111 at::cuda::OptionalCUDAGuard device_guard; in _bfloat16_to_float_cuda() local
112 device_guard.set_index(input.get_device()); in _bfloat16_to_float_cuda()
/aosp_15_r20/external/pytorch/aten/src/ATen/native/quantized/cuda/
H A DFusedObsFakeQuant.cu140 at::cuda::OptionalCUDAGuard device_guard; in _calculate_moving_average() local
141 device_guard.set_index(x.get_device()); in _calculate_moving_average()
196 at::cuda::OptionalCUDAGuard device_guard; in _calc_moving_avg_qparams_helper() local
197 device_guard.set_index(x.get_device()); in _calc_moving_avg_qparams_helper()
H A DEmbeddingBag.cu214 at::cuda::OptionalCUDAGuard device_guard; in embedding_bag_byte_impl() local
215 device_guard.set_index(weight.get_device()); in embedding_bag_byte_impl()
396 at::cuda::OptionalCUDAGuard device_guard; in embedding_bag_4bit_impl() local
397 device_guard.set_index(weight.get_device()); in embedding_bag_4bit_impl()
/aosp_15_r20/external/pytorch/aten/src/ATen/
H A DTensorIndexing.cpp69 OptionalDeviceGuard device_guard(device_of(*this)); in index() local
78 OptionalDeviceGuard device_guard(device_of(*this)); in index_put_() local
84 OptionalDeviceGuard device_guard(device_of(*this)); in index_put_() local
/aosp_15_r20/external/pytorch/tools/autograd/templates/
H A Dpython_variable_methods.cpp250 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_contiguous() local
294 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_copy_() local
320 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_to() local
383 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_invert() local
448 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_nonzero() local
454 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_nonzero_numpy() local
953 OptionalDeviceGuard device_guard(device_of(self_)); in THPVariable_new() local
965 OptionalDeviceGuard device_guard(device_of(self_)); in THPVariable_new_tensor() local
/aosp_15_r20/external/pytorch/torchgen/
H A Dmodel.py492 device_guard: bool
640 device_guard = e.pop("device_guard", True)
641 assert isinstance(device_guard, bool), f"not a bool: {device_guard}"
940 device_guard=device_guard,
988 self.device_guard
989 ), "device_guard: False is not respected by structured kernels"
996 self.device_guard
997 ), "device_guard: False is not respected by structured kernels"
1276 device_guard: bool
H A Dgen_backend_stubs.py83 use_device_guard = yaml_values.pop("device_guard", False)
86 ), f"You must provide either True or False for device_guard. Provided: {use_device_guard}"
150 device_guard=use_device_guard,
/aosp_15_r20/external/pytorch/tools/test/
H A Dtest_gen_backend_stubs.py270 # if device_guard is provided, it must be a bool
275 device_guard: frue
281 """You must provide either True or False for device_guard. Provided: frue""",
/aosp_15_r20/external/pytorch/torch/csrc/utils/
H A Dtensor_new.cpp647 at::OptionalDeviceGuard device_guard(deviceOptional); in legacy_sparse_tensor_generic_ctor_new() local
659 at::OptionalDeviceGuard device_guard(deviceOptional); in legacy_sparse_tensor_generic_ctor_new() local
740 at::OptionalDeviceGuard device_guard(deviceOptional); in legacy_tensor_generic_ctor_new() local
955 at::OptionalDeviceGuard device_guard(r.deviceOptional(ARG_DEVICE)); in sparse_compressed_tensor_ctor_worker() local
1010 at::OptionalDeviceGuard device_guard(r.deviceOptional(ARG_DEVICE1)); in sparse_compressed_tensor_ctor_worker() local
1182 at::OptionalDeviceGuard device_guard(r.deviceOptional(ARG_DEVICE)); in sparse_coo_tensor_ctor() local
1216 at::OptionalDeviceGuard device_guard(r.deviceOptional(ARG_DEVICE1)); in sparse_coo_tensor_ctor() local
1249 at::OptionalDeviceGuard device_guard(r.deviceOptional(ARG_DEVICE2)); in sparse_coo_tensor_ctor() local
/aosp_15_r20/external/pytorch/torch/csrc/autograd/
H A Dpython_torch_functions_manual.cpp55 OptionalDeviceGuard device_guard(device_of(result)); in dispatch_range() local
66 DeviceGuard device_guard(options.device()); in dispatch_range() local
152 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_nonzero() local
158 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_nonzero() local
164 OptionalDeviceGuard device_guard(device_of(self)); in dispatch_nonzero_numpy() local
/aosp_15_r20/external/pytorch/aten/src/ATen/cuda/detail/
H A DCUDAHooks.cpp132 at::OptionalDeviceGuard device_guard; in isPinnedPtr() local
135 device_guard.reset_device(at::Device(at::DeviceType::CUDA, *primary_ctx_device_index)); in isPinnedPtr()
458 at::DeviceGuard device_guard(at::Device(at::DeviceType::CUDA, device_index)); in deviceSynchronize() local
/aosp_15_r20/external/pytorch/aten/src/ATen/cuda/
H A DEmptyTensor.cpp16 const DeviceGuard device_guard(device); in empty_cuda() local
56 const DeviceGuard device_guard(device); in empty_strided_cuda() local
/aosp_15_r20/external/pytorch/torch/csrc/profiler/stubs/
H A Dcuda.cpp89 at::cuda::OptionalCUDAGuard device_guard; in onEachDevice() local
91 device_guard.set_index(i); in onEachDevice()
/aosp_15_r20/external/pytorch/test/cpp_extensions/open_registration_extension/pytorch_openreg/csrc/
H A DOpenRegMem.cpp73 const c10::DeviceGuard device_guard(device); in empty_openreg() local
91 const c10::DeviceGuard device_guard(device); in empty_strided_openreg() local
/aosp_15_r20/external/pytorch/c10/xpu/test/impl/
H A DXPUGuardTest.cpp19 const c10::DeviceGuard device_guard(device); in TEST() local
38 const c10::DeviceGuard device_guard(device); in TEST() local
/aosp_15_r20/external/pytorch/aten/src/ATen/native/sparse/cuda/
H A DSparseSemiSturcturedApply.cu37 std::optional<at::cuda::CUDAGuard> device_guard;
39 device_guard.emplace(input.device());

123