Caffe2 - Python API
A deep learning, cross platform ML framework
hip_test_util.py
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 
9 from __future__ import absolute_import
10 from __future__ import division
11 from __future__ import print_function
12 from __future__ import unicode_literals
13 
14 from caffe2.proto import caffe2_pb2
15 
16 def run_in_hip(gc, dc):
17  return (gc.device_type == caffe2_pb2.HIP) or (
18  caffe2_pb2.HIP in {d.device_type for d in dc})