forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_caffe2_amd.py
executable file
·61 lines (51 loc) · 1.48 KB
/
build_caffe2_amd.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import argparse
import os
import sys
from pyHIPIFY import hipify_python
amd_build_dir = os.path.dirname(os.path.realpath(__file__))
proj_dir = os.path.join(os.path.dirname(os.path.dirname(amd_build_dir)))
includes = [
"caffe2/operators/*",
"caffe2/sgd/*",
"caffe2/image/*",
"caffe2/transforms/*",
"caffe2/video/*",
"caffe2/distributed/*",
"caffe2/queue/*",
"binaries/*",
"caffe2/**/*_test*",
"caffe2/core/*",
"caffe2/db/*",
]
ignores = [
"caffe2/operators/depthwise_3x3_conv_op.cu",
"caffe2/operators/depthwise_3x3_conv_op_cudnn.cu",
"caffe2/operators/top_k.cu",
"caffe2/operators/top_k_radix_selection.cuh",
"caffe2/operators/top_k_heap_selection.cuh",
"caffe2/operators/pool_op_cudnn.cu",
"caffe2/operators/roi_align_op_gpu_test.cc",
'**/hip/**',
]
file_extensions = ['.cc', '.cu', '.h', '.cuh']
parser = argparse.ArgumentParser(
description="The Script to Hipify Caffe2")
parser.add_argument(
'--hip-suffix',
type=str,
default='cc',
help="The suffix for the hipified files",
required=False)
args = parser.parse_args()
hipify_python.hipify(
project_directory=proj_dir,
output_directory=proj_dir,
includes=includes,
extensions=file_extensions,
ignores=ignores,
hipify_caffe2=True,
add_static_casts_option=True,
hip_suffix=args.hip_suffix,
extensions_to_hip_suffix=['.cc', '.cu'])