CMakeLists.txt 3.2 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
mei-ye's avatar
mei-ye committed
42
43
    opt/memory_coloring.cpp
    opt/memory_coloring_impl.cpp
Paul's avatar
Paul committed
44
)
Paul's avatar
Paul committed
45
rocm_set_soversion(migraphx ${MIGRAPHX_SO_VERSION})
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
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
78
    equal
79
80
81
82
83
    erf
    exp
    flatten
    floor
    gather
84
    greater
85
86
87
88
    gru
    identity
    im2col
    leaky_relu
89
    less
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
135
136
137
138
139
140
    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
141
rocm_clang_tidy_check(migraphx)
Paul's avatar
Paul committed
142
rocm_install_targets(
Paul's avatar
Paul committed
143
  TARGETS migraphx
Paul's avatar
Paul committed
144
145
146
  INCLUDE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)
Paul's avatar
Paul committed
147

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

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

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

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

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