CMakeLists.txt 3.1 KB
Newer Older
Paul's avatar
Paul committed
1

Paul's avatar
Paul committed
2
3
include(ROCMInstallTargets)
include(ROCMPackageConfigHelpers)
4
include(RegisterOp)
Paul's avatar
Paul committed
5

Paul's avatar
Paul committed
6
add_library(migraphx 
Paul's avatar
Paul committed
7
    auto_contiguous.cpp
Paul's avatar
Paul committed
8
    eliminate_common_subexpression.cpp
9
    decompose.cpp
Paul's avatar
Paul committed
10
    propagate_constant.cpp
Paul's avatar
Paul committed
11
    dead_code_elimination.cpp
Paul's avatar
Paul committed
12
    eliminate_allocation.cpp
13
    eliminate_contiguous.cpp
14
    eliminate_concat.cpp
15
    eliminate_identity.cpp
16
    eliminate_pad.cpp
Paul's avatar
Paul committed
17
    rewrite_batchnorm.cpp
Shucai Xiao's avatar
Shucai Xiao committed
18
    rewrite_rnn.cpp
19
    rewrite_pooling.cpp
Paul's avatar
Paul committed
20
    env.cpp
Paul's avatar
Paul committed
21
    generate.cpp
Paul's avatar
Paul committed
22
    instruction.cpp
23
    make_op.cpp
24
    msgpack.cpp
Paul's avatar
Paul committed
25
    program.cpp
Shucai Xiao's avatar
Shucai Xiao committed
26
    quantization.cpp
27
    reduce_dims.cpp
28
    remap.cpp
Paul's avatar
Paul committed
29
    shape.cpp
Paul's avatar
Paul committed
30
    schedule.cpp
31
    serialize.cpp
32
    pass_manager.cpp
33
    register_op.cpp
Paul's avatar
Paul committed
34
    simplify_algebra.cpp
Paul's avatar
Paul committed
35
    simplify_reshapes.cpp
36
    value.cpp
37
    verify_args.cpp
Shucai Xiao's avatar
Shucai Xiao committed
38
    json.cpp
mei-ye's avatar
mei-ye committed
39
40
    opt/memory_coloring.cpp
    opt/memory_coloring_impl.cpp
Paul's avatar
Paul committed
41
)
Paul's avatar
Paul committed
42
rocm_set_soversion(migraphx ${MIGRAPHX_SO_VERSION})
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
function(register_migraphx_ops)
    foreach(OP ${ARGN})
        register_op(migraphx HEADER migraphx/op/${OP}.hpp OPERATORS op::${OP})
    endforeach()
endfunction()
register_migraphx_ops(
    abs
    acosh
    acos
    add
    argmax
    argmin
    asinh
    asin
    as_shape
    atanh
    atan
    batch_norm_inference
    broadcast
    capture
    ceil
    clip
    concat
    contiguous
    convert
    convolution
    cosh
    cos
    deconvolution
    div
    dot
    elu
    erf
    exp
    flatten
    floor
    gather
    gru
    identity
    im2col
    leaky_relu
    load
    log
    logsoftmax
    lrn
    lstm
    max
    min
    mul
    multibroadcast
    neg
    outline
    pad
    pooling
    pow
    prelu
    quant_convolution
    quant_dot
    recip
    reduce_max
    reduce_mean
    reduce_min
    reduce_prod
    reduce_sum
    relu
    reshape
    rnn
    rnn_last_cell_output
    rnn_last_hs_output
    rnn_var_sl_last_output
    round
    rsqrt
    scalar
    sigmoid
    sign
    sinh
    sin
    slice
    softmax
    sqdiff
    sqrt
    squeeze
    sub
    tanh
    tan
    transpose
    undefined
    unknown
    unsqueeze
)
register_op(migraphx HEADER migraphx/op/rnn_variable_seq_lens.hpp OPERATORS op::rnn_var_sl_shift_output op::rnn_var_sl_shift_sequence)
register_op(migraphx HEADER migraphx/builtin.hpp OPERATORS builtin::literal builtin::param builtin::returns)
Paul's avatar
Paul committed
135
rocm_clang_tidy_check(migraphx)
Paul's avatar
Paul committed
136
rocm_install_targets(
Paul's avatar
Paul committed
137
  TARGETS migraphx
Paul's avatar
Paul committed
138
139
140
  INCLUDE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)
Paul's avatar
Paul committed
141

Paul's avatar
Paul committed
142
find_path(HALF_INCLUDE_DIR half.hpp)
Paul's avatar
Paul committed
143
# TODO: Fix the incorrect path
Paul's avatar
Paul committed
144
target_include_directories(migraphx SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
Paul's avatar
Paul committed
145

146
147
148
149
150
find_package(msgpack REQUIRED)
target_link_libraries(migraphx PRIVATE msgpackc-cxx)
# Make this available to the tests
target_link_libraries(migraphx INTERFACE $<BUILD_INTERFACE:msgpackc-cxx>)

Paul's avatar
Paul committed
151
set(PACKAGE_DEPENDS)
Paul's avatar
Paul committed
152

Paul Fultz II's avatar
Paul Fultz II committed
153
add_subdirectory(api)
Paul's avatar
Paul committed
154
add_subdirectory(driver)
Paul's avatar
Paul committed
155
add_subdirectory(onnx)
Khalique's avatar
Khalique committed
156
add_subdirectory(tf)
Khalique's avatar
Khalique committed
157

Paul's avatar
Paul committed
158
add_subdirectory(py)
Paul's avatar
Paul committed
159
add_subdirectory(targets/cpu)
Paul's avatar
Paul committed
160
if(MIGRAPHX_ENABLE_GPU)
Paul Fultz II's avatar
Paul Fultz II committed
161
list(APPEND PACKAGE_DEPENDS PACKAGE MIOpen PACKAGE rocblas)
Paul's avatar
Paul committed
162
add_subdirectory(targets/gpu)
Paul's avatar
Paul committed
163
endif()
mei-ye's avatar
mei-ye committed
164

Paul's avatar
Paul committed
165
rocm_export_targets(
Paul's avatar
Paul committed
166
167
  TARGETS migraphx::migraphx
  NAMESPACE migraphx::
Paul's avatar
Paul committed
168
169
170
  DEPENDS
    ${PACKAGE_DEPENDS}
)
mei-ye's avatar
mei-ye committed
171
172