CMakeLists.txt 3.22 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 
7
    analyze_streams.cpp
Paul's avatar
Paul committed
8
    auto_contiguous.cpp
Paul's avatar
Paul committed
9
    eliminate_common_subexpression.cpp
10
    decompose.cpp
Paul's avatar
Paul committed
11
    propagate_constant.cpp
Paul's avatar
Paul committed
12
    dead_code_elimination.cpp
Paul's avatar
Paul committed
13
    eliminate_allocation.cpp
14
    eliminate_contiguous.cpp
15
    eliminate_concat.cpp
16
    eliminate_identity.cpp
17
    eliminate_pad.cpp
Paul's avatar
Paul committed
18
    rewrite_batchnorm.cpp
Shucai Xiao's avatar
Shucai Xiao committed
19
    rewrite_rnn.cpp
20
    rewrite_pooling.cpp
Paul's avatar
Paul committed
21
    env.cpp
Paul's avatar
Paul committed
22
    generate.cpp
Paul's avatar
Paul committed
23
    instruction.cpp
24
    load_save.cpp
25
    make_op.cpp
26
    msgpack.cpp
Paul's avatar
Paul committed
27
    program.cpp
Shucai Xiao's avatar
Shucai Xiao committed
28
    quantization.cpp
29
    reduce_dims.cpp
30
    remap.cpp
Paul's avatar
Paul committed
31
    shape.cpp
Paul's avatar
Paul committed
32
    schedule.cpp
33
    serialize.cpp
34
    pass_manager.cpp
35
    register_op.cpp
36
    register_target.cpp
Paul's avatar
Paul committed
37
    simplify_algebra.cpp
Paul's avatar
Paul committed
38
    simplify_reshapes.cpp
39
    value.cpp
40
    verify_args.cpp
Shucai Xiao's avatar
Shucai Xiao committed
41
    json.cpp
42
    convert_to_json.cpp
mei-ye's avatar
mei-ye committed
43
44
    opt/memory_coloring.cpp
    opt/memory_coloring_impl.cpp
Paul's avatar
Paul committed
45
)
Paul's avatar
Paul committed
46
rocm_set_soversion(migraphx ${MIGRAPHX_SO_VERSION})
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
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
79
    equal
80
81
82
83
84
    erf
    exp
    flatten
    floor
    gather
85
    greater
86
87
88
89
    gru
    identity
    im2col
    leaky_relu
90
    less
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
135
136
137
138
139
140
141
    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
142
rocm_clang_tidy_check(migraphx)
Paul's avatar
Paul committed
143
rocm_install_targets(
Paul's avatar
Paul committed
144
  TARGETS migraphx
Paul's avatar
Paul committed
145
146
147
  INCLUDE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)
Paul's avatar
Paul committed
148

Paul's avatar
Paul committed
149
find_path(HALF_INCLUDE_DIR half.hpp)
Paul's avatar
Paul committed
150
# TODO: Fix the incorrect path
Paul's avatar
Paul committed
151
target_include_directories(migraphx SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
Paul's avatar
Paul committed
152

153
154
155
156
157
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
158
set(PACKAGE_DEPENDS)
Paul's avatar
Paul committed
159

Paul Fultz II's avatar
Paul Fultz II committed
160
add_subdirectory(api)
Paul's avatar
Paul committed
161
add_subdirectory(driver)
Paul's avatar
Paul committed
162
add_subdirectory(onnx)
Khalique's avatar
Khalique committed
163
add_subdirectory(tf)
Khalique's avatar
Khalique committed
164

Paul's avatar
Paul committed
165
add_subdirectory(py)
Paul's avatar
Paul committed
166
add_subdirectory(targets/cpu)
Paul's avatar
Paul committed
167
if(MIGRAPHX_ENABLE_GPU)
Paul Fultz II's avatar
Paul Fultz II committed
168
list(APPEND PACKAGE_DEPENDS PACKAGE MIOpen PACKAGE rocblas)
Paul's avatar
Paul committed
169
add_subdirectory(targets/gpu)
Paul's avatar
Paul committed
170
endif()
mei-ye's avatar
mei-ye committed
171

Paul's avatar
Paul committed
172
rocm_export_targets(
Paul's avatar
Paul committed
173
174
  TARGETS migraphx::migraphx
  NAMESPACE migraphx::
Paul's avatar
Paul committed
175
176
177
  DEPENDS
    ${PACKAGE_DEPENDS}
)
mei-ye's avatar
mei-ye committed
178
179