hip_test_util.py 405 B

123456789101112131415161718
  1. ## @package hip_test_util
  2. # Module caffe2.python.hip_test_util
  3. """
  4. The HIP test utils is a small addition on top of the hypothesis test utils
  5. under caffe2/python, which allows one to more easily test HIP/ROCm related
  6. operators.
  7. """
  8. from caffe2.proto import caffe2_pb2
  9. def run_in_hip(gc, dc):
  10. return (gc.device_type == caffe2_pb2.HIP) or (
  11. caffe2_pb2.HIP in {d.device_type for d in dc})